-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Open
Labels
feat: coverageIssues and PRs related to the coverage featureIssues and PRs related to the coverage featureupstream
Description
Describe the bug
Coverage ignore hints no longer have any effect when running on Vite 8.
Annotated branches are still reported as uncovered, causing coverage threshold failures.
Vite 8 dropped esbuild entirely in favor of Oxc. Oxc seems to strips all comments during transformation and I found no option to preserve them. So, by the time the coverage plugin receives the code, the ignore hints are gone.
Reproduction
With or without @preserve the if is still considered as uncovered by istanbul despite the ignre
/* istanbul ignore if -- @preserve */
if (condition) {
return false;
}System Info
Environment
- vitest: 4.1.0
- @vitest/coverage-istanbul: 4.1.0
- vite: 8.0.1Used Package Manager
yarn
Validations
- Follow our Code of Conduct
- Read the Contributing Guidelines.
- Read the docs.
- Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
- Check that this is a concrete bug. For Q&A open a GitHub Discussion or join our Discord Chat Server.
- The provided reproduction is a minimal reproducible example of the bug.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
feat: coverageIssues and PRs related to the coverage featureIssues and PRs related to the coverage featureupstream