From bfc13679583c938f1fed45a94ad48f6df820f974 Mon Sep 17 00:00:00 2001 From: jdalton Date: Thu, 26 Mar 2026 09:04:59 -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 09ee003e..7317d02d 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -214,6 +214,16 @@ Test helpers available in `test/utils/`: - **Coverage**: `pnpm run cover` - **NPM packages**: `node scripts/test-npm-packages.mjs` (long-running) +### 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 + ### Vitest Memory Optimization - **Pool**: `pool: 'forks'`, `singleFork: true`, `maxForks: 1`, `isolate: true`