Install dependencies
npm i
Run for dev mode
npm run dev
Build for prod
npm run build
We are using Vitest and Testing Library for our unit tests.
Please aim for about 80% or greater test coverage. Perfection on metrics can often be the wrong target, so we aim for "good enough"
Automated tests are incorporated into GitHub Actions so we can easily see if our application is safe to deploy.
You can run the unit tests like so:
Command lines
npm run test
npm run test:ui
When writing new tests, please follow the Testing Library Guiding Principles
We use Playwright for end-to-end testing.
You can run it in terminal mode with:
npm run test:e2e
or in UI mode with:
npm run test:e2e:ui
Playwright runs against the main branch automatically via GitHub Actions. Since we only have a production environment, it does not run on branches. If you notice a failed run, here's how to troubleshoot it:
Go to the "Actions" tab and select the failing run
Examine the logs, and download the artifact
Unzip the artifact to find one or more folders with the name of the test. Each folder should contain a file called trace.zip
.
Open up the Trace Viewer, which is a Progressive Web App (basically a special site that runs locally on your machine, not on a server).
Drag the trace.zip
file into the Trace Viewer and you can see the screenshots from the test run