Integration tests using Jest and end-to-end tests using Cypress.
npm test sets up a complete environment in docker and runs integration and end-to-end tests in that. This can be a bit slow, but you don't need to have anything running for it to work.
npm run test-integration runs only the integration tests using Jest, for this to work you need to have all services running locally, see below.
npm run test-e2e runs only the end-to-end tests using Cypress, for this to work you need to have all services running locally, see below.
Useful while developing or debugging because you can easily see console output from the services and reach them with tools such as debuggers.
- Start required services: in
/rundocker-compose up - Start the operator: in
/operatorrunnpm run dev - Start the phone-app as an e2e-service*: in
/apprunOPERATOR_URL=http://localhost:3000/api npm run e2e:watch - This is enough to run the integration tests in
/e2ewith eithernpm run test-integration:localORnpm run test-integration:local:watchif you want to watch for changes in an interactive Jest session. - To run end-to-end-tests you also need the CV site: in
/examples/cvrunnpm run dev - And in
/e2erunnpm run test-e2eORnpm run test-e2e:opento open an interactive Cypress window.
* This starts the non-UI-part of the phone app as a webserver that the tests can call to perform the actions that the user would in the phone application.