istanbul ignore annotation does not work in coverage
See original GitHub issueHello, I have next dependencies installed for project: dependencies.txt And here is my karma.conf.js: karma.conf.txt I have next block of code:
/* istanbul ignore next */
function appMenu(MenuService) {
/* istanbul ignore next */
return MenuService.loadAppMenu();
}
And here is the Coverage summary:
Statements : 87% ( 87/100 ) Branches : 62.5% ( 5/8 ) Functions : 44.44% ( 4/9 ) Lines : 87% ( 87/100 )
And here is a screenshot from html report:
At the bottom of html report I see: Code coverage generated by istanbul
I tried different ways to ignore these two lines from coverage report:
Could anyone help me to find a solution how to use ignore line/statement/branch from coverage report? Thank you.
Issue Analytics
- State:
- Created 7 years ago
- Reactions:16
- Comments:6
Top Results From Across the Web
istanbul/ignoring-code-for-coverage.md at master - GitHub
Coverage can be explicitly skipped using comments. There is no automatic pattern match of expressions to determine if they should be skipped for...
Read more >Show real test coverage without 'Ignore' annotations in Istanbul
Let me explain why: The only function of these lines is to make sure the following line/statement is not included in the coverage...
Read more >Istanbul Ignore Syntax for Jest Code Coverage
Istanbul is the tool Jest uses to calculate test coverage. Sometimes we need to exclude some code from the coverage calculations.
Read more >Configuring Jest
The Jest philosophy is to work great by default, but sometimes you just ... The babel and v8 coverage providers use /* istanbul...
Read more >Test coverage visualization - GitLab Documentation
For the coverage analysis to work, you have to provide a properly formatted Cobertura ... The source is ignored if the path does...
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
I have the same issue.
/* istanbul ignore next */
is respected by myremapIstanbulReporter
reporter, but not bycoverageReporter
.Same problem here (issue opened in 2016!)