Run tools/test
to run all our test suites. This command is
typically quite fast (5-10s, sometimes less), because it only rechecks
tests related to the files you've changed.
You can run all our tests with tools/test --full
.
tools/test jest
runs the unit test suite.
Our tests are written using Jest.
To write a test, place a Javascript file with the -test.js
suffix in the
__tests__
directory inside of any subfolder of /src
. The test will be
automatically picked up by the test runner.
Use deepFreeze to test functions which access redux state. This won't allow the object to be mutated and hence will eventually fail tests in case of mutation.
Functional tests have not been set up. We plan to use Appium.
tools/test lint
checks your changes against our linting rules. We're using
the AirBnB ES6 and
React style guides.
Use Flow and flow-typed to find and prevent type related issues.