Discrepancy between Node v10.15 and v10.16
See original GitHub issue- Version: 5.0.1
- Platform: Mac OS Mojave 10.14.6 Node Versions: 10.15 and 10.16 mocha: v6.2.0 ts-mocha: v6.0.0
Greetings, I’ve recently started to write unit tests for one of our projects, using mocha, and I’ve noticed that the reports generated by c8 show some discrepancies, when switching between Node v10.15 and v10.16.
Using Node v10.15:
Using Node v10.16:
I noticed that the Uncovered lines
section in particular shows very different results.
In both cases I used c8@5.0.1
.
I could probably live with the 0.05% difference in the statements
and lines
sections (for now, at least), but an almost 18% difference for branch
is rather huge.
So the question is: How can I tell which one of these reports is more accurate?
Here are the full coverage logs: v10.15_coverage.txt v10.16_coverage.txt
Thanks in advance for any help!
Issue Analytics
- State:
- Created 4 years ago
- Comments:7 (4 by maintainers)
Top Results From Across the Web
The Difference Between Node.js 10 LTS and Node.js 12 LTS
Node.js® is a JavaScript runtime built on Chrome's V8 JavaScript engine.
Read more >Benchmarking Node.js: v16, v14, v12, v10, v8, v6, v4 and Go ...
The observation that Node.js performance has plateaued remains true. The difference between results with an AMD CPU vs. previous results with an ...
Read more >Breaking changes from V10 -> V16 ? #42622 - GitHub
Background: I need to update a loopback 3 project from using node 10 to node 16. And was just checking for any breaking...
Read more >Upgrading Node.js to latest version - Stack Overflow
js to the latest one and don't need multiple versions, simply over-write your existing executable with the new one.
Read more >Download & Update Node.js to the Latest Version! Node v19 ...
Direct download links to update to the latest Node.js versions: Node v19.0.0 / LTS v16.18.0.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Hey @ElRaptorus, I’ve tested on newer versions of Node.js, and now that we support source-maps behavior seems correct:
Node 12+ and c8 6+
👇 the correct parts of the codebase are labeled as covered/uncovered.
Node <12 c8 < 6
👇 random parts of the codebase are highlighted, because of a lack of source-map information.
The missing source-map information would have been what was creating your highly variable coverage results.
Going forwards, I recommend doing something like we’ve done with yargs, where you only run coverage for the newest version of Node.js (I think for most folks, this is a sufficient window into the state of the project).
@ElRaptorus thank you, I’ll take a look as soon as possible.