Skip to content

Latest commit

 

History

History
20 lines (14 loc) · 1.14 KB

File metadata and controls

20 lines (14 loc) · 1.14 KB

Testing rules

  • Every behavior change should have a test or a documented reason why not (e.g. generated code, third-party UI with separate E2E).
  • Prefer fast unit tests for logic; integration tests for boundaries (DB, HTTP, filesystem) with clear fixtures.
  • Tests should be deterministic: fixed clocks, seeded randomness, isolated temp dirs.
  • Name tests after behavior (e.g. “returns 404 when missing”), not after implementation details.
  • Failures should print actionable diagnostics (inputs, diff, key IDs), not only “expected false got true.”

When editing tests

Applies to common test paths (e.g. **/*.test.ts, **/*.spec.ts, **/__tests__/**, **/*_test.py, **/*_test.go, or your repo’s convention).

  • Prefer deterministic tests; avoid wall-clock sleeps for synchronization.
  • Name tests for behavior, not internal implementation names.

Related skills