-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
feat(cli): support excluding projects with --project=!pattern
#6924
Conversation
✅ Deploy Preview for vitest-dev ready!Built without sensitive environment variables
To edit notification comments on pull requests, go to your Netlify site configuration. |
@@ -7,6 +7,9 @@ test.each([ | |||
{ pattern: '*j*', expected: ['project_1', 'project_2'] }, | |||
{ pattern: 'project*', expected: ['project_1', 'project_2'] }, | |||
{ pattern: 'space*', expected: ['space_1'] }, | |||
{ pattern: '!project_1', expected: ['project_2', 'space_1'] }, | |||
{ pattern: '!project*', expected: ['space_1'] }, | |||
{ pattern: '!project', expected: ['project_1', 'project_2', 'space_1'] }, | |||
])('should match projects correctly: $pattern', async ({ pattern, expected }) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hm, this test seems a bit flawed. What about adding something like this?
expect(ctx.projects.map(p => p.name)).toEqual(expected)
Note: await runVitest
returns ctx
root: 'fixtures/project', | ||
reporters: ['basic'], | ||
project: pattern, | ||
}) | ||
|
||
expect(stderr).toBeFalsy() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No need to remove other assertions - they assert the reporter behaviour (what users see). stderr
is especially important - we should be able to see what's wrong without reruning the test
LGTM! |
Awesome, thanks! |
Description
This PR allows a leading
!
to negate patterns in the--project
option, making it possible to exclude certain projects when runningvitest
.Please don't delete this checklist! Before submitting the PR, please make sure you do the following:
pnpm-lock.yaml
unless you introduce a new test example.Tests
pnpm test:ci
.Documentation
pnpm run docs
command.Changesets
feat:
,fix:
,perf:
,docs:
, orchore:
.