Repro case for an issue with incorrect highlighting in coverage HTML report when using nyc + Babel + AVA. Code is extracted from the cochan lib.
To reproduce the issue, run npm install
followed by npm run cov
,
and then inspect HTML report located in converage/index.html
. The
report is also uploaded to this GH pages site.
To see the issue, look at the _takeFromWaitingPublisher()
function,
which looks like this:
Annotations on the left suggest that it has been executed multiple times, and that's indeed the case as the test code is crafted to ensure this. However, it is highlighted as not being covered.
The _take()
function also has similar problem, although its code is
highlighted in yellow, which means "branch not covered". However, the
highlighted code has clearly been executed multuple times.
Also, the highlighting sometimes starts and ends at positions that
make no sense, e.g. between "t" and "h" letters in this
keyword.
And perhaps the most critical issue: overall coverage numbers for branches and functions look incorrect, much less than expected.