fix: map paths back to original file paths#64
Open
dword-design wants to merge 7 commits intoistanbuljs:masterfrom
Open
fix: map paths back to original file paths#64dword-design wants to merge 7 commits intoistanbuljs:masterfrom
dword-design wants to merge 7 commits intoistanbuljs:masterfrom
Conversation
This was referenced Mar 12, 2021
Author
|
I added a commit that also applies source maps, so now we have coverage that matches the original file's lines. |
Member
|
@dword-design hey 👋 sorry for the slow review, got a bit behind on GitHub. I don't do much frontend coding these days I'm afraid, so I'm willing to defer to your expertise (as an active user of the module). If we can get tests passing, I'm open to your proposal. |
Author
|
@bcoe Alright. I think it needs some more work, also regarding the tests. I'll keep pushing stuff in here and if it has a stable state, I'll write it here. I'm not (or wasn't) a big expert in code coverage, so I'm getting into the topic by this. Would be great to have a library that reflects covered code in puppeteer back to the original source files. |
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.
Hey folks,
I like this package and it solves a lot of my code coverage problems in frontend testing!
One problem with the current implementation is that the coverage is actually measured on different files than the original ones. This works rather fine when you only measure coverage over visited files. However, it leads to problems when you e.g. work with the
nyc --alloption and you want to be precise with the covered files.While it is necessary to write the generated webpack files to disk for
v8-to-istanbul, we actually do not need to pass the coverage data on as-is. We can convert them back to their original paths and have nice and consistent coverage data.The current proposal is kinda the idea, there are failing tests and I need some feedback from contributors who are deeper into the topic. Also, the implementation with the for loops is a bit error prone, I'd prefer a non-mutating solution here.
Would love to have this integrated. For me it's working fine!