You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
tests/tools/coverage-report.mjs is the reporter CI runs for npm run test:unit:coverage and test:unit:coverage:check. Its main() has three paths that no test executes:
lines
path
76-78
parseArgs: a bare node --test argument given without a -- separator, which must be passed through rather than read as a flag
570-578
the Not reported (N) notice: the only signal that a file's coverage was recorded against loader-generated text (a JSON module wrapper or transpiled JSX) and is therefore absent from the table
580-583
the non-zero exit taken when the spawned suite itself fails, which must still print the table and must propagate the suite's status ahead of the --check gates
tests/coverage-report.test.mjs already drives the reporter as a subprocess, but its runReporter helper deletes NODE_V8_COVERAGE from the child environment, so nothing the reporter process does is recorded. The --check gates it exercises are pinned by exit code alone; the three paths above carry no exit code of their own to assert on, so they are invisible to the report the tool publishes about itself.
Consequence: a regression in any of the three is silent. A dropped Not reported notice would hide unmapped files entirely; a broken suite-failure exit would let a red suite report green coverage and exit 0.
Evidence
Unit: npm run test:unit:coverage at b54cf81 reports tests/tools/coverage-report.mjs | 96.21 | 93.10 | 77-78 409-410 437-438 447-448 470-473 571-578 581-583. Sub-line region offsets were extracted from the same NODE_V8_COVERAGE dump via the tool's own collect() and summarizeRegions().
End-to-end: tests/e2e/smoke.spec.js is a Playwright smoke test of the rendered site; it does not execute the repository's own tooling, so it cannot cover this file. No end-to-end evidence exists for it either way.
Lines 409-410 (tryRemapJsx's transpile-failure catch) and the remaining decodeMappings/remapJsxLineCoverage sub-line regions are a separate JSX-remap cluster and are out of scope here.
Recommendation
Add tests/coverage-report-cli.test.mjs with a runReporter helper that keeps NODE_V8_COVERAGE in the child environment (deleting only NODE_TEST_CONTEXT), so the reporter's own execution is recorded. The reporter always overrides NODE_V8_COVERAGE for the node --test run it spawns, so the grandchild still writes to its own directory and the merged counts come only from the reporter. Cover:
a bare test path passed without -- reaches node --test and narrows the run to that one suite
a suite that imports a JSON module produces the Not reported notice, whose count matches the files it lists
a run whose spawned suite fails exits 1, prints Tests failed; coverage above is reported for context., still renders the table, and does not report a --check failure
This lifts the file from 96.21%/93.10% to 98.35%/94.40% (line/region) and all-files line coverage from 99.09% to 99.14%.
Finding
tests/tools/coverage-report.mjsis the reporter CI runs fornpm run test:unit:coverageandtest:unit:coverage:check. Itsmain()has three paths that no test executes:parseArgs: a barenode --testargument given without a--separator, which must be passed through rather than read as a flagNot reported (N)notice: the only signal that a file's coverage was recorded against loader-generated text (a JSON module wrapper or transpiled JSX) and is therefore absent from the table--checkgatestests/coverage-report.test.mjsalready drives the reporter as a subprocess, but itsrunReporterhelper deletesNODE_V8_COVERAGEfrom the child environment, so nothing the reporter process does is recorded. The--checkgates it exercises are pinned by exit code alone; the three paths above carry no exit code of their own to assert on, so they are invisible to the report the tool publishes about itself.Consequence: a regression in any of the three is silent. A dropped
Not reportednotice would hide unmapped files entirely; a broken suite-failure exit would let a red suite report green coverage and exit 0.Evidence
npm run test:unit:coverageatb54cf81reportstests/tools/coverage-report.mjs | 96.21 | 93.10 | 77-78 409-410 437-438 447-448 470-473 571-578 581-583. Sub-line region offsets were extracted from the sameNODE_V8_COVERAGEdump via the tool's owncollect()andsummarizeRegions().tests/e2e/smoke.spec.jsis a Playwright smoke test of the rendered site; it does not execute the repository's own tooling, so it cannot cover this file. No end-to-end evidence exists for it either way.collect()and are already claimed by open PR test(coverage-report): cover collect()'s merge and record-skip paths #702; they are out of scope here.tryRemapJsx's transpile-failure catch) and the remainingdecodeMappings/remapJsxLineCoveragesub-line regions are a separate JSX-remap cluster and are out of scope here.Recommendation
Add
tests/coverage-report-cli.test.mjswith arunReporterhelper that keepsNODE_V8_COVERAGEin the child environment (deleting onlyNODE_TEST_CONTEXT), so the reporter's own execution is recorded. The reporter always overridesNODE_V8_COVERAGEfor thenode --testrun it spawns, so the grandchild still writes to its own directory and the merged counts come only from the reporter. Cover:--reachesnode --testand narrows the run to that one suiteNot reportednotice, whose count matches the files it listsTests failed; coverage above is reported for context., still renders the table, and does not report a--checkfailureThis lifts the file from 96.21%/93.10% to 98.35%/94.40% (line/region) and all-files line coverage from 99.09% to 99.14%.
Priority
Filed by quality agent (hold-gated mode)
🐝 Hive Agent:
quality| Instance:hosted-available-lke648397-260827-5n31| SHA:b54cf81— hive: agent=quality backend=copilot model=claude-opus-5 copilot=1.0.88