Tests use the mocha test framework.
Most tests use webdriver.io framework (via Spectron to bring up the browser and run through the tests.
Tests are located in the top level test
directory and their filenames have a suffix of Test.js
.
To stay close to production, tests do not use the webpack dev server. To keep the webpack bundle up to date as you make changes you should run:
npm run watch-test
You can run ALL of the tests using:
npm run test
If you'd prefer to only run the unit tests, you can do that using:
npm run unittest
If you only need to run the Spectron tests (used for UI testing), you can run:
npm run uitest
You can run a subset of tests which match a description
or it
with:
npm run test -- --grep="expression"
Where expression
could be for example ^tabs
to match all tests which start with the word tabs. This works for all testing modes (test, unittest, uitest).