Open JustinChristensen opened 3 years ago
@JustinChristensen one problem is that v8 output won't necessarily have all the same branch information, as it collapses together consecutive blocks.
I think this problem might be better solved by merging together the reports while they're in v8 format, which is what happens here.
The conversion from v8 to istanbul is a bit lossy (due to the merging) so I think it's challenging to solve at that layer.
I'm not really sure what the expected behavior here should be. I'm using Playwright to run tests and extract coverage reports from V8 for the same test run, and to then convert and merge them together using a coverage map (from
istanbul-lib-coverage
). .v8-to-istanbul appears to only have branches that were covered in the v8 coverage report in it's
branchMap
. This causes the final merged coverage map to have a mismatch between the number of branches in thebranchMap
and theb
hit counters, because of the way thatFileCoverage
merge is written.Whether this should be fixed by making that merge routine (mentioned in the linked issue) smarter, or making v8toistanbul attempt to get all (including uncovered branches) in the
branchMap
for a given file, I can't say for sure.