bcoe / bcoe/c8

Coverage report is missing uncovered files when using `--all` with `--include`

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

Description

When running the test suite of **MySQL2** with **c8** using `--all` combined with `--include`, some files that exist and match the include patterns become **invisible** in the coverage report when totally uncovered.

For context, here is the coverage configuration used:

```json
{
"all": true,
"include": ["index.js", "promise.js", "lib/**/*.js"],
"exclude": ["mysqldata/**", "node_modules/**", "test/**"],
"reporter": ["text", "lcov", "cobertura"],
"statements": 80,
"branches": 80,
"functions": 77,
"lines": 80,
"checkCoverage": true,
"clean": true
}
```

However, `lib/results_stream.js` and `lib/packets/binlog_query_statusvars.js` don't appear in the report.

**Expected behavior:**

When bypassing **c8**'s filtering (e.g., collecting **V8** coverage data directly and calling `Report` programmatically) from my [custom plugin that uses **C8** behind the scenes](https://github.com/pokujs/c8), both files correctly appear with 0% coverage, confirming they exist and match the patterns.

> [!NOTE]
> - [x] I'm preparing a fix for this 🙋🏻‍♂️

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.