From ce37a5a86933142196951505067a76400f9e0ab7 Mon Sep 17 00:00:00 2001 From: jdalton Date: Thu, 26 Mar 2026 09:04:43 -0400 Subject: [PATCH] chore: add no-source-scanning test rule to CLAUDE.md --- CLAUDE.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/CLAUDE.md b/CLAUDE.md index 41be5d3..3807399 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -378,6 +378,16 @@ Or use `scripts/generate-package-exports.mjs` to auto-generate exports. - Mock external dependencies appropriately - Use path helpers for cross-platform tests +### Test Style — Functional Over Source Scanning + +**NEVER write source-code-scanning tests** + +Do not read source files and assert on their contents (`.toContain('pattern')`). These tests are brittle and break on any refactor. + +- Write functional tests that verify **behavior**, not string patterns +- For modules requiring a built binary: use integration tests +- For pure logic: use unit tests with real function calls + #### Running Tests - **All tests**: `pnpm test`