Skip to content

Istanbul code coverage differs from nyc result #1887

@marvin-j97

Description

@marvin-j97

Describe the bug

I tried running Vitest + Istanbul and the result seems to differ from using Istanbul (+ Mocha, but I also tried Cypress) itself.

  • Vitest seems to output a Linux-style path for coverage-final.json, even when running on Windows, this breaks NYC merge
  • The branch coverage seems to differ
  • (_coverageSchema, hash, contentHash are missing, but they are probably not important)

image
image
First image: Mocha + NYC, second image: Vitest

I'm not 100% sure if this a Istanbul or Vitest issue

Reproduction

https://github.com/marvin-j97/vitest-windows-path

(I also have a more complex repo trying to merge Vitest + Cypress Typescript coverage reports: https://github.com/marvin-j97/good-next-template/tree/dev)

System Info

System:
    OS: Windows 10 10.0.19044
    CPU: (8) x64 Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz
    Memory: 8.75 GB / 15.96 GB
  Binaries:
    Node: 16.14.2 - C:\Program Files\nodejs\node.EXE
    Yarn: 1.22.18 - ~\AppData\Roaming\npm\yarn.CMD
    npm: 8.5.0 - C:\Program Files\nodejs\npm.CMD
  Browsers:
    Edge: Spartan (44.19041.1266.0), Chromium (104.0.1293.54)
    Internet Explorer: 11.0.19041.1566
  npmPackages:
    vitest: 0.22.1 => 0.22.1

Used Package Manager

yarn

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