Skip to content

Tools

Tools

Vitest · Playwright · axe

Automated testing

Unit, component, e2e, and accessibility automation for the design system. Run locally in CI — and try axe live on the lab below.

One-command suite

npm run test runs unit tests, then e2e route smoke against the running preview (or BASE_URL). Use npm run test:a11y for axe scans.

Vitest

Unit & component tests
cn(), hooks, Button, registry contracts

npm run test:unit

Testing Library

DOM assertions
roles, labels, disabled state

used by Vitest

axe-core

Accessibility engine
WCAG rule violations in the browser

npm run test:a11y

Playwright

E2E smoke + axe runner
Critical routes load with content, no page errors

npm run test:e2e

Typecheck

Static types
Route and component type safety

npm run typecheck

Commands

package.json scripts

Scripts live in package.json. Scanners: scripts/e2e-routes.mjs, scripts/a11y-scan.mjs.

Critical routes

E2E smoke hits these paths. Expand the list in src/lib/testing.ts.

/
/installation
/accessibility
/components
/components/button
/patterns/forms
/experience
/devices
/testing
/integrations

Example unit test

Button accessibility contract

See src/components/ui/button.test.tsx and src/lib/utils.test.ts.

Live axe lab

Runs axe-core in the browser against the sample panel. Intentional issues can be toggled for demos — fix them and re-scan.

Sample UI under test

Good pattern: labeled inputs, named icon button, semantic buttons.

CI recipe

  1. npm run typecheck
  2. npm run test:unit
  3. Start the app (dev or preview)
  4. npm run test:e2e and npm run test:a11y