istanbul ignore annotation does not work in coverage

See original GitHub issue

Hello, 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: no_function_no_statement_coverage

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: no_covered

Could anyone help me to find a solution how to use ignore line/statement/branch from coverage report? Thank you.

Issue Analytics

  • State:open
  • Created 7 years ago
  • Reactions:16
  • Comments:6

github_iconTop GitHub Comments

1reaction
jaketodarocommented, Dec 3, 2017

I have the same issue. /* istanbul ignore next */ is respected by my remapIstanbulReporter reporter, but not by coverageReporter.

0reactions
dfa1234commented, Jul 5, 2021

Same problem here (issue opened in 2016!)

Read more comments on GitHub >

github_iconTop 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 >

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