jeffrifwald / babel-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
144 stars 23 forks source link

branchMap and fnMap `line` properties are not corrected #3

Closed Swatinem closed 9 years ago

Swatinem commented 9 years ago

I was wondering why my coverage reports that get uploaded to codecov are missing branch (and function) coverage stats. I’m uploading the lcov.info file. But looking at the .json file, I noticed that the line member for branchMap and fnMap items is not corrected, while the locations (start and end) are correct. The lcov file generated from the json also gets the wrong locations, thats why codecov ignores them.

I will look into this tomorrow when I got the time…

Swatinem commented 9 years ago

Hm, apparently codecov not showing the branch coverage is a separate issue: https://github.com/codecov/support/issues/22

But with the provided patch, lcov genhtml lcov.info --rc lcov_branch_coverage=1 generates the correct annotations with the correct branch line numbers