diff --git a/package.json b/package.json index a934ddc..e357c31 100644 --- a/package.json +++ b/package.json @@ -23,7 +23,7 @@ "scripts": { "build": "tsc", "test": "npm run build && node scripts/run-tests.mjs", - "test:coverage": "npm run build && node --test --experimental-test-coverage --test-coverage-lines=98 --test-coverage-branches=93 --test-coverage-functions=97 test/*.test.js", + "test:coverage": "npm run build && node scripts/run-tests.mjs", "prepublishOnly": "npm run build" }, "keywords": [ diff --git a/test/run-tests-runner.test.js b/test/run-tests-runner.test.js index 6f7cac7..9a24014 100644 --- a/test/run-tests-runner.test.js +++ b/test/run-tests-runner.test.js @@ -42,6 +42,12 @@ test('CONTRIBUTING.md documents the thresholds COVERAGE_FLAGS actually enforce', assert.match(doc, new RegExp(`lines ${pct('lines')}, branches ${pct('branches')}, functions ${pct('functions')}`)); }); +test('test:coverage delegates to the shared runner without inline coverage flags', () => { + const { scripts } = JSON.parse(readFileSync(join(process.cwd(), 'package.json'), 'utf-8')); + assert.equal(scripts['test:coverage'], 'npm run build && node scripts/run-tests.mjs'); + assert.doesNotMatch(scripts['test:coverage'], /--(?:experimental-test-coverage|test-coverage-)/); +}); + test('listTestFiles returns only sorted *.test.js entries', () => { const dir = mkdtempSync(join(tmpdir(), 'pluk-run-tests-')); try {