vitest 5.0.5 → 5.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (62) hide show
  1. package/LICENSE.md +1 -1
  2. package/dist/browser.d.ts +6 -5
  3. package/dist/browser.js +6 -6
  4. package/dist/chunks/{base.CzXt2BO_.js → base.Cof-UHJf.js} +17 -21
  5. package/dist/chunks/{browser.d.FGQ9_rK6.d.ts → browser.d.C7tWgUvw.d.ts} +4 -3
  6. package/dist/chunks/{cac.CLrZKo1g.js → cac.BYbt0aJp.js} +30 -16
  7. package/dist/chunks/{cli-api.De07GUeT.js → cli-api.COfZo8lK.js} +5226 -4385
  8. package/dist/chunks/{config.d.QBNYCgFU.d.ts → config.d.B3YV4t0O.d.ts} +169 -93
  9. package/dist/chunks/{console.DtI4yxfN.js → console.CQZ877Hi.js} +6 -3
  10. package/dist/chunks/{constants.-juJ8b_4.js → constants.DLYM6cZY.js} +1 -1
  11. package/dist/chunks/{coverage.-bm5IxnW.js → coverage.9iqXE2gN.js} +1 -1
  12. package/dist/chunks/{coverage.cTDc4uSS.js → coverage.jGCktcGP.js} +1 -1
  13. package/dist/chunks/{creator.C5g4egeG.js → creator.DHWmytIK.js} +11 -11
  14. package/dist/chunks/{doctor.BK86Cncq.js → doctor.B-oPbwps.js} +2 -2
  15. package/dist/chunks/{environment.d.BY56MoGs.d.ts → environment.d.BFQtFKdZ.d.ts} +1 -1
  16. package/dist/chunks/{globals.CXEE6_2C.js → globals.ZKtKSkEf.js} +7 -6
  17. package/dist/chunks/{index.CK-t0WMg.js → index.Bi0NXYPf.js} +165 -62
  18. package/dist/chunks/{index.aTZaPVhf.js → index.CZzC1gGg.js} +299 -440
  19. package/dist/chunks/{index.1TqnEahn.js → index.Di8au7q4.js} +104 -72
  20. package/dist/chunks/{index.CoUIxZd4.js → index.w_oBZ9N8.js} +5 -5
  21. package/dist/chunks/{init-forks.CRxIPOJR.js → init-forks.BaDXQSD8.js} +1 -1
  22. package/dist/chunks/{init-threads.Dv3kwST_.js → init-threads.ZX_Vov0z.js} +1 -1
  23. package/dist/chunks/{init.PvxYpuCm.js → init.CO4AB7HZ.js} +4 -4
  24. package/dist/chunks/{module-dependencies.CwNPkcV4.js → module-dependencies._2Eei3FO.js} +1 -1
  25. package/dist/chunks/{native.cdzHIdmv.js → native.upB-V0CK.js} +1 -1
  26. package/dist/chunks/{nativeModuleMocker.BxrHJNAF.js → nativeModuleMocker.Dh5azSB4.js} +4 -3
  27. package/dist/chunks/{nativeModuleRunner.xi64Afb2.js → nativeModuleRunner.9xPIMzi7.js} +1 -1
  28. package/dist/chunks/{node.uQulW0ei.js → node.B9mkVmLH.js} +1 -1
  29. package/dist/chunks/{pathe.M-eThtNZ.Ba-7h1rE.js → pathe.M-eThtNZ.zq3TM4NT.js} +1 -1
  30. package/dist/chunks/{plugin.d.C8mmycim.d.ts → plugin.d.LRFSN46m.d.ts} +191 -32
  31. package/dist/chunks/rawSnapshot.DqSiqIEx.js +356 -0
  32. package/dist/chunks/{resolver.CtCcxIy1.js → resolver.BzpmeQeT.js} +1 -1
  33. package/dist/chunks/{rpc.DpkUyY1N.js → rpc.Uhkwr2NM.js} +2 -2
  34. package/dist/chunks/{rpc.d.Cft1biqy.d.ts → rpc.d.3FOhdFx8.d.ts} +1 -1
  35. package/dist/chunks/{run.BPv-BBRv.js → run.CjdgFZiW.js} +28 -7
  36. package/dist/chunks/{setup-common.HGAqWOnX.js → setup-common.CqAQCXzx.js} +2 -2
  37. package/dist/chunks/{source-map.DdKI5IHB.js → source-map.DakdQc29.js} +43 -37
  38. package/dist/chunks/{source-map.d.kzFtk_dj.d.ts → source-map.d.BkG8YK_3.d.ts} +2 -1
  39. package/dist/chunks/{task-utils.d.PFh2BV6Q.d.ts → task-utils.d.D-gFPNFi.d.ts} +2 -1
  40. package/dist/chunks/{utils.DSfl_w8V.js → utils.BBk_icFG.js} +6 -3
  41. package/dist/chunks/{vm.FGl2rw_t.js → vm.b4MbCAJQ.js} +27 -14
  42. package/dist/chunks/{worker.d.BH-r1bPu.d.ts → worker.d.CyJRpyfZ.d.ts} +3 -3
  43. package/dist/cli.js +3 -3
  44. package/dist/config.cjs +1 -1
  45. package/dist/config.d.ts +11 -11
  46. package/dist/config.js +1 -1
  47. package/dist/index.d.ts +21 -15
  48. package/dist/index.js +6 -5
  49. package/dist/module-evaluator.d.ts +3 -2
  50. package/dist/node.d.ts +30 -12
  51. package/dist/node.js +16 -14
  52. package/dist/runtime.d.ts +4 -4
  53. package/dist/runtime.js +5 -4
  54. package/dist/task-utils.js +10 -4
  55. package/dist/worker.d.ts +4 -4
  56. package/dist/worker.js +14 -13
  57. package/dist/workers/forks.js +15 -14
  58. package/dist/workers/runVmTests.js +16 -12
  59. package/dist/workers/threads.js +15 -14
  60. package/dist/workers/vmForks.js +11 -10
  61. package/dist/workers/vmThreads.js +11 -10
  62. package/package.json +17 -17
