Skip to content

Workspaces generate inaccurate c8 coverage reports #3220

@kherock

Description

@kherock

Describe the bug

The C8 test coverage provider reports different statistics and inaccurate line numbers when the reporter runs on a workspace. When I preview the HTML report, the code highlighted is about 10 lines offset from where the actual uncovered code is. The column number offset also appear to shift 1 or 2 characters.

Reproduction

Vitest hangs when generating coverage in StackBlitz - I will provide a reproduction of this on GitHub when I have a chance.

System Info

System:
    OS: macOS 12.6.3
    CPU: (10) arm64 Apple M1 Pro
    Memory: 112.97 MB / 16.00 GB
    Shell: 5.8.1 - /bin/zsh
  Binaries:
    Node: 16.19.1 - ~/.local/share/homebrew/bin/node
    Yarn: 1.22.19 - ~/.local/share/homebrew/bin/yarn
    npm: 8.19.3 - ~/.local/share/homebrew/bin/npm
  Browsers:
    Firefox: 102.2.0
    Safari: 16.3
  npmPackages:
    @vitest/coverage-c8: ^0.30.1 => 0.30.1 
    vitest: ^0.30.1 => 0.30.1

Used Package Manager

npm

Validations

Metadata

Metadata

Assignees

No one assigned

    Labels

    feat: coverageIssues and PRs related to the coverage feature

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions