The unit tests are based around Mocha and Sinon. This gives a very simple mocking and test interface.
They are run using Karma, which also provides for code coverage.
WebExtensions are automatically stubbed by the sinon-chrome package.
Note: Currently the package only stubs chrome.* APIs. There is an issue on file to consider supporting the Firefox ones - browser.*
The test files live in the test/unit
directory. karma.conf.js
controls the
loading and running of tests.
$ npm run test:karma
You can view the code output in the build/coverage/
directory.