Skip to content

Running tests

ootee edited this page Jun 21, 2018 · 7 revisions

- Running tests locally

(After completing the steps described in "FOR NEW DEVELOPERS":)

Take care that docker is running. Take care that backend is not running.

  • Backend:

in the backend repository, run

npm run create_test_db and then

npm test

  • Frontend:

in the labtool2.0 repository, run

npm test

if you have intentionally modified a component and the snapshot test fails, you can update the snapshot by running

npm test -- -u

Remember to quit the test watch mode immediately after updating the snapshots! Otherwise the tests will be run and snapshots updated each time you make a change to any file.

Remember to commit the snapshot changes!

If the snapshot tests pass locally but fail on Travis, make sure your package.json is up to date. Run npm install if necessary.