Skip to content
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

fix: repeatable --project option #5265

Merged
merged 2 commits into from
Feb 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions packages/vitest/src/node/cli/cli-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -526,6 +526,7 @@ export const cliOptionsConfig: VitestCLIOptions = {
project: {
description: 'The name of the project to run if you are using Vitest workspace feature. This can be repeated for multiple projects: --project=1 --project=2',
argument: '<name>',
array: true,
},
slowTestThreshold: {
description: 'Threshold in milliseconds for a test to be considered slow (default: 300)',
Expand Down
9 changes: 9 additions & 0 deletions test/core/test/cli-test.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -321,4 +321,13 @@ test('public parseCLI works correctly', () => {
expect(() => {
parseCLI('node --test --coverage --browser --typecheck')
}).toThrowError(`Expected "vitest" as the first argument, received "node"`)

expect(parseCLI('vitest --project=space_1 --project=space_2')).toEqual({
filter: [],
options: {
'project': ['space_1', 'space_2'],
'--': [],
'color': true,
},
})
})
Loading