Skip to content

Commit

Permalink
fix: repeatable --exclude option (#5782)
Browse files Browse the repository at this point in the history
  • Loading branch information
fregante authored May 28, 2024
1 parent 0766b7f commit d6700bb
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 @@ -519,6 +519,7 @@ export const cliOptionsConfig: VitestCLIOptions = {
exclude: {
description: 'Additional file globs to be excluded from test',
argument: '<glob>',
array: true,
},
expandSnapshotDiff: {
description: 'Show full diff when snapshot fails',
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 @@ -392,4 +392,13 @@ test('public parseCLI works correctly', () => {
'color': true,
},
})

expect(parseCLI('vitest --exclude=docs --exclude=demo')).toEqual({
filter: [],
options: {
'exclude': ['docs', 'demo'],
'--': [],
'color': true,
},
})
})

0 comments on commit d6700bb

Please sign in to comment.