karma-runner / karma-runner/karma-coverage
istanbul ignore annotation does not work in coverage
- Dominant language
- JavaScript
- Stars
- 771
- Forks
- 242
- PR merge metrics
- No merged PRs in 30d
Description
Hello,
I have next dependencies installed for project: [dependencies.txt](https://github.com/karma-runner/karma-coverage/files/422809/dependencies.txt)
And here is my karma.conf.js: [karma.conf.txt](https://github.com/karma-runner/karma-coverage/files/422815/karma.conf.txt)
I have next block of code:
``` javascript
/* 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.
Contributor guide
Research direction
Reproduce the report using the linked dependencies.txt and karma.conf.js, then inspect how the JavaScript coverage report handles the shown `istanbul ignore next` annotations. Compare the coverage summary and HTML report with the annotated function and statement; done means the intended ignored code no longer affects the reported coverage.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- testing-qa
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100