Skip to content

DApp Tests

Franco Victorio edited this page Jan 22, 2018 · 2 revisions

The DApp is tested using jest. To run the tests, execute npm run test:dapp.

You can pass extra flags and arguments to jest by appending them after --. For example, you can run Jest in watch mode by doing:

npm run test:dapp -- --watch

To run only the specs that match MyComponent you can do:

npm run test:dapp -- MyComponent

You can find other options here

Adding tests

If you want to add a test for some file, create a new file with the same name but with the extension .spec.js. For example, if you have a file named MyComponent.js, create another file next to it called MyComponent.spec.js.

Clone this wiki locally