diff --git a/eslint.config.mjs b/eslint.config.mjs index 7413cdb6f..5fe327de2 100644 --- a/eslint.config.mjs +++ b/eslint.config.mjs @@ -236,6 +236,8 @@ export default tseslint.config( 'local/no-raw-rmsync-in-tests': 'error', // Ban tautological assertions (always-truthy arg or identical-literal equality) 'local/no-tautological-assert': 'error', + // Ban source-grep pattern in tests — use require() + behavior assertions instead + 'local/no-source-grep': 'error', // Ban raw setTimeout sync + elapsed/duration-style assertions via no-restricted-syntax 'no-restricted-syntax': [ 'error', diff --git a/package.json b/package.json index f93b63188..dd6e18195 100644 --- a/package.json +++ b/package.json @@ -114,9 +114,9 @@ "test:security": "node scripts/run-tests.cjs --suite security", "test:slow": "node scripts/run-tests.cjs --suite slow", "test:affected": "node scripts/run-affected-tests.cjs", - "test:coverage": "c8 --check-coverage --lines 70 --reporter text --include 'gsd-core/bin/lib/*.cjs' --exclude 'tests/**' --all node scripts/run-tests.cjs", + "test:coverage": "c8 --check-coverage --lines 70 --branches 60 --reporter text --include 'gsd-core/bin/lib/*.cjs' --exclude 'tests/**' --all node scripts/run-tests.cjs", "test:coverage:scripts-floor": "c8 check-coverage --lines 55 --include 'scripts/**/*.cjs' --exclude 'tests/**' --all", - "test:coverage:unit": "c8 --check-coverage --lines 70 --reporter text --include 'gsd-core/bin/lib/*.cjs' --exclude 'tests/**' --all node scripts/run-tests.cjs --suite unit", + "test:coverage:unit": "c8 --check-coverage --lines 70 --branches 60 --reporter text --include 'gsd-core/bin/lib/*.cjs' --exclude 'tests/**' --all node scripts/run-tests.cjs --suite unit && c8 check-coverage --per-file --lines 0 --functions 0 --statements 0 --branches 70 --include 'gsd-core/bin/lib/state.cjs' --include 'gsd-core/bin/lib/phase.cjs' --include 'gsd-core/bin/lib/verify.cjs' --include 'gsd-core/bin/lib/init.cjs' --exclude 'tests/**'", "test:coverage:all": "npm run test:coverage", "test:mutation": "stryker run", "test:mutation:since": "stryker run --incremental --since origin/next" diff --git a/tests/repo-layout.test.cjs b/tests/repo-layout.test.cjs index 55d3f6809..b86b200f8 100644 --- a/tests/repo-layout.test.cjs +++ b/tests/repo-layout.test.cjs @@ -1,4 +1,5 @@ 'use strict'; +// allow-test-rule: structural guard-placement verification in bin/install.js requires source-text analysis; install.js is a non-exportable CLI script and the guard must be in a specific lexical scope which require()+behavior cannot verify #1188 /** * Governance tests for the gsd-core repository root layout.