---
paths:
  - "**/*.test.*"
  - "**/*.spec.*"
  - "**/test_*.py"
  - "**/*_test.go"
  - "tests/**"
  - "e2e/**"
---

# Working on tests

- Match the existing framework and helpers in this directory; read a neighboring test file before writing a new one.
- One behavior per test, named as a sentence. Arrange / act / assert.
- Use factories/fixtures for data; set only fields that matter to the assertion.
- Deterministic only: fake time, seed randomness, stub network at the boundary, no sleeps (wait on conditions instead).
- Assert observable behavior (outputs, responses, rendered text, persisted state), not private internals.
- Each new test must fail without the change it covers. When fixing a bug, show the failing run first.
- Run the single file you touched, then the related suite.

## Never
- Delete, skip, or `xfail` a test to get green.
- Change an expected value to match current output without explaining why the old expectation was wrong.
- Leave focused tests (`.only`, `fit`) or debug prints.

If a test seems wrong, stop and explain instead of editing it.
