Skip to content

Commit d2bbd4f

Browse files
authored
chore: add no-source-scanning test rule to CLAUDE.md (#109)
1 parent ee58d73 commit d2bbd4f

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

CLAUDE.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -378,6 +378,16 @@ Or use `scripts/generate-package-exports.mjs` to auto-generate exports.
378378
- Mock external dependencies appropriately
379379
- Use path helpers for cross-platform tests
380380

381+
### Test Style — Functional Over Source Scanning
382+
383+
**NEVER write source-code-scanning tests**
384+
385+
Do not read source files and assert on their contents (`.toContain('pattern')`). These tests are brittle and break on any refactor.
386+
387+
- Write functional tests that verify **behavior**, not string patterns
388+
- For modules requiring a built binary: use integration tests
389+
- For pure logic: use unit tests with real function calls
390+
381391
#### Running Tests
382392

383393
- **All tests**: `pnpm test`

0 commit comments

Comments
 (0)