ADR-015 — Vitest for unit/integration tests, Playwright for e2e
Status · Accepted Date · 2026-04-28 TA anchor · §stack
Context
The orbital math library, data client, and router need unit test coverage. Critical user journeys need end-to-end coverage. A testing framework must be chosen.
Decision
Vitest for unit and integration tests. Playwright for end-to-end tests. Both run in GitHub Actions CI.
Rationale
Vitest is Vite-native — same config, same transform pipeline, fast. SvelteKit's testing documentation recommends it. Playwright is the current standard for e2e testing: cross-browser, reliable, good SvelteKit integration. Together they cover the full testing pyramid without introducing a complex Jest configuration.
Alternatives considered
- Jest — more familiar; slower with Vite projects; requires babel transform; rejected.
- Cypress — valid for e2e; heavier than Playwright; slower CI; rejected.
- Testing Library — component testing; useful addition later; not needed for Slice 1.
Consequences
Positive: fast unit tests; reliable e2e; both CI-ready out of the box. Negative: Playwright requires browser binaries in CI (~300MB download); cached after first run.
Implementation notes
vitest in vite.config.ts. Playwright config at playwright.config.ts. Unit tests colocated with source: src/lib/orbital.test.ts. E2e tests in tests/. CI caches Playwright browsers between runs.