question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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: Bildschirmfoto 2019-09-02 um 13 20 44

Using Node v10.16: Bildschirmfoto 2019-09-02 um 13 20 31

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:closed
  • Created 4 years ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
bcoecommented, Nov 30, 2019

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.

correct-lines-covered

Node <12 c8 < 6

👇 random parts of the codebase are highlighted, because of a lack of source-map information.

random

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).

1reaction
bcoecommented, Sep 9, 2019

@ElRaptorus thank you, I’ll take a look as soon as possible.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found