We use Cypress for testing.
The testing files are placed in cypress/
folder and cypress config
We have integration tests in cypress/e2e/
. For these tests, we stub api calls. The api therefore doesn't have to be set up before running these tests
To run tests interactively,
BROWSER=none yarn start
- run the app on default port 3000 without any specific api settings If other app is running on port 3000, you'll have to stop it firstyarn cypress open
- Select e2e tests from the available options
- Select your preferred browser
- Select a test file to run from list
To run tests automatically, run yarn e2e
. Be careful, this command will kill all your node processes at the end (this should be fixed, but currently we don't know any better...)
We also have CI1 set up with github workflows. It runs tests on github after every push and merge to main
branch there.
We haven't figured out how to run tests against live api without stubbing, yet.
Footnotes
-
continuous integration ↩