Skip to content

ADR 0002 Vitest for units, Storybook test runner for integration

Dmitrii Suroviagin edited this page Apr 30, 2026 · 1 revision

Status

Accepted

Context

We need fast feedback for hooks and components, high coverage, and a second layer that exercises composed UI in a real browser. End-to-end product flows are out of scope for this package.

Decision

  • Vitest + React Testing Library for unit and hook tests (jsdom, colocated __tests__).
  • @storybook/test-runner (Playwright) for integration-style checks: static Storybook build, then automated traversal of stories.
  • Stryker (scheduled in CI) for mutation testing to stress-test the unit suite.

Consequences

  • Two commands: npm run test:ci (fast) and npm run test:integration (full Storybook + runner).
  • Stories that intentionally throw (e.g. error-boundary demos) must stay compatible with the runner (no strict --failOnConsole globally).

Clone this wiki locally