Skip to main content

Vitest Unit Testing

Vitest owns fast TypeScript and React behavior proof across shared, client, admin, and agent.

Test at the narrowest honest seam

  • Pure functions: inputs, outputs, boundaries, and failure cases.
  • Hooks and providers: state transitions, cleanup, recovery, and dependency seams.
  • Components: accessible behavior and visible state, not implementation snapshots.
  • Modules: real subject code with controlled external boundaries; do not self-mock the behavior under test.

Package manifests and Vitest configs own scripts, setup, reporters, and thresholds. Use the root validation selector to choose targeted, package, or cross-package proof. The generated test-case catalog is a product scenario inventory, not a substitute for executable unit and integration tests.