Skip to content

Commit

Permalink
fix: repeatable --project option (#5265)
Browse files Browse the repository at this point in the history
  • Loading branch information
fenghan34 authored Feb 22, 2024
1 parent 424f3ac commit d1a0673
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
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,
},
})
})

0 comments on commit d1a0673

Please sign in to comment.