gotwarlost / istanbul

Yet another JS code coverage tool that computes statement, line, function and branch coverage with module loader hooks to transparently add coverage when running tests. Supports all JS coverage use cases including unit tests, server side functional tests and browser tests. Built for scale.
Other
8.7k stars 786 forks source link

What does "ignored" mean in coverage summary? #666

Open rodoabad opened 8 years ago

rodoabad commented 8 years ago

Does it mean that it's been covered by other tests but there's no specific test for it?

davglass commented 8 years ago

No, ignored means that one of the istanbul comments was placed in the code and parts of the coverage collection was ignored.

https://github.com/gotwarlost/istanbul/blob/master/ignoring-code-for-coverage.md

rodoabad commented 8 years ago

That's when you're explicitly ignore things right?

=============================== Coverage summary ===============================
Statements   : 100% ( 11923/11923 ), 499 ignored
Branches     : 100% ( 3770/3770 ), 690 ignored
Functions    : 100% ( 2075/2075 ), 69 ignored
Lines        : 100% ( 3399/3399 )
================================================================================

I haven't explicitly ignored anything yet but I'm still getting some as ignored.

gotwarlost commented 8 years ago

Any transpilers in play? Babel for instance adds that comment.

rodoabad commented 8 years ago

@gotwarlost yes I require babel/register in my test since I'm using ES6 modules.

This is also how I setup my npm script.

babel-node node_modules/isparta/bin/isparta cover --report html node_modules/mocha/bin/_mocha -- test/unit && istanbul check-coverage --statement 100 --branch 100 --function 100 --line 100

However, I would think using isparta would mean that coverage is taken using the original files. Not the transpiled ones.