Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Coverage issue using v8 instead of c8. #3783

Closed
6 tasks done
Polluux opened this issue Jul 19, 2023 · 1 comment · Fixed by #3784
Closed
6 tasks done

Coverage issue using v8 instead of c8. #3783

Polluux opened this issue Jul 19, 2023 · 1 comment · Fixed by #3784
Labels
feat: coverage Issues and PRs related to the coverage feature
Milestone

Comments

@Polluux
Copy link

Polluux commented Jul 19, 2023

Describe the bug

There is a difference between the @vitest/coverage-c8 coverage provider and the @vitest/coverage-v8 coverage provider.
V8 highlights wrong lines as not covered (and misses some others), while C8 does its job correctly.
(Coverage reports, screenshots and explainations in the github repository).

Reproduction

https://github.com/Polluux/demo-v8-coverage-issues

System Info

System:
    OS: Linux 6.2 Ubuntu 23.04 23.04 (Lunar Lobster)
    CPU: (8) x64 Intel(R) Core(TM) i7-8565U CPU @ 1.80GHz
    Memory: 6.61 GB / 15.48 GB
    Container: Yes
    Shell: 5.2.15 - /bin/bash
  Binaries:
    Node: 18.13.0 - ~/.nvm/versions/node/v18.13.0/bin/node
    Yarn: 1.22.4 - /usr/bin/yarn
    npm: 9.6.2 - ~/.nvm/versions/node/v18.13.0/bin/npm
  Browsers:
    Chrome: 90.0.4430.93
    Chromium: 114.0.5735.198
    Firefox: 115.0.1
  npmPackages:
    @vitejs/plugin-vue: ^4.2.3 => 4.2.3 
    @vitest/coverage-c8: ^0.33.0 => 0.33.0 
    @vitest/coverage-v8: ^0.33.0 => 0.33.0 
    vite: ^4.4.0 => 4.4.4 
    vitest: ^0.33.0 => 0.33.0

Used Package Manager

npm

Validations

@AriPerkkio AriPerkkio added bug feat: coverage Issues and PRs related to the coverage feature and removed pending triage labels Jul 19, 2023
@AriPerkkio
Copy link
Member

AriPerkkio commented Jul 19, 2023

This is likely happening only on Vue projects. Istanbul and c8 providers seems to work OK, v8 provider has some padding issues.

Thanks for clear reproduction case @Polluux!

AriPerkkio added a commit to AriPerkkio/vitest that referenced this issue Jul 21, 2023
@sheremet-va sheremet-va added this to the 0.34.0 milestone Jul 28, 2023
@github-actions github-actions bot locked and limited conversation to collaborators Aug 12, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feat: coverage Issues and PRs related to the coverage feature
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants