Tests are written in plain JavaScript.
Tests are intended to test the build result(dist.node/
& dist.web/
), instead of the source(src/
).
The test runner will NOT build the project; you need to do so manually on demand. See the dedicated contributing docs for details and advanced instructions.
Test files must follow the pattern **.{spec,test}.[cm]?js
, to be picked up.
Test runner is mocha
, configured in mocharc file.
npm test
Some tests check against snapshots.
To update these, set the env var CJL_TEST_UPDATE_SNAPSHOTS
to a non-falsy value.
like so:
CJL_TEST_UPDATE_SNAPSHOTS=1 npm test
TODO: generate mocha for browser and run it in a headless env.