karma-runner / karma-coverage

A Karma plugin. Generate code coverage.
MIT License
770 stars 247 forks source link

istanbul ignore annotation does not work in coverage #247

Open eliotik opened 8 years ago

eliotik commented 8 years ago

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.

maciej-zuk commented 7 years ago

try adding 'coverage' to preprocessors, if you are lucky enough you might not end up with out of memory error like me and have istanbul annotations correctly parsed ;)

WuglyakBolgoink commented 7 years ago

doesn't work for me 😭

jaketodaro commented 6 years ago

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

Goran216 commented 5 years ago

Same problem here.

rosiejaneenomar commented 4 years ago

same problem here

dfa1234 commented 3 years ago

Same problem here (issue opened in 2016!)