Project rules
Jest Vitest Rules
Project rules for Jest and Vitest unit tests: clear names, arrange-act-assert, narrow mocks, deterministic time and meaningful coverage.
CLAUDE.md
1Structure and naming
2- Colocate `*.test.ts` next to the source. `describe` the unit; write `it('returns 404 when the user is missing')` as a behavior, not a method name.
3- Arrange, act, assert, separated by blank lines. One behavior per test; use `it.each` for tables of inputs.
4Isolation
5- Tests must not depend on order or share mutable state. Build data with small factory functions; reset in `beforeEach`, not `afterAll`.
javascripttypescript
#
Jest Vitest Rules
Project rulesjavascript
Free