Skip to content

Testing

Anthony Fu edited this page Feb 13, 2020 · 2 revisions

This project uses Jest for unit and snapshot testing.

You can run all the tests by

npm test

All test cases can be found under the test folder.

Watch and Rerun

If you are working on a feature using TDD, you can run and watch a particular test by

npm test ./test/stdlib.math.test.ts -- --watch

Snapshot Testing

We use Snapshot Testing for examples to make sure most of the code works as expected.

There are some articles about snapshot testing:

If you made some changes by purpose and it breaks the snapshot testing, you may need to update the snapshot by

npm run test:update