Coverage Report - incorrect lines
See original GitHub issueThe function beginning at line 3 is not covered by my test suite, however the code coverage report gives me seemingly arbitrary line numbers.
1 render() {
2 // TODO: remove copy (for hot reloading)
3 const handleDivClick1 = () => { // NOT COVERED
4 console.log('click!');
5 this.setState({
6 name: 'John'
7 });
8 };
9 return (
10 // TODO: replace onClick with class member (for hot reloading)
11 <div className={styles.color} onClick={this.handleDivClick}>{`Name: ${this.state.name}`}</div>
12 );
13 }
14}
The coverage report says that lines 10,11 are not covered, though even that changes depending on how many blank lines are included in the component.
Let me know if I can provide further information. Cheers, Tyler
EDIT: The reports with coverage/remapped
are correct, it’s just the console output and reports within coverage/lcov-report
that are incorrect.
Issue Analytics
- State:
- Created 7 years ago
- Reactions:4
- Comments:11 (7 by maintainers)
Top Results From Across the Web
python - Pytest incorrectly reports missing lines in coverage
I have a pytest suite with several tests. Most of them work just fine - one I just added works, but the coverage...
Read more >Code coverage report seems incorrect. Why?
The line coverage result is the same as Sonar. My ant build file about Jacoco is: <property name="sonar.dynamicAnalysis" value ...
Read more >Line coverage calculation seems incorrect? - SonarQube
Hello all, The line coverage (percentage) reported by SonarQube seems off: SonarQube says the Line Coverage is 90.9%, but (25125 - 1119) ...
Read more >Configuring code coverage in Jest, the right way
I've seen enough misconfigured JavaScript projects where Jest coverage were reported incorrectly. Let's see why this matters.
Read more >Branch coverage measurement
Statement coverage would show all lines of the function as executed. But the if was never evaluated as false, so line 2 never...
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 FreeTop 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
Top GitHub Comments
+1 for this
Guys, not sure if is related but I’m a bit confused:
Coverage: https://coveralls.io/github/coosto/ShortcutJS Tests: https://github.com/coosto/ShortcutJS/tree/master/test
Wanted to open an issue but I think this one is related. Any known workaround in the meanwhile?