Testing Goal
Keep tests in three buckets only:
- Pure unit tests for deterministic logic.
- Thin component or hook contract tests for real app behavior.
- Golden input or output tests when serialized output is the contract.
Hard constraints:
- Prefer Bun for the fast local loop.
- Keep the default suite fast.
- No browser or e2e coverage unless the app behavior truly needs it.
- Coverage is a hotspot tool, not a vanity score.
Core Rules
- Assert public behavior, not implementation detail.
- Keep tests next to the code they cover with
*.spec.ts[x].
- Keep helpers local. Do not import one spec from another.
- Prefer explicit assertions over snapshots.
- Delete skipped, commented, or placeholder tests instead of babysitting them.
Seam Selection
- Use plain function tests for pure logic.