Skip to content
This repository was archived by the owner on Feb 26, 2024. It is now read-only.

Broken link / missing documentation how to write tests in TypeScript #569

Open
digulla opened this issue Nov 20, 2019 · 3 comments
Open
Assignees

Comments

@digulla
Copy link

digulla commented Nov 20, 2019

At the bottom of https://www.trufflesuite.com/docs/truffle/testing/writing-tests-in-javascript is:

Please see the Writing Tests in JavaScript guide for more information.

which just points to the link above. You could simply replace this with "see above".

Can you please create a document which explains nuances how to write tests using TypeScript. Topics:

  • How to configure the project when you want to import NPM modules (i.e. how to make this work: import chai from 'chai')
  • How to expect BigNumber results

My approaches for the latter are:

let winner = await ballot.winningProposal();
expect(winner.toString()).to.equal('1');
expect(winner).to.eql(web3.utils.toBN('1')); // Deep compare works, equal() doesn't
@OnlyOneJMJQ
Copy link
Contributor

Hi @digulla, sorry for the late response--we're getting around to reviewing website issues and PRs more regularly now!

Hear you on the self-referential link--we can think of better wording for that.

As for the separate TS testing page: @eggplantzzz @gnidan I see value there, but would love to see if you have an additional thoughts?

@eggplantzzz
Copy link
Contributor

We really should have a section on writing tests using TypeScript. I actually have never done this and will have to dig up the references that @CruzMolina used to point me to for a guide on doing this.

@benjamincburns
Copy link
Contributor

benjamincburns commented Jul 28, 2022

I'll take this on as part of epic #5194

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants