Unit tests use Vitest with Testing Library and jsdom.
- Run (watch):
npm test - Run once:
npm run test:run - Coverage:
npm run test:coverage→ report incoverage/ - UI:
npm run test:ui
- Config:
vitest.config.ts(jsdom, coverage thresholds 80%) - Setup:
tests/setup.ts(jest-dom matchers, localStorage mock,crypto.randomUUIDmock) - Helpers:
tests/helpers/store-factory.ts,tests/helpers/render-with-providers.tsx - Tests:
tests/unit/—schemas/,utils/,components/
- Use
renderWithProviders()fromtests/helpers/render-with-providers.tsxfor components that need TinyBaseProvider. - Use
createTestStore()fromtests/helpers/store-factory.tswhen you need a store with sample data. - Schemas and utils are tested in isolation; component tests use the helpers above.