karma-runner / karma-runner/karma-coverage
Karma-coverage does not show test coverage but function call coverage
- Dominant language
- JavaScript
- Stars
- 771
- Forks
- 242
- PR merge metrics
- No merged PRs in 30d
Description
When I run the example from http://ariya.ofilabs.com/2013/10/code-coverage-of-jasmine-tests-using-istanbul-and-karma.html The coverage is 100%. When I add the self() function into sqrt.js:
```
var My = {
sqrt: function(x) {
if (x < 0) throw new Error("sqrt can't work on negative number");
return Math.exp(Math.log(x)/2);
},
self: function(x) {
return x;
}
};
My.self();
```
the report shows 100% coverage although there is not test for the self function.
Contributor guide
Research direction
Reproduce the example from the linked Istanbul and Karma coverage article, then add the shown self function to sqrt.js and inspect the generated report. Trace why the report remains at 100% despite the untested function. Done means the report correctly reflects that self is not covered.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- testing
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100