package/LICENSE.md CHANGED
@@ -488,7 +488,7 @@ Repository: git+https://github.com/antfu-collective/local-pkg.git
488
488
  ## mime
489
489
  License: MIT
490
490
  By: Robert Kieffer
491
- Repository: https://github.com/broofa/mime
491
+ Repository: git+https://github.com/broofa/mime.git
492
492
 
493
493
  > MIT License
494
494
  >
package/dist/browser.d.ts CHANGED
@@ -1,12 +1,14 @@
1
- import { F as FileSpecification, c as SerializedDiffOptions } from './chunks/config.d.QBNYCgFU.js';
1
+ import { F as FileSpecification, c as SerializedDiffOptions } from './chunks/config.d.B3YV4t0O.js';
2
2
  import { SerializedCoverageConfig, RunnerTestFile as File, SerializedConfig, DiffOptions, TestError } from './index.js';
3
3
  import { VitestRunner } from './runtime.js';
4
- export { P as ParsedStack, _ as SpyModule, d as StringifyOptions, f as format, i as inspect, s as stringify } from './chunks/config.d.QBNYCgFU.js';
5
- import { R as RuntimeCoverageModuleLoader } from './chunks/source-map.d.kzFtk_dj.js';
6
- export { D as DecodedMap, g as getOriginalPosition } from './chunks/source-map.d.kzFtk_dj.js';
4
+ export { P as ParsedStack, _ as SpyModule, d as StringifyOptions, f as format, i as inspect, s as stringify } from './chunks/config.d.B3YV4t0O.js';
5
+ import { R as RuntimeCoverageModuleLoader } from './chunks/source-map.d.BkG8YK_3.js';
6
+ export { D as DecodedMap, g as getOriginalPosition } from './chunks/source-map.d.BkG8YK_3.js';
7
7
  import 'vitest/optional-runtime-types.js';
8
8
  import 'tinybench';
9
9
 
10
+ type BrowserTraceEntryKind = "action" | "expect" | "mark" | "lifecycle";
11
+
10
12
  declare function getType(value: unknown): string;
11
13
 
