From 309aab59f78d872c81bdab7ef11571f918864f5d Mon Sep 17 00:00:00 2001 From: quality <280983584+hivecommons-hive[bot]@users.noreply.github.com> Date: Thu, 12 Nov 2026 18:57:14 -0500 Subject: [PATCH] test: add c8 --check-coverage regression gate to test:coverage package.json's test:coverage script (added in #397) reported coverage but never failed the build on regression: c8's defaults are 0% for branches/functions/statements and 90% for lines. #396 deliberately deferred adding thresholds until in-flight coverage PRs merged, to avoid landing the gate red. lib/ is now 100% across all four metrics (after #389/#392/#394/#401). Only scripts/add-frontmatter.mjs remains below 100% branch coverage, tracked by the still-open #402. Set thresholds at the currently achieved levels (99/99/97/100) so the gate passes today and catches any future regression; it can be tightened to --100 once #402 merges. Signed-off-by: quality <280983584+hivecommons-hive[bot]@users.noreply.github.com> --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 752c0922..0a461ad0 100644 --- a/package.json +++ b/package.json @@ -36,7 +36,7 @@ "precheck:links": "npm run build", "seq": "bash -c 'for cmd in \"$@\"; do npm run $cmd || exit 1; done' - ", "serve": "npm run docus:serve", - "test:coverage": "c8 --reporter=text --reporter=lcov npm run test:unit", + "test:coverage": "c8 --reporter=text --reporter=lcov --check-coverage --lines 99 --statements 99 --branches 97 --functions 100 npm run test:unit", "test:unit": "node --experimental-strip-types --test 'lib/**/*.test.mts' 'scripts/**/*.test.mjs'", "test": "npm run check && npm run test:unit", "typecheck": "tsc",