From 7fa5eb7e63e8ba6bbfe69ef387200a7bc24b8a1e Mon Sep 17 00:00:00 2001 From: Tom Boucher Date: Sat, 16 May 2026 10:44:51 -0400 Subject: [PATCH] =?UTF-8?q?fix(3597):=20resolve=20CR=20threads=20=E2=80=94?= =?UTF-8?q?=20drop=20substring-assertion=20guidance,=20use=20$testDir?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Two CodeRabbit threads from PR #3649 review: - docs/TESTING-SUITES.md:75 — removed the "stable message substring" fallback from the error-assertion guidance. Project rule (per the no-source-grep lint and lint-no-source-grep.cjs) is structured/typed checks only — err.code, JSON fields, enums. Substring matching re-introduces the exact prose-coupling we banned. - scripts/run-tests.cjs:106 — the "no test files found" error now reports the resolved testDir variable instead of the hardcoded 'tests/' string, so when GSD_TEST_DIR points elsewhere the message names the actual directory the harness searched. Local: docker gsd-test-summary 11224/0 on holodeck. Co-Authored-By: Claude Opus 4.7 (1M context) --- docs/TESTING-SUITES.md | 2 +- scripts/run-tests.cjs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/TESTING-SUITES.md b/docs/TESTING-SUITES.md index 5edcabce8..bf16eb078 100644 --- a/docs/TESTING-SUITES.md +++ b/docs/TESTING-SUITES.md @@ -72,6 +72,6 @@ Each matrix cell runs `unit`, `integration`, and `security` on every PR. `instal ## Best practices for forward-compat (Node 24/26) - Use `process.execPath` when spawning Node in tests so each matrix lane exercises the lane's Node version. -- Avoid exact stack-trace or error-message prose assertions. Assert `err.code`, structured JSON, or a stable message substring instead — Node minor releases routinely tweak error wording. +- Avoid stack-trace or error-message prose assertions. Assert `err.code`, structured JSON fields, or enums — Node minor releases routinely tweak error wording. - Prefer `node:test`, `node:assert/strict`, and `node:test` mocks. No external test frameworks. - Coverage uses `c8` and propagates `NODE_V8_COVERAGE` through the harness's child process. diff --git a/scripts/run-tests.cjs b/scripts/run-tests.cjs index e38f47f50..1e065d986 100644 --- a/scripts/run-tests.cjs +++ b/scripts/run-tests.cjs @@ -103,7 +103,7 @@ function main() { .sort(); if (allFiles.length === 0) { - console.error('No test files found in tests/'); + console.error(`No test files found in ${testDir}`); process.exit(1); }