12
14
  interface SafeTimers {
@@ -59,7 +61,6 @@ interface BrowserCommands {
59
61
  removeFile: (path: string) => Promise<void>;
60
62
  }
61
63
  interface CDPSession {}
62
- type BrowserTraceEntryKind = "action" | "expect" | "mark" | "lifecycle";
63
64
  interface MarkOptions {
64
65
  /**
65
66
  * Optional stack string used to resolve marker location.
package/dist/browser.js CHANGED
@@ -1,11 +1,11 @@
1
- export { s as startCoverageInsideWorker, a as stopCoverageInsideWorker, t as takeCoverageInsideWorker } from './chunks/coverage.-bm5IxnW.js';
2
- export { p as collectTests, a as processError, s as startTests } from './chunks/run.BPv-BBRv.js';
3
- export { l as loadDiffConfig, a as loadSnapshotSerializers, s as setupCommonEnv, b as setupEnv } from './chunks/setup-common.HGAqWOnX.js';
1
+ export { s as startCoverageInsideWorker, a as stopCoverageInsideWorker, t as takeCoverageInsideWorker } from './chunks/coverage.9iqXE2gN.js';
2
+ export { p as collectTests, a as processError, s as startTests } from './chunks/run.CjdgFZiW.js';
3
+ export { l as loadDiffConfig, a as loadSnapshotSerializers, s as setupCommonEnv, b as setupEnv } from './chunks/setup-common.CqAQCXzx.js';
4
4
  export { s as SpyModule } from './chunks/spy.DDMXghXv.js';
5
5
  export { f as format, i as inspect, s as stringify } from './chunks/display.BlTmubjj.js';
6
- export { g as getType } from './chunks/pathe.M-eThtNZ.Ba-7h1rE.js';
7
- export { D as DecodedMap, g as getOriginalPosition, a as getSafeTimers, s as setSafeTimers } from './chunks/source-map.DdKI5IHB.js';
8
- import './chunks/coverage.cTDc4uSS.js';
6
+ export { g as getType } from './chunks/pathe.M-eThtNZ.zq3TM4NT.js';
7
+ export { D as DecodedMap, g as getOriginalPosition, a as getSafeTimers, s as setSafeTimers } from './chunks/source-map.DakdQc29.js';
8
+ import './chunks/coverage.jGCktcGP.js';
9
9
  import './chunks/index.D0heQG4v.js';
10
10
  import './chunks/tinyrainbow.Do8I1XRG.js';
11
11
  import './task-utils.js';
@@ -1,22 +1,22 @@
1
1
  import { runInThisContext } from 'node:vm';
2
2
  import { s as spyModule } from './spy.DDMXghXv.js';
3
- import { r as resolveTestRunner, a as resolveSnapshotEnvironment, d as detectAsyncLeaks, s as setupChaiConfig } from './index.CoUIxZd4.js';
4
- import { l as loadEnvironment, e as emitModuleRunner, a as listenForErrors } from './init.PvxYpuCm.js';
5
- import { n as nativeImports, g as getEvaluatedImports, c as collectDependencies } from './module-dependencies.CwNPkcV4.js';
3
+ import { r as resolveTestRunner, a as resolveSnapshotEnvironment, d as detectAsyncLeaks, s as setupChaiConfig } from './index.w_oBZ9N8.js';
4
+ import { l as loadEnvironment, e as emitModuleRunner, a as listenForErrors } from './init.CO4AB7HZ.js';
5
+ import { n as nativeImports, g as getEvaluatedImports, c as collectDependencies } from './module-dependencies._2Eei3FO.js';
6
6
  import { Traces } from '../traces.js';
7
- import { V as VitestEvaluatedModules } from './rpc.DpkUyY1N.js';
8
- import { s as startVitestModuleRunner, c as createNodeImportMeta } from './index.CK-t0WMg.js';
7
+ import { V as VitestEvaluatedModules } from './rpc.Uhkwr2NM.js';
8
+ import { s as startVitestModuleRunner, c as createNodeImportMeta } from './index.Bi0NXYPf.js';
9
9
  import { performance as performance$1 } from 'node:perf_hooks';
10
- import { s as startCoverageInsideWorker, a as stopCoverageInsideWorker } from './coverage.-bm5IxnW.js';
11
- import { i as index, g as globalExpect, v as vi } from './index.aTZaPVhf.js';
10
+ import { s as startCoverageInsideWorker, a as stopCoverageInsideWorker } from './coverage.9iqXE2gN.js';
11
+ import { i as index, g as globalExpect, v as vi } from './index.CZzC1gGg.js';
12
12
  import { c as closeInspector } from './inspector.CvyFGlXm.js';
13
- import { s as startTests, p as publicCollect } from './run.BPv-BBRv.js';
14
- import { createRequire } from 'node:module';
13
+ import { s as startTests, p as publicCollect } from './run.CjdgFZiW.js';
14
+ import { createRequire, syncBuiltinESMExports } from 'node:module';
15
15
  import timers from 'node:timers';
16
16
  import timersPromises from 'node:timers/promises';
17
17
  import util from 'node:util';
18
- import { K as KNOWN_ASSET_TYPES } from './pathe.M-eThtNZ.Ba-7h1rE.js';
19
- import { s as setupCommonEnv, b as setupEnv } from './setup-common.HGAqWOnX.js';
18
+ import { K as KNOWN_ASSET_TYPES } from './pathe.M-eThtNZ.zq3TM4NT.js';
19
+ import { s as setupCommonEnv, b as setupEnv } from './setup-common.CqAQCXzx.js';
20
20
  import { g as getWorkerState, r as resetModules, p as provideWorkerState, a as getSafeWorkerState } from './utils.DYj33du9.js';
21
21
 
22
22
  // this should only be used in Node
@@ -47,7 +47,8 @@ async function setupGlobalEnv(config, environment) {
47
47
  globalThis.__vitest_required__ = {
48
48
  util,
49
49
  timers,
50
- timersPromises
50
+ timersPromises,
51
+ syncBuiltinESMExports
51
52
  };
52
53
  if (!config.disableConsoleIntercept) await setupConsoleLogSpy();
53
54
  }
@@ -58,7 +59,7 @@ function resolveAsset(mod, url) {
58
59
  mod.exports = url;
59
60
  }
60
61
  async function setupConsoleLogSpy() {
61
- const { createCustomConsole } = await import('./console.DtI4yxfN.js');
62
+ const { createCustomConsole } = await import('./console.CQZ877Hi.js');
62
63
  globalThis.console = createCustomConsole();
63
64
  }
64
65
 
@@ -127,7 +128,7 @@ async function startModuleRunner(options) {
127
128
  let mocker;
128
129
  if (options.state.config.experimental.nodeLoader !== false) {
129
130
  // this additionally imports acorn/magic-string
130
- const { NativeModuleMocker } = await import('./nativeModuleMocker.BxrHJNAF.js');
131
+ const { NativeModuleMocker } = await import('./nativeModuleMocker.Dh5azSB4.js');
131
132
  mocker = new NativeModuleMocker({
132
133
  async resolveId(id, importer) {
133
134
  // TODO: use import.meta.resolve instead
@@ -144,7 +145,7 @@ async function startModuleRunner(options) {
144
145
  }
145
146
  // imported lazily (pulls in `local-pkg`) so it stays out of the default
146
147
  // worker startup graph; only the `viteModuleRunner: false` path needs it
147
- const { NativeModuleRunner } = await import('./nativeModuleRunner.xi64Afb2.js').then(function (n) { return n.n; });
148
+ const { NativeModuleRunner } = await import('./nativeModuleRunner.9xPIMzi7.js').then(function (n) { return n.n; });
148
149
  _moduleRunner = new NativeModuleRunner(root, mocker);
149
150
  return _moduleRunner;
150
151
  }
@@ -164,7 +165,7 @@ function recordNativeImport(url, parentURL) {
164
165
  /** @experimental */
165
166
  async function setupBaseEnvironment(context) {
166
167
  if (context.config.experimental.viteModuleRunner === false) {
167
- const { setupNodeLoaderHooks } = await import('./native.cdzHIdmv.js');
168
+ const { setupNodeLoaderHooks } = await import('./native.upB-V0CK.js');
168
169
  const recordDependencies = context.config.experimental.recordDependencies;
169
170
  _canRecordDependencies = await setupNodeLoaderHooks(context, recordDependencies ? recordNativeImport : void 0);
170
171
  // until the tests start, the imports belong to the environment
@@ -211,11 +212,6 @@ async function runBaseTests(method, state, traces) {
211
212
  } catch (error) {
212
213
  throw new Error(`Failed to load custom "defines": ${error.message}`);
213
214
  }
214
- if (ctx.invalidates) ctx.invalidates.forEach((filepath) => {
215
- (state.evaluatedModules.fileToModulesMap.get(filepath) || []).forEach((module) => {
216
- state.evaluatedModules.invalidateModule(module);
217
- });
218
- });
219
215
  ctx.files.forEach((i) => {
220
216
  const filepath = i.filepath;
221
217
  (state.evaluatedModules.fileToModulesMap.get(filepath) || []).forEach((module) => {
@@ -1,6 +1,6 @@
1
- import { F as FileSpecification } from './config.d.QBNYCgFU.js';
2
- import { O as OTELCarrier } from './rpc.d.Cft1biqy.js';
3
- import { T as TestExecutionMethod } from './worker.d.BH-r1bPu.js';
1
+ import { F as FileSpecification } from './config.d.B3YV4t0O.js';
2
+ import { O as OTELCarrier } from './rpc.d.3FOhdFx8.js';
3
+ import { T as TestExecutionMethod } from './worker.d.CyJRpyfZ.js';
4
4
 
5
5
  interface ModuleDefinitionLocation {
6
6
  line: number;
@@ -48,6 +48,7 @@ type SerializedTestSpecification = [project: {
48
48
  pool: string;
49
49
  testLines?: number[] | undefined;
50
50
  testIds?: string[] | undefined;
51
+ testNames?: string[] | undefined;
51
52
  testNamePattern?: RegExp | undefined;
52
53
  testTagsFilter?: string[] | undefined;
53
54
  }];
@@ -1,8 +1,8 @@
1
- import { n as normalize, t as toArray } from './pathe.M-eThtNZ.Ba-7h1rE.js';
1
+ import { n as normalize, t as toArray } from './pathe.M-eThtNZ.zq3TM4NT.js';
2
2
  import { EventEmitter } from 'events';
3
3
  import { w } from './tinyrainbow.Do8I1XRG.js';
4
4
  import { i as isForceColor } from './env.BKKtU2WC.js';
5
- import { a as defaultPort, d as defaultBrowserPort } from './constants.-juJ8b_4.js';
5
+ import { a as defaultPort, d as defaultBrowserPort } from './constants.DLYM6cZY.js';
6
6
  import assert from 'node:assert';
7
7
  import { isAgent } from 'std-env';
8
8
 
@@ -620,7 +620,7 @@ class CAC extends EventEmitter {
620
620
 
621
621
  const cac = (name = "") => new CAC(name);
622
622
 
623
- var version = "5.0.5";
623
+ var version = "5.1.0";
624
624
 
625
625
  const apiConfig = (port) => ({
626
626
  port: {
@@ -882,6 +882,7 @@ const cliOptionsConfig = {
882
882
  },
883
883
  dependencySourcemaps: { description: "Serve sourcemaps of dependencies to the browser in headless runs, used by devtools when debugging into `node_modules`. Reported test errors are source-mapped either way. Use `--browser.dependencySourcemaps=false` to speed up test runs if you don't step into dependency code (default: `true`)" },
884
884
  trackUnhandledErrors: { description: "Control if Vitest catches uncaught exceptions so they can be reported (default: `true`)" },
885
+ importMapMocks: { description: "Serve module mocks through an import map instead of request interception. By default, enabled when the browser supports it" },
885
886
  trace: {
886
887
  description: "Enable trace view mode. Supported: \"on\", \"off\", \"on-first-retry\", \"on-all-retries\", \"retain-on-failure\".",
887
888
  argument: "<mode>",
@@ -891,13 +892,21 @@ const cliOptionsConfig = {
891
892
  }
892
893
  },
893
894
  traceView: {
894
- description: "Enable Vitest trace-view collection for browser tests (default: `false`)",
895
+ description: "Enable Vitest trace-view collection for browser tests. `true` records every test, and `false` turns it off (default: `\"failure-only\"`)",
895
896
  argument: "",
896
- transform: transformNestedBoolean,
897
+ transform(value) {
898
+ if (typeof value === "boolean") return { mode: value ? "on" : "off" };
899
+ return value;
900
+ },
897
901
  subcommands: {
898
- enabled: { description: "Enable Vitest trace-view collection for browser tests (default: `false`)" },
902
+ enabled: { description: "Deprecated, use `--browser.traceView.mode` instead. `true` is the same as `--browser.traceView.mode=on`" },
903
+ mode: {
904
+ description: "How trace view records tests. Supported: \"on\" (every test), \"failure-only\" (only failed tests), \"off\" (default: `\"failure-only\"`)",
905
+ argument: "<mode>"
906
+ },
899
907
  recordCanvas: { description: "Capture canvas pixels in trace-view snapshots (default: `false`)" },
900
- inlineImages: { description: "Inline loaded image pixels in trace-view snapshots (default: `false`)" }
908
+ inlineImages: { description: "Inline loaded image pixels in trace-view snapshots (default: `false`)" },
909
+ ariaSnapshot: { description: "Capture the accessibility tree in trace-view snapshots (default: `true`)" }
901
910
  }
902
911
  },
903
912
  orchestratorScripts: null,
@@ -961,6 +970,8 @@ const cliOptionsConfig = {
961
970
  description: "Run tests that are affected by the changed files (default: `false`)",
962
971
  argument: "[since]"
963
972
  },
973
+ sinceLastRun: { description: "Run only the tests whose recorded dependencies were modified since the last run of the test, and the tests that failed in their last run. Enables `--changed`, `--experimental.recordDependencies` and the `mtime` provider (default: `false`)" },
974
+ lastFailed: { description: "Run only the tests that failed in the last run (default: `false`)" },
964
975
  sequence: {
965
976
  description: "Options for how tests should be sorted",
966
977
  argument: "<options>",
@@ -1270,9 +1281,10 @@ const cliOptionsConfig = {
1270
1281
  },
1271
1282
  viteModuleRunner: { description: "Control whether Vitest uses Vite's module runner to run the code or fallback to the native `import`. (default: `true`)" },
1272
1283
  nodeLoader: { description: "Controls whether Vitest will use Node.js Loader API to process in-source or mocked files. This has no effect if `viteModuleRunner` is enabled. Disabling this can increase performance. (default: `true`)" },
1284
+ traceTimeline: { description: "Record `expect.poll`, `vi.waitFor`, and `vi.waitUntil` steps of each test and print them as a timeline when the test fails. This has no effect in browser mode. (default: `false`)" },
1273
1285
  vcsProvider: {
1274
1286
  argument: "<path>",
1275
- description: "Custom provider for detecting changed files. (default: `git`)",
1287
+ description: "Provider for detecting changed files: `git`, `mtime` (requires `experimental.recordDependencies`) or a path to a custom provider. (default: `git`)",
1276
1288
  subcommands: null
1277
1289
  },
1278
1290
  recordDependencies: { description: "Record the modules loaded by every test file in the cache and use the records with `--changed` and `--related` instead of the static module graph. A test file without a record always runs. (default: `false`)" },
@@ -1346,7 +1358,9 @@ const collectCliOptionsConfig = {
1346
1358
  changed: {
1347
1359
  description: "Print only tests that are affected by the changed files (default: `false`)",
1348
1360
  argument: "[since]"
1349
- }
1361
+ },
1362
+ sinceLastRun: { description: "Print only the tests whose recorded dependencies were modified since the last run of the test, and the tests that failed in their last run (default: `false`)" },
1363
+ lastFailed: { description: "Print only the tests that failed in the last run (default: `false`)" }
1350
1364
  };
1351
1365
 
1352
1366
  const a={ShellCompDirectiveError:1,ShellCompDirectiveNoSpace:2,ShellCompDirectiveNoFileComp:4,ShellCompDirectiveFilterFileExt:8,ShellCompDirectiveFilterDirs:16,ShellCompDirectiveKeepOrder:32,ShellCompDirectiveDefault:0};var o$1=class o{name;variadic;command;handler;constructor(e,t,n,r=false){this.command=e,this.name=t,this.handler=n,this.variadic=r;}},s$1=class s{value;description;command;handler;alias;isBoolean;constructor(e,t,n,r,i,a){this.command=e,this.value=t,this.description=n,this.handler=r,this.alias=i,this.isBoolean=a;}},c$1=class c{value;description;options=new Map;arguments=new Map;parent;constructor(e,t){this.value=e,this.description=t;}option(e,t,n,r){let i,a,o;typeof n==`function`?(i=n,a=r,o=false):typeof n==`string`?(i=void 0,a=n,o=true):(i=void 0,a=void 0,o=true);let c=new s$1(this,e,t,i,a,o);return this.options.set(e,c),this}argument(e,t,n=false){let r=new o$1(this,e,t,n);return this.arguments.set(e,r),this}},l$1=class l extends c$1{commands=new Map;completions=[];directive=a.ShellCompDirectiveDefault;constructor(){super(``,``);}command(e,t){let n=new c$1(e,t);return this.commands.set(e,n),n}stripOptions(e){let t=[],n=0;for(;n<e.length;){let r=e[n];if(r.startsWith(`-`)){n++;let t=false,i=this.findOption(this,r);if(i)t=i.isBoolean??false;else for(let[,e]of this.commands){let n=this.findOption(e,r);if(n){t=n.isBoolean??false;break}}!t&&n<e.length&&!e[n].startsWith(`-`)&&n++;}else t.push(r),n++;}return t}matchCommand(e){e=this.stripOptions(e);let t=[],n=[],r=null;for(let i=0;i<e.length;i++){let a=e[i];t.push(a);let o=this.commands.get(t.join(` `));if(o)r=o;else {n=e.slice(i,e.length);break}}return [r||this,n]}shouldCompleteFlags(e,t){if(t.startsWith(`-`))return true;if(e?.startsWith(`-`)){let t=this.findOption(this,e);if(!t){for(let[,n]of this.commands)if(t=this.findOption(n,e),t)break}return !(t&&t.isBoolean)}return false}shouldCompleteCommands(e){return !e.startsWith(`-`)}handleFlagCompletion(e,t,n,r){let i;if(n.includes(`=`)){let[e]=n.split(`=`);i=e;}else if(r?.startsWith(`-`)){let t=this.findOption(e,r);t&&!t.isBoolean&&(i=r);}if(i){let t=this.findOption(e,i);if(t?.handler){let n=[];t.handler.call(t,(e,t)=>n.push({value:e,description:t}),e.options),this.completions=n;}return}if(n.startsWith(`-`)){let t=n.startsWith(`-`)&&!n.startsWith(`--`),r=n.replace(/^-+/,``);for(let[i,a]of e.options)t&&a.alias&&`-${a.alias}`.startsWith(n)?this.completions.push({value:`-${a.alias}`,description:a.description}):!t&&i.startsWith(r)&&this.completions.push({value:`--${i}`,description:a.description});}}findOption(e,t){let n=e.options.get(t);if(n||(n=e.options.get(t.replace(/^-+/,``)),n))return n;for(let[n,r]of e.options)if(r.alias&&`-${r.alias}`===t)return r}handleCommandCompletion(e,t){let n=this.stripOptions(e);for(let[e,r]of this.commands){if(e===``)continue;let i=e.split(` `);i.slice(0,n.length).every((e,t)=>e===n[t])&&i[n.length]?.startsWith(t)&&this.completions.push({value:i[n.length],description:r.description});}}handlePositionalCompletion(e,t){let n=this.stripOptions(t),r=e.value.split(` `).length,i=Math.max(0,n.length-r),a=Array.from(e.arguments.entries());if(a.length>0){let t;if(i<a.length){let[e,n]=a[i];t=n;}else {let e=a[a.length-1][1];e.variadic&&(t=e);}if(t&&t.handler&&typeof t.handler==`function`){let n=[];t.handler.call(t,(e,t)=>n.push({value:e,description:t}),e.options),this.completions.push(...n);}}}complete(e){this.directive=a.ShellCompDirectiveNoFileComp;let t=new Set;this.completions.filter(e=>t.has(e.value)?false:(t.add(e.value),true)).filter(t=>{if(e.includes(`=`)){let[,n]=e.split(`=`);return t.value.startsWith(n)}return t.value.startsWith(e)}).forEach(e=>console.log(`${e.value}\t${e.description??``}`)),console.log(`:${this.directive}`);}parse(e){this.completions=[];let t=e[e.length-1]===``;t&&e.pop();let n=e[e.length-1]||``,r=e.slice(0,-1);t&&(n!==``&&r.push(n),n=``);let[i]=this.matchCommand(r),a=r[r.length-1];this.shouldCompleteFlags(a,n)?this.handleFlagCompletion(i,r,n,a):(this.shouldCompleteCommands(n)&&this.handleCommandCompletion(r,n),i&&i.arguments.size>0&&this.handlePositionalCompletion(i,r)),this.complete(n);}setup(a,o,s){switch(assert(s===`zsh`||s===`bash`||s===`fish`||s===`powershell`,`Unsupported shell`),s){case `zsh`:{let t$1=t(a,o);console.log(t$1);break}case `bash`:{let e=n(a,o);console.log(e);break}case `fish`:{let e=r(a,o);console.log(e);break}case `powershell`:{let e=i(a,o);console.log(e);break}}}};const u=new l$1;
@@ -2364,11 +2378,11 @@ function normalizeCliOptions(cliFilters, argv) {
2364
2378
  }
2365
2379
  async function start(cliFilters, options) {
2366
2380
  try {
2367
- const { startVitest } = await import('./cli-api.De07GUeT.js').then(function (n) { return n.g; });
2381
+ const { startVitest } = await import('./cli-api.COfZo8lK.js').then(function (n) { return n.j; });
2368
2382
  const ctx = await startVitest(cliFilters.map(normalize), normalizeCliOptions(cliFilters, options));
2369
2383
  if (!ctx.shouldKeepServer()) await ctx.exit();
2370
2384
  } catch (e) {
2371
- const { errorBanner } = await import('./utils.DSfl_w8V.js').then(function (n) { return n.u; });
2385
+ const { errorBanner } = await import('./utils.BBk_icFG.js').then(function (n) { return n.u; });
2372
2386
  console.error(`\n${errorBanner("Startup Error")}`);
2373
2387
  console.error(e);
2374
2388
  console.error("\n\n");
@@ -2378,11 +2392,11 @@ async function start(cliFilters, options) {
2378
2392
  }
2379
2393
  async function doctorCommand(cliFilters, options) {
2380
2394
  try {
2381
- const { doctor } = await import('./doctor.BK86Cncq.js');
2395
+ const { doctor } = await import('./doctor.B-oPbwps.js');
2382
2396
  await doctor(cliFilters.map(normalize), normalizeCliOptions(cliFilters, options));
2383
2397
  process.exit();
2384
2398
  } catch (e) {
2385
- const { errorBanner } = await import('./utils.DSfl_w8V.js').then(function (n) { return n.u; });
2399
+ const { errorBanner } = await import('./utils.BBk_icFG.js').then(function (n) { return n.u; });
2386
2400
  console.error(`\n${errorBanner("Doctor Error")}`);
2387
2401
  console.error(e);
2388
2402
  console.error("\n\n");
@@ -2395,12 +2409,12 @@ async function init(project) {
2395
2409
  console.error(/* @__PURE__ */ new Error("Only the \"browser\" project is supported. Use \"vitest init browser\" to create a new project."));
2396
2410
  process.exit(1);
2397
2411
  }
2398
- const { create } = await import('./creator.C5g4egeG.js');
2412
+ const { create } = await import('./creator.DHWmytIK.js');
2399
2413
  await create();
2400
2414
  }
2401
2415
  async function collect(cliFilters, options) {
2402
2416
  try {
2403
- const { prepareVitest, processCollected, outputFileList } = await import('./cli-api.De07GUeT.js').then(function (n) { return n.g; });
2417
+ const { prepareVitest, processCollected, outputFileList } = await import('./cli-api.COfZo8lK.js').then(function (n) { return n.j; });
2404
2418
  const ctx = await prepareVitest({
2405
2419
  ...normalizeCliOptions(cliFilters, options),
2406
2420
  watch: false,
@@ -2422,7 +2436,7 @@ async function collect(cliFilters, options) {
2422
2436
  } else outputFileList(await ctx.getRelevantTestSpecifications(cliFilters.map(normalize)), options);
2423
2437
  await ctx.close();
2424
2438
  } catch (e) {
2425
- const { errorBanner } = await import('./utils.DSfl_w8V.js').then(function (n) { return n.u; });
2439
+ const { errorBanner } = await import('./utils.BBk_icFG.js').then(function (n) { return n.u; });
2426
2440
  console.error(`\n${errorBanner("Collect Error")}`);
2427
2441
  console.error(e);
2428
2442
  console.error("\n\n");