bcoe / bcoe/c8

Incorrect code coverage report when all lines are covered

Open
#319 2 comments 0 reactions 0 assignees View on GitHub
bug p2
Dominant language
JavaScript
Stars
2.1k
Forks
99
PR merge metrics
No merged PRs in 30d

Description

## Description

Code coverage report generated by `c8` is showing incorrect result despite all branches are covered.

I even tested it with compiled JavaScript files by `swc` and the result remains unchanged when there is no additional code generated found at the said line.

## Actual behavior

![additional line reported](https://user-images.githubusercontent.com/10607759/126899579-749a1051-8a14-43ee-bc97-768c00b131dd.png)

There is 1 additional branch has been reported not being covered.

## Expected behavior

![all lines are covered](https://user-images.githubusercontent.com/10607759/126899578-3cad23f8-283b-44bc-b38f-64114f3d54ac.png)

All lines are covered and `c8` should be able to pick up the result correctly.

## Reproduction steps

1. [reduced test case](https://github.com/motss/c8-code-coverage-bug)

## Reqeuired info

* **c8**: `7.7.3`
* **Version**: `node@16.5.0`
* **Platform**: `Windows 10 x64`

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.