Loading...
---
description: Testing
---
Write good tests.---
description: Rules for unit tests
globs: "**/*.test.ts"
---
- Use `vi.fn()` for mocks; do not mock modules globally.
- One `describe` per exported function.
- No real network calls: use the fixtures in `test/fixtures/`.A file pattern limits the rule to test files, and concrete rules can be checked by reading the code.
AGENTS.md applies to the whole project and loads at the start. Rules apply only to matching folders or files, so detailed guidance loads only when needed.
When a section applies only to part of the code, such as tests, a UI package or database migrations, and would clutter the main file.
No. File locations and frontmatter fields differ between tools, so check the tool's docs for the exact format.