Skip to content

Testing

The template uses three complementary testing layers.

Unit and interaction tests (Vitest + Storybook)

Section titled “Unit and interaction tests (Vitest + Storybook)”

Interaction tests run inside Storybook via @storybook/addon-vitest. They test component behaviour using Testing Library:

Terminal window
pnpm test:storybook

Unit tests run with Vitest directly:

Terminal window
pnpm test

End-to-end tests run against the smoke-test app using Cypress:

Terminal window
pnpm test:cypress

The app is served from app/main.tsx and exercises the full component integration.

Chromatic captures and compares component screenshots on every PR. It is triggered automatically in CI via the test workflow.

Coverage is collected from Storybook interaction tests using @storybook/addon-coverage. The threshold is enforced in CI via Codecov.