From 9e397d09186461fea0a27b47879adb3d74c9e6f0 Mon Sep 17 00:00:00 2001 From: jdalton Date: Thu, 26 Mar 2026 09:05:11 -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 5ede89e..024a024 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -300,6 +300,16 @@ See file for usage examples. - **Test edge cases**: Include edge cases in `purl-edge-cases.test.mts` - **Performance**: Benchmark performance-sensitive changes +### 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