karma-coverage icon indicating copy to clipboard operation
karma-coverage copied to clipboard

istanbul ignore annotation does not work in coverage

Open eliotik opened this issue 8 years ago • 6 comments

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.

eliotik avatar Aug 17 '16 14:08 eliotik

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 ;)

maciej-zuk avatar May 25 '17 14:05 maciej-zuk

doesn't work for me 😭

WuglyakBolgoink avatar Jul 28 '17 15:07 WuglyakBolgoink

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

jaketodaro avatar Dec 03 '17 19:12 jaketodaro

Same problem here.

Goran216 avatar Aug 20 '19 15:08 Goran216

same problem here

rosiejaneenomar avatar Jan 27 '20 09:01 rosiejaneenomar

Same problem here (issue opened in 2016!)

dfa1234 avatar Jul 05 '21 12:07 dfa1234