714 B
714 B
description, globs, trigger
| description | globs | trigger |
|---|---|---|
| Testing conventions and runner guidelines using bun:test | src/**/*.test.ts | manual |
Testing Guidelines
When writing or maintaining unit and integration tests:
-
Test Runner & Colocation:
- Use
bun:test(describe,test,expect). - Colocate tests directly alongside implementation code as
name.test.ts(e.g.src/core/config/loader.test.ts).
- Use
-
State & Environment Hygiene:
- Any test modifying
process.envorprocess.chdir()MUST restore them inafterEach(). - Never leave temporary files or mutation leaks between test cases.
- Any test modifying
-
Execution:
- Run tests using
bun test. - Ensure type check passes with
bun run check.
- Run tests using