Skip to content

Commit d6700bb

Browse files
authored
fix: repeatable --exclude option (#5782)
1 parent 0766b7f commit d6700bb

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

Diff for: packages/vitest/src/node/cli/cli-config.ts

+1
Original file line numberDiff line numberDiff line change
@@ -519,6 +519,7 @@ export const cliOptionsConfig: VitestCLIOptions = {
519519
exclude: {
520520
description: 'Additional file globs to be excluded from test',
521521
argument: '<glob>',
522+
array: true,
522523
},
523524
expandSnapshotDiff: {
524525
description: 'Show full diff when snapshot fails',

Diff for: test/core/test/cli-test.test.ts

+9
Original file line numberDiff line numberDiff line change
@@ -392,4 +392,13 @@ test('public parseCLI works correctly', () => {
392392
'color': true,
393393
},
394394
})
395+
396+
expect(parseCLI('vitest --exclude=docs --exclude=demo')).toEqual({
397+
filter: [],
398+
options: {
399+
'exclude': ['docs', 'demo'],
400+
'--': [],
401+
'color': true,
402+
},
403+
})
395404
})

0 commit comments

Comments
 (0)