Running the API tests in watch mode - Arkisto-Platform/describo-online GitHub Wiki

If you want to run the tests in watch mode you need to:

  • start the development environment
  • in another terminal
    • find the id of the docker API container: docker ps
    • exec into the container: docker exec -it {container id} bash
    • run jest: npm run test:watch

Jest tests run in parallel so it comes with the ability to filter which tests run. However, in order to do this the command can't be started automatically by docker as you won't be able to attach to jest. By starting it manually - and it has to be inside the container - you can control which tests run which is very handy when you're developing new tests or checking existing ones.