← knowledge.oriz.in

Testing — three-layer stack (Vitest unit + Playwright E2E + Storybook+Chromatic visual)

decision decisionsarchitecturetestingvitestplaywrightstorybookchromatic

Testing — three-layer stack (Vitest unit + Playwright E2E + Storybook+Chromatic visual)

Decision

Every site's and every package's per-PR CI runs three layers of tests in parallel after the Cloudflare Pages preview deploy lands:

  1. Unit / integrationVitest. Fast, in-memory, Vite-native; runs every *.test.ts file.
  2. End-to-endPlaywright. Real browser (Chromium + WebKit + Firefox) against the preview URL. Already the substrate the a11y axe-core suite rides on.
  3. Visual regressionStorybook + Chromatic. Storybook declares canonical states; Chromatic diffs them against the baseline branch.

PR fails on any failure in any layer. All three layers are free, no card. The visual-regression layer requires explicit human acceptance of any declared diff.

Why

Implications

Architecture

Coupling to existing stacks

Per-PR gating

What we don't do

Cross-refs