Drop coverage entries whose source-mapped path does not exist - #35
Merged
Merged
Conversation
Packages like route-recognizer ship source maps with bare relative
`sources` ("route-recognizer/dsl.ts"). v8-to-istanbul resolves those
against the bundle's directory, producing paths inside the project root
that point at no file. They passed the node_modules filter and landed in
the report with meaningless numbers, and the HTML reporter rendered an
ENOENT stack trace instead of source.
Fixes #34
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Contributor
Coverage reports
Each artifact is the scenario's From this CI run for 3b6b065. |
Each scenario now checks that nothing from node_modules is reported, and that every reported file exists on disk. Workspace packages are exempt from the first check by realpath: pnpm symlinks v2-addon-js into the consuming app's node_modules, but it resolves back into this repo. vite-app-js gains route-recognizer as a real, test-exercised dependency — the package from #34 — so the filter has third-party coverage data to actually reject. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
`oxfmt` is pinned to `latest`, so CI installs a newer version than the lockfile records. 0.63 collapses an object whose only content is a block comment onto one line, which made `pnpm format:check` fail on main. Give the example a real option so it stays multi-line and readable either way. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Merged
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.
Fixes #34
route-recognizerships a source map whosesourcesare bare relative paths (route-recognizer/dsl.ts, …). When chained into the app bundle,v8-to-istanbulresolves those against the bundle's own directory, producing absolute paths inside the project root that point at no file — so they slipped past the node_modules/project-root filter.toIstanbul()emits an entry for every source in a 1:many map regardless of whether V8 data reached it, which is why they showed up with bogus percentages, and why the HTML reporter rendered anENOENTstack trace in place of the source.Fix: skip coverage entries whose resolved path doesn't exist on disk, logging each drop to
coverage-debug.log. Such a path was never reportable — the HTML/lcov reporters need to read it, andreconcileWithOriginalSourcealready bails on it.Adds a unit test that builds a fixture bundle + source map with one real source and one bare-relative
route-recognizer/dsl.tssource; it fails without the fix.🤖 Generated with Claude Code