fix: --project negation excludes browser instances#10131
Merged
sheremet-va merged 2 commits intoApr 14, 2026
Merged
Conversation
`--project='!name'` did not exclude browser project instances because they have derived names like "name (chromium)". The instance-level filtering would re-check each derived name against the negation regex, which didn't match, so the instances passed through. When the original project name is explicitly excluded by a negation filter, all its browser instances are now excluded without falling through to per-instance filtering. Fixes vitest-dev#10130
✅ Deploy Preview for vitest-dev ready!Built without sensitive environment variables
To edit notification comments on pull requests, go to your Netlify project configuration. |
6 tasks
sheremet-va
requested changes
Apr 13, 2026
sheremet-va
left a comment
Member
There was a problem hiding this comment.
This needs tests. See test/cli/browser-configs for examples
… earlier, add tests
Contributor
Author
|
Thanks for feedback - addressed |
sheremet-va
approved these changes
Apr 13, 2026
AriPerkkio
approved these changes
Apr 14, 2026
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Description
--project='!name'did not exclude browser project instances because they have derived names likename (chromium). The instance-level filtering would re-check each derived name against the negation regex, which didn't match, so the instances passed through.When the original project name is explicitly excluded by a negation filter, all its browser instances are now excluded without falling through to per-instance filtering.
Fixes #10130
Reproduction
https://github.com/felamaslen/vitest-project-exclude-repro
Changes
core.ts: AddedisExcludedByProjectFilter()which checks if a name is explicitly matched by a negation pattern (e.g.--project='!name')resolveProjects.ts: When the original project name is excluded by negation, return empty instances instead of falling through to per-instance filtering