Skip to content

Conversation

@AriPerkkio
Copy link
Member

@AriPerkkio AriPerkkio commented May 31, 2025

Description

Vitest's V8 code coverage provider is now using more accurate coverage result remapping logic.
It is expected for users to see changes in their coverage reports when updating from Vitest v3.

In the past Vitest used v8-to-istanbul for remapping V8 coverage results into your source files.
This method wasn't very accurate and provided plenty of false positives in the coverage reports.
We've now developed a new package that utilizes AST based analysis for the V8 coverage.
This allows V8 reports to be as accurate as @vitest/coverage-istanbul reports.

  • Coverage ignore hints have updated. See Coverage | Ignoring Code.
  • coverage.ignoreEmptyLines is removed. Lines without runtime code are no longer included in reports.
  • coverage.experimentalAstAwareRemapping is removed. This option is now enabled by default, and is the only supported remapping method.
  • coverage.ignoreClassMethods is now supported by V8 provider too.

Please don't delete this checklist! Before submitting the PR, please make sure you do the following:

  • It's really useful if your PR references an issue where it is discussed ahead of time. If the feature is substantial or introduces breaking changes without a discussion, PR might be closed.
  • Ideally, include a test that fails without this PR but passes with it.
  • Please, don't make changes to pnpm-lock.yaml unless you introduce a new test example.

Tests

  • Run the tests with pnpm test:ci.

Documentation

  • If you introduce new functionality, document it. You can run documentation with pnpm run docs command.

Changesets

  • Changes in changelog are generated from PR name. Please, make sure that it explains your changes in an understandable manner. Please, prefix changeset messages with feat:, fix:, perf:, docs:, or chore:.

@AriPerkkio AriPerkkio added this to the 4.0.0 milestone May 31, 2025
@AriPerkkio AriPerkkio added breaking change feat: coverage Issues and PRs related to the coverage feature labels May 31, 2025
@AriPerkkio AriPerkkio changed the title feat!(coverage): support only AST based remapping feat!(coverage): v8 to support only AST based remapping May 31, 2025
@netlify
Copy link

netlify bot commented May 31, 2025

Deploy Preview for vitest-dev ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit 4648081
🔍 Latest deploy log https://app.netlify.com/projects/vitest-dev/deploys/68527ad2b7eff6000895df0c
😎 Deploy Preview https://deploy-preview-8064--vitest-dev.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@AriPerkkio AriPerkkio added p3-significant High priority enhancement (priority) and removed p3-significant High priority enhancement (priority) labels May 31, 2025
@AriPerkkio AriPerkkio force-pushed the feat/v8-ast-aware-only branch 2 times, most recently from bfb47ab to 4200b0d Compare June 16, 2025 12:27
@AriPerkkio AriPerkkio marked this pull request as ready for review June 16, 2025 12:27
sheremet-va
sheremet-va previously approved these changes Jun 18, 2025
@AriPerkkio AriPerkkio force-pushed the feat/v8-ast-aware-only branch from 4648081 to cab7e55 Compare June 18, 2025 08:54
@AriPerkkio AriPerkkio merged commit 176133e into vitest-dev:main Jun 18, 2025
21 of 26 checks passed
@AriPerkkio AriPerkkio deleted the feat/v8-ast-aware-only branch June 18, 2025 09:29
@AriPerkkio AriPerkkio mentioned this pull request Jun 18, 2025
6 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

breaking change feat: coverage Issues and PRs related to the coverage feature

Projects

None yet

2 participants