Docs
Testing
Browser and unit test coverage for the site.
Confidence loop
Tests aim to validate core behaviors without binding to fragile layout details. The goal is
fast feedback, stable assertions, and minimal flake.
Jest
Playwright
Fixtures
Deterministic
What we cover
- Unit and component tests live under
tests/. - End-to-end coverage uses Playwright under
tests/e2e/.
Running tests
npm run testfor Jest.npm run test:e2efor Playwright (spins upnpm run devunlessPLAYWRIGHT_BASE_URLis set).- First time only:
npx playwright installto fetch browsers.
-
01. Boot the app
-
02. Run suites
-
03. Review artifacts
Determinism tips
- Prefer role-based selectors and avoid brittle text matching.
- Mock telemetry APIs when data might change.
- Keep animation timing stable and avoid fixed waits.
| Command | Purpose | Notes |
|---|---|---|
| npm run test | Unit and component tests | Fast feedback for shared helpers. |
| npm run test:e2e | Browser flows | Uses fixtures for telemetry APIs. |
Local fixtures
MOCK_GITHUB_DATA_PATHpoints to JSON fixtures that bypass GitHub API calls in tests.- The Playwright config defaults this to
tests/e2e/fixtures/github-repos.json. - If you use
PLAYWRIGHT_BASE_URL, make sure the server you point to has eitherMOCK_GITHUB_DATA_PATHset or valid GitHub credentials.
Notes
- E2E tests mock telemetry API routes in the browser to keep runs deterministic.