From ee366fc51e94ab4f08a46200db3d7d4314b4cffe Mon Sep 17 00:00:00 2001 From: Federico Brigante Date: Sun, 26 May 2024 21:51:41 +0800 Subject: [PATCH 1/2] Add test --- test/core/test/cli-test.test.ts | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/test/core/test/cli-test.test.ts b/test/core/test/cli-test.test.ts index 1d4a3ce636cf..0f1a5e300bdd 100644 --- a/test/core/test/cli-test.test.ts +++ b/test/core/test/cli-test.test.ts @@ -368,4 +368,13 @@ test('public parseCLI works correctly', () => { 'color': true, }, }) + + expect(parseCLI('vitest --exclude="docs/*" --exclude="demo/*"')).toEqual({ + filter: [], + options: { + 'exclude': ['docs/*', 'demo/*'], + '--': [], + 'color': true, + }, + }) }) From f0bb997537532944c2188c73d087c6e40534a40f Mon Sep 17 00:00:00 2001 From: Federico Brigante Date: Sun, 26 May 2024 21:53:58 +0800 Subject: [PATCH 2/2] Update config --- packages/vitest/src/node/cli/cli-config.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/vitest/src/node/cli/cli-config.ts b/packages/vitest/src/node/cli/cli-config.ts index b5e16b9f526c..2b8172cac750 100644 --- a/packages/vitest/src/node/cli/cli-config.ts +++ b/packages/vitest/src/node/cli/cli-config.ts @@ -494,6 +494,7 @@ export const cliOptionsConfig: VitestCLIOptions = { exclude: { description: 'Additional file globs to be excluded from test', argument: '', + array: true, }, expandSnapshotDiff: { description: 'Show full diff when snapshot fails',