Repository navigation
chore: add c8-based coverage reporting script - #397
hivecommons-hive[bot] wants to merge 1 commit into
Conversation
Adds a test:coverage npm script (c8 wrapping test:unit) plus the c8 devDependency and a coverage/ gitignore entry, so coverage can be checked with one command instead of ad hoc npx c8 runs. Scoped to package.json/.gitignore only; does not touch .github/workflows/**. Signed-off-by: quality <280983584+hivecommons-hive[bot]@users.noreply.github.com>
|
Important Held for human review by the hive's ACMM level gate. This PR was opened by the "quality" agent while Hive policy required a human checkpoint for that agent. Agent PRs are held at ACMM L3–L5; an Hive will keep the |
✅ Deploy Preview for cncf-techdocs ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
63bec21
ℹ️ Sentinel notice — informational; author is trusted (hive agent), merge is not blockedHive flagged this PR (author @hivecommons-hive[bot], head
Hive did not add the |
There was a problem hiding this comment.
Read the diff against main. This looks correct to me.
Verified:
package.json:39— the newtest:coveragescript wraps the existingtest:unitscript (package.json:40at base), which is present onmain; c8 propagatesNODE_V8_COVERAGEinto thenpm runchild, so the node:test subprocess is instrumented.package-lock.json— the additions are the standard c8/istanbul dependency tree (@bcoe/v8-coverage,@istanbuljs/schema, istanbul libs, yargs), all"dev": true; no runtime dependency change..gitignore:15—coverage/matches c8's default output directory.- Scope matches issue #396 exactly: no workflow changes, no thresholds, consistent with the PR body's stated deferral until #389/#392/#394 land.
One info-level note, not a defect: c8@12 declares engines: ^20.19.0 || ^22.12.0 || >=23, and this repo's package.json has no engines field — contributors on Node 20.x older than 20.19 will get an install warning/failure for this devDependency. Fine as-is; worth remembering if anyone hits it.
— hive: agent=reviewer backend=copilot model=claude-fable-5 copilot=1.0.88
Test Improvement
Adds a
test:coveragenpm script (c8 --reporter=text --reporter=lcov npm run test:unit), thec8devDependency, and acoverage/.gitignoreentry.Today the only coverage numbers this repo has ever produced (e.g. the 89.74% branch coverage on
lib/remarkRewriteLinks/index.tscited in #393/PR #394) came from someone runningnpx c8by hand and throwing the output away. This gives a repo-tracked, one-command way to reproduce that:npm run test:coverage.Deliberately does not add
--check-coveragethresholds or wire this into CI yet — the repo's branch coverage is currently below 100% until the in-flight coverage PRs (#389, #392, #394) land, and enforcing a threshold now would ship this red. Also deliberately does not touch.github/workflows/**(that's the ceiling documented on #390); this is package.json/devDependency/.gitignore only, with no test file of its own since it is tooling configuration rather than a behavior change.Verified locally:
npm run test:coverageruns and reports text + lcov coverage for the existing 16 unit tests;npx prettier --check package.jsonis clean.Related Issue
Fixes #396 (adds the coverage-reporting script and devDependency the issue asks for; nothing is left for #396 to track once this merges)
Filed by quality agent (hold-gated mode). Human review required.
— hive: agent=quality backend=copilot model=claude-opus-4-6 copilot=1.0.88