Repository navigation
chore: Replace nyc with c8 for coverage - #163
Open
TwitchBronBron wants to merge 2 commits into
Open
TwitchBronBron wants to merge 2 commits into
TwitchBronBron wants to merge 2 commits into
Conversation
nyc@15 hasn't been updated in years and dragged in ~100 transitive packages, including deprecated glob@7/rimraf@3 and istanbul-lib-processinfo, which we were patching via overrides. c8 uses V8's native coverage instead. Pinned to c8@10, the last line supporting Node 18 (c8@12 requires >=20.19). - 429 -> 366 total packages - Dropped the istanbul-lib-processinfo, uuid, and @babel/core overrides (all nyc-only), which also clears every EBADENGINE warning on Node 18 - Converted the 4 `istanbul ignore` pragmas to `c8 ignore`; c8 doesn't honor istanbul's. These are the same unreachable defensive branches as before, not newly-waived code. - Coveralls still reads ./coverage/lcov.info, unchanged Also fixes 2 pre-existing lint errors surfaced by the eslint 8.16->8.57 bump in the refreshed lockfile (logical-assignment-operators). Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
TwitchBronBron
marked this pull request as draft
September 10, 2026 16:21
test:nocover existed because nyc reported wrong line numbers in stack traces. Verified against master's actual nyc config: 4 of 5 stack frames were wrong, including util.ts:6:212 for code on line 13 (a column that doesn't exist on any line of that file) - nyc was mapping to its instrumented output. c8 matches the no-coverage run exactly on all 5 frames, so the separate script no longer serves a purpose. Overhead is ~0.8s (2.7s -> 3.5s). Repointed the VSCode test task at `npm test`. launch.json invokes _mocha directly and needed no change. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
TwitchBronBron
marked this pull request as ready for review
September 10, 2026 16:32
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
nyc@15hasn't been updated in years and pulled ~100 transitive packages, including deprecatedglob@7/rimraf@3andistanbul-lib-processinfo— which we were patching viaoverrides. c8 uses V8's native coverage instead.Pinned to c8@10, the last line supporting Node 18 (
c8@12requires>=20.19). Verified on Node 18.20.8 locally; CI is on 18.20.4.What changed
istanbul-lib-processinfo,uuid, and@babel/coreoverrides (all nyc-only). This also clears everyEBADENGINEwarning on Node 18 — two of those overrides required Node ≥20.istanbul ignorepragmas toc8 ignore; c8 doesn't honor istanbul's. Same unreachable defensive branches as before, not newly-waived code.test:nocover. It existed because nyc mangled stack-trace line numbers. Measured against master's actual nyc config with a probe file of known-line failures, 4 of 5 frames were wrong — worst wasutil.ts:6:212for code on line 13, a column that exists on no line of that file (nyc was mapping to its instrumented output). c8 matches the no-coverage run exactly on all 5 frames, so the separate script has no remaining purpose. Overhead is ~0.8s (2.7s → 3.5s). The VSCode test task now runsnpm test;launch.jsoninvokes_mochadirectly and needed no change../coverage/lcov.info— unchanged path,lcovonlyreporter retained along withtext-summaryandhtml. The HTML report renders TypeScript source, so mapping works there too.logical-assignment-operators) surfaced by the eslint 8.16→8.57 bump in the refreshed lockfile. They reproduce on master and would block CI regardless.One caveat worth knowing: c8@10 is a frozen line until the Node 18 floor moves, so this trades nyc's staleness for a pin rather than eliminating it. The tree reduction, override cleanup, and correct sourcemaps are the real wins.
Verified: 324 tests passing at 100% statements/branches/functions/lines after a clean
rm -rf node_modules package-lock.json && npm install;npm run lint,npm run build, andnpm run audit(0 vulnerabilities) all clean. Also confirmed the coverage gate still fails correctly by temporarily adding an uncovered function — exit code 1, all three affected metrics flagged.🤖 Generated with Claude Code