From b0196df57ce02ea28b132db39d012c22dd601b48 Mon Sep 17 00:00:00 2001 From: jdalton Date: Thu, 26 Mar 2026 09:05:38 -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 88a523d7..bc937fbe 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -245,6 +245,16 @@ if (isCoverageMode) { - **Cross-platform**: Test path handling on Windows and Unix - **Follow patterns**: See `test/unit/getapi-sendapi-methods.test.mts` for examples +### 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 + ### CI Testing - **🚨 MANDATORY**: `SocketDev/socket-registry/.github/workflows/ci.yml@` with full SHA