feat(coverage-istanbul): transform coverage using source map#821
Merged
Conversation
✅ Deploy Preview for rstest-dev ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
70bf803 to
6b85497
Compare
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds source map transformation support to the Istanbul coverage provider, enabling coverage reports to display results mapped back to the original TypeScript source files instead of the compiled JavaScript. The implementation uses istanbul-lib-source-maps to parse and apply source maps.
Key changes:
- Added
istanbul-lib-source-mapsdependency and its type definitions - Implemented source map URL extraction from compiled JavaScript files using regex patterns
- Created a caching mechanism to avoid redundant file reads for source map URLs
- Integrated source map transformation into the coverage report generation pipeline
Reviewed changes
Copilot reviewed 14 out of 15 changed files in this pull request and generated 8 comments.
Show a summary per file
| File | Description |
|---|---|
| pnpm-lock.yaml | Added istanbul-lib-source-maps v5.0.6 and @types/istanbul-lib-source-maps v4.0.4 dependencies |
| packages/coverage-istanbul/package.json | Updated dependencies list with new source map libraries (alphabetically sorted) |
| packages/coverage-istanbul/src/utils.ts | Implemented getSourceMappingURL, registerSourceMapURL, and transformCoverage functions for source map handling |
| packages/coverage-istanbul/src/provider.ts | Integrated source map URL registration and coverage transformation into the provider workflow |
| e2e/test-coverage/sourcemap.test.ts | Added E2E test validating source map transformation from compiled JS back to original TS |
| e2e/test-coverage/fixtures/test/sourcemapMapping.test.ts | Test fixture importing and testing compiled JavaScript with source maps |
| e2e/test-coverage/fixtures/src/sourcemap.ts | Source TypeScript file for testing source map transformation |
| e2e/test-coverage/fixtures/rstest.sourcemap.config.ts | Configuration file for source map E2E test |
| e2e/test-coverage/fixtures/rstest.*.config.ts | Excluded new source map test from other coverage test configurations |
Files not reviewed (1)
- pnpm-lock.yaml: Language not supported
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
9aoy
approved these changes
Jan 8, 2026
Collaborator
|
👍 |
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.
Summary
This PR extracts
sourceMapUrlfrom js files and usesistanbul-lib-source-mapsto map coverage back to the original source code.Related Links
Checklist