Skip to content

Commit d1a0673

Browse files
authoredFeb 22, 2024··
fix: repeatable --project option (#5265)
1 parent 424f3ac commit d1a0673

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed
 

‎packages/vitest/src/node/cli/cli-config.ts

+1
Original file line numberDiff line numberDiff line change
@@ -526,6 +526,7 @@ export const cliOptionsConfig: VitestCLIOptions = {
526526
project: {
527527
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',
528528
argument: '<name>',
529+
array: true,
529530
},
530531
slowTestThreshold: {
531532
description: 'Threshold in milliseconds for a test to be considered slow (default: 300)',

‎test/core/test/cli-test.test.ts

+9
Original file line numberDiff line numberDiff line change
@@ -321,4 +321,13 @@ test('public parseCLI works correctly', () => {
321321
expect(() => {
322322
parseCLI('node --test --coverage --browser --typecheck')
323323
}).toThrowError(`Expected "vitest" as the first argument, received "node"`)
324+
325+
expect(parseCLI('vitest --project=space_1 --project=space_2')).toEqual({
326+
filter: [],
327+
options: {
328+
'project': ['space_1', 'space_2'],
329+
'--': [],
330+
'color': true,
331+
},
332+
})
324333
})

0 commit comments

Comments
 (0)
Please sign in to comment.