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.

Incorrect Coverage

See original GitHub issue

The current coverage being generated does not reflect the source. At the moment, since the test files are so simple, it’s hard to notice. However, when a more complex class and test spec is introduced, we get errors when the coverage points to lines that don’t match up to the source file.

screen shot 2016-10-13 at 2 35 51 pm

I believe the problem is that rollup-plugin-stanbul is instrumenting the wrong file. I’ve tried with no luck to try and get either the karma-remap-istanbul or the karma-remap-coverage working to compensate.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:2
  • Comments:13 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
hotforfeaturecommented, Nov 1, 2016

Thanks @marcoturi, it’s working now after I updated my repository to match.

Quick note if anybody finds this issue and is still having problems: it is critical that "istanbul-instrumenter-loader": "0.2.0" is set in package.json. A regular npm install --save-dev istanbul-instrumenter-loader will save a later version beyond 0.2.0 that causes similar Cannot read property 'text' of undefined errors.

1reaction
duydaocommented, Oct 16, 2016

Sure, this is the relevant configuration in karma.conf.js:

    reporters: ['mocha', 'coverage', 'remap-coverage'],
    coverageReporter: {
      type: 'in-memory'
    },
    remapCoverageReporter: {
      'text-summary': null, // to show summary in console
      html: './coverage/html'
    },
Read more comments on GitHub >

github_iconTop Results From Across the Web

Incorrect Jest coverage · Issue #3854 · swc-project/swc - GitHub
When using @swc/jest to transpile ts to commonjs and running jest --coverage certain branches are shown as not covered (console logging in ...
Read more >
False coverage rate - Wikipedia
In statistics, a false coverage rate (FCR) is the average rate of false coverage, i.e. not covering the true parameters, among the selected...
Read more >
Incorrect coverage for Overall Code on feature branch
Issue summary: A feature branch containing small changes is not picking up the old code coverage for Overall Code.
Read more >
Incorrect coverage number reported by codecov - Bug Fixes
The covered/uncovered seems to be correct visually (if we got by green and red highlighting). It's just that the counting of lines seem...
Read more >
Code coverage report seems incorrect. Why? - Google Groups
I use Jacoco with ant and then use sonar to reuse jacoco.exec to show the result. But the result seems incorrect. What's wrong...
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