Skip to content

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

Description

@wellwelwel

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:

{
  "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, both files correctly appear with 0% coverage, confirming they exist and match the patterns.

Note

  • I'm preparing a fix for this 🙋🏻‍♂️

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions