Repository navigation
Testing Strategy
github-actions[bot] edited this page Sep 28, 2026
·
1 revision
| Tool | Role |
|---|---|
| Vitest | Runner (vitest.config.ts) |
| jsdom | DOM environment |
| Testing Library |
renderHook, render, screen, act
|
| v8 coverage |
npm run test:coverage → Codecov in CI |
Tests live next to hooks: src/hooks/*.test.ts / .tsx. Playground code is not unit-tested; it is validated by playground:build in CI and on pre-push.
- Happy path return values and option defaults
- SSR / no-
windowdefaults where relevant - Effect cleanup (listeners, intervals, observers)
- Async dialogs: render
render()from the hook and assert UI + promise resolution - Edge cases: empty lists, paused timers (
nulldelay), invalid keys
Prefer behavior over implementation details. Do not assert internal refs or private module state.
-
pre-commit / CI:
verify:commitrunstest:coverage(and lint, typecheck, build) -
Codecov: uploads
coverage/lcov.infofrom CI - There is no Playwright / E2E suite — browser APIs are exercised under jsdom where practical
npm test
npm run test:coverage
npm run test:watch