Repository navigation
feat(coverage): v8 to support ignoreNode option - #11688
Merged
AriPerkkio merged 6 commits intoOct 22, 2026
Merged
Conversation
Adds `coverage.ignoreNode` to exclude code from coverage based on its AST node, for code that can't carry ignore hints, like code generated by plugins. Vitest's built-in filters run first. closes vitest-dev#11663
✅ Deploy Preview for vitest-dev ready!Built without sensitive environment variables
To edit notification comments on pull requests, go to your Netlify project configuration. |
AriPerkkio
requested changes
Oct 22, 2026
AriPerkkio
approved these changes
Oct 22, 2026
AriPerkkio
left a comment
Member
There was a problem hiding this comment.
Looks good to me. Thanks! 🙌
1 of 4 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #11663
Adds a
coverage.ignoreNodeoption for the v8 provider, to exclude code from coverage based on its AST node. It's for code that isn't in the source file and so can't carry a/* v8 ignore */hint, like the cache branchesbabel-plugin-react-compileradds to every component.As discussed in the issue, Vitest's built-in filters run first, so the user's filter only gets nodes Vitest doesn't already ignore.
Tests are in
test/coverage-test/test/ignore-node.v8.test.ts: one checks that matching statements and branches are excluded, the other that the filter never gets__vite_ssr_import_*nodes. Both fail without the change in the provider. There's also a type test inconfiguration-options.test-d.ts.