vitest 1.6.0 → 2.0.0-beta.10

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 (74) hide show
  1. package/LICENSE.md +173 -1
  2. package/dist/browser.d.ts +22 -2
  3. package/dist/browser.js +6 -4
  4. package/dist/chunks/{environments-node.vcoXCoKs.js → environments-node.39w4gmlF.js} +2 -2
  5. package/dist/chunks/{install-pkg.LE8oaA1t.js → install-pkg.DNUmWFkO.js} +2 -2
  6. package/dist/chunks/integrations-globals.C6Ah-pUW.js +31 -0
  7. package/dist/chunks/{runtime-console.EO5ha7qv.js → runtime-console.DiVMr5d4.js} +62 -32
  8. package/dist/chunks/{runtime-runBaseTests.oAvMKtQC.js → runtime-runBaseTests.Cukyr5-I.js} +18 -18
  9. package/dist/cli.js +3 -3
  10. package/dist/config.cjs +4 -5
  11. package/dist/config.d.ts +2 -2
  12. package/dist/config.js +4 -5
  13. package/dist/coverage.d.ts +1 -1
  14. package/dist/coverage.js +34 -8
  15. package/dist/environments.d.ts +1 -1
  16. package/dist/environments.js +1 -1
  17. package/dist/execute.d.ts +3 -2
  18. package/dist/execute.js +2 -2
  19. package/dist/index.d.ts +777 -65
  20. package/dist/index.js +12 -12
  21. package/dist/node.d.ts +7 -7
  22. package/dist/node.js +24 -23
  23. package/dist/{reporters-yx5ZTtEV.d.ts → reporters-CYVC6LOl.d.ts} +439 -219
  24. package/dist/reporters.d.ts +1 -1
  25. package/dist/reporters.js +11 -12
  26. package/dist/runners.d.ts +4 -2
  27. package/dist/runners.js +25 -18
  28. package/dist/snapshot.js +3 -3
  29. package/dist/{suite-IbNSsUWN.d.ts → suite-Dpu9EC_k.d.ts} +1 -1
  30. package/dist/suite.d.ts +2 -2
  31. package/dist/suite.js +4 -4
  32. package/dist/vendor/{base.Ybri3C14.js → base.Dln9yllP.js} +3 -3
  33. package/dist/vendor/{base.5NT-gWu5.js → base._gnK9Slw.js} +1 -2
  34. package/dist/vendor/{benchmark.yGkUTKnC.js → benchmark.BNLebNi5.js} +1 -1
  35. package/dist/vendor/{cac.EdDItJD-.js → cac.CtYFkoSJ.js} +66 -25
  36. package/dist/vendor/{cli-api.E07AF1Yq.js → cli-api.CUtJc4r3.js} +11851 -7276
  37. package/dist/vendor/{constants.5J7I254_.js → constants.TCjCaw2D.js} +4 -3
  38. package/dist/vendor/{execute.fL3szUAI.js → execute.BHj6OMh4.js} +4 -4
  39. package/dist/vendor/{index.DpVgvm2P.js → index.B5SKBLvV.js} +5 -5
  40. package/dist/vendor/{index.Q04MCqDO.js → index.BOMEjpjj.js} +680 -160
  41. package/dist/vendor/{index.8bPxjt7g.js → index.BpSiYbpB.js} +5 -1
  42. package/dist/vendor/{index.xL8XjTLv.js → index.CThipSqB.js} +2538 -2525
  43. package/dist/vendor/{index.dI9lHwVn.js → index.D3hs2WiI.js} +8 -6
  44. package/dist/vendor/{index.SMVOaj7F.js → index._7XLd8Kd.js} +2 -2
  45. package/dist/vendor/{index.GVFv9dZ0.js → index.kpsSqFiz.js} +2 -1
  46. package/dist/vendor/{rpc.joBhAkyK.js → rpc.DRDE9Pu1.js} +2 -2
  47. package/dist/vendor/{run-once.Olz_Zkd8.js → run-once.DLomgGUH.js} +1 -1
  48. package/dist/vendor/{setup-common.8nJLd4ay.js → setup-common.DAu7t7mY.js} +2 -2
  49. package/dist/vendor/spy.Cf_4R5Oe.js +22 -0
  50. package/dist/vendor/{tasks.IknbGB2n.js → tasks.WC7M-K-v.js} +4 -1
  51. package/dist/vendor/{utils.dEtNIEgr.js → utils.YuQ3LT2a.js} +2 -2
  52. package/dist/vendor/{vi.YFlodzP_.js → vi.hATFzZbX.js} +124 -56
  53. package/dist/vendor/{vm.QEE48c0T.js → vm.Ow-X2mkS.js} +47 -59
  54. package/dist/worker.js +6 -6
  55. package/dist/workers/forks.js +5 -5
  56. package/dist/workers/runVmTests.js +17 -17
  57. package/dist/workers/threads.js +5 -5
  58. package/dist/workers/vmForks.js +8 -8
  59. package/dist/workers/vmThreads.js +8 -8
  60. package/dist/workers.d.ts +1 -1
  61. package/dist/workers.js +13 -13
  62. package/package.json +35 -35
  63. package/suppress-warnings.cjs +2 -1
  64. package/vitest.mjs +1 -1
  65. package/dist/chunks/integrations-globals.kw4co3rx.js +0 -31
  66. package/dist/cli-wrapper.js +0 -119
  67. /package/dist/chunks/{node-git.Hw101KjS.js → node-git.CCI8evVZ.js} +0 -0
  68. /package/dist/vendor/{_commonjsHelpers.jjO7Zipk.js → _commonjsHelpers.BFTU3MAI.js} +0 -0
  69. /package/dist/vendor/{coverage.E7sG1b3r.js → coverage.ChSqD-qS.js} +0 -0
  70. /package/dist/vendor/{date.Ns1pGd_X.js → date.BKM1wewY.js} +0 -0
  71. /package/dist/vendor/{env.AtSIuHFg.js → env.bmJgw1qP.js} +0 -0
  72. /package/dist/vendor/{global.CkGT_TMy.js → global.7bFbnyXl.js} +0 -0
  73. /package/dist/vendor/{inspector.IgLX3ur5.js → inspector.hPQncR7V.js} +0 -0
  74. /package/dist/vendor/{utils.0uYuCbzo.js → utils.CUjzkRH7.js} +0 -0
@@ -1,4 +1,4 @@
1
- export { aS as BaseReporter, aJ as BasicReporter, a_ as BenchmarkBuiltinReporters, aZ as BenchmarkReportsMap, aV as BuiltinReporterOptions, aU as BuiltinReporters, aI as DefaultReporter, aK as DotReporter, aR as GithubActionsReporter, aQ as HangingProcessReporter, aO as JUnitReporter, aW as JsonAssertionResult, aL as JsonReporter, aX as JsonTestResult, aY as JsonTestResults, v as Reporter, aT as ReportersMap, aP as TapFlatReporter, aN as TapReporter, aM as VerboseReporter } from './reporters-yx5ZTtEV.js';
1
+ export { b4 as BaseReporter, aX as BasicReporter, bc as BenchmarkBuiltinReporters, bb as BenchmarkReportsMap, b7 as BuiltinReporterOptions, b6 as BuiltinReporters, aW as DefaultReporter, aY as DotReporter, b3 as GithubActionsReporter, b2 as HangingProcessReporter, b0 as JUnitReporter, b8 as JsonAssertionResult, aZ as JsonReporter, b9 as JsonTestResult, ba as JsonTestResults, N as Reporter, b5 as ReportersMap, b1 as TapFlatReporter, a$ as TapReporter, a_ as VerboseReporter } from './reporters-CYVC6LOl.js';
2
2
  import 'vite';
3
3
  import '@vitest/runner';
4
4
  import 'vite-node';
package/dist/reporters.js CHANGED
@@ -1,23 +1,23 @@
1
- export { a as BasicReporter, e as BenchmarkReportsMap, D as DefaultReporter, b as DotReporter, G as GithubActionsReporter, H as HangingProcessReporter, c as JUnitReporter, J as JsonReporter, R as ReportersMap, d as TapFlatReporter, T as TapReporter, V as VerboseReporter } from './vendor/index.Q04MCqDO.js';
1
+ export { a as BasicReporter, e as BenchmarkReportsMap, D as DefaultReporter, b as DotReporter, G as GithubActionsReporter, H as HangingProcessReporter, c as JUnitReporter, J as JsonReporter, R as ReportersMap, d as TapFlatReporter, T as TapReporter, V as VerboseReporter } from './vendor/index.BOMEjpjj.js';
2
2
  import 'node:fs';
3
3
  import 'picocolors';
4
4
  import 'pathe';
5
- import './vendor/tasks.IknbGB2n.js';
5
+ import './vendor/tasks.WC7M-K-v.js';
6
6
  import '@vitest/runner/utils';
7
7
  import '@vitest/utils';
8
- import './vendor/env.AtSIuHFg.js';
8
+ import './vendor/env.bmJgw1qP.js';
9
9
  import 'std-env';
10
- import './vendor/utils.dEtNIEgr.js';
11
- import './vendor/base.5NT-gWu5.js';
10
+ import './vendor/utils.YuQ3LT2a.js';
11
+ import './vendor/base._gnK9Slw.js';
12
12
  import 'node:perf_hooks';
13
- import './vendor/index.SMVOaj7F.js';
14
- import './vendor/global.CkGT_TMy.js';
15
- import './chunks/runtime-console.EO5ha7qv.js';
13
+ import '@vitest/utils/source-map';
14
+ import './vendor/index._7XLd8Kd.js';
15
+ import './vendor/global.7bFbnyXl.js';
16
+ import './chunks/runtime-console.DiVMr5d4.js';
16
17
  import 'node:stream';
17
18
  import 'node:console';
18
19
  import 'node:path';
19
- import './vendor/date.Ns1pGd_X.js';
20
- import '@vitest/utils/source-map';
20
+ import './vendor/date.BKM1wewY.js';
21
21
  import 'node:os';
22
22
  import 'node:fs/promises';
23
23
  import 'execa';
@@ -26,9 +26,8 @@ import 'path';
26
26
  import 'fs';
27
27
  import 'module';
28
28
  import 'vite';
29
- import 'acorn-walk';
30
29
  import 'node:process';
31
- import './vendor/_commonjsHelpers.jjO7Zipk.js';
30
+ import './vendor/_commonjsHelpers.BFTU3MAI.js';
32
31
  import 'assert';
33
32
  import 'events';
34
33
  import 'node:crypto';
package/dist/runners.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { VitestRunner, VitestRunnerImportSource, Suite, Task, CancelReason, Test, Custom, TaskContext, ExtendedContext } from '@vitest/runner';
2
- import { R as ResolvedConfig } from './reporters-yx5ZTtEV.js';
1
+ import { VitestRunner, VitestRunnerImportSource, File, Suite, Task, CancelReason, Test, Custom, TaskContext, ExtendedContext } from '@vitest/runner';
2
+ import { R as ResolvedConfig } from './reporters-CYVC6LOl.js';
3
3
  import * as tinybench from 'tinybench';
4
4
  import 'vite';
5
5
  import 'vite-node';
@@ -21,8 +21,10 @@ declare class VitestTestRunner implements VitestRunner {
21
21
  private workerState;
22
22
  private __vitest_executor;
23
23
  private cancelRun;
24
+ private assertionsErrors;
24
25
  constructor(config: ResolvedConfig);
25
26
  importFile(filepath: string, source: VitestRunnerImportSource): unknown;
27
+ onCollectStart(file: File): void;
26
28
  onBeforeRunFiles(): void;
27
29
  onAfterRunFiles(): void;
28
30
  onAfterRunSuite(suite: Suite): Promise<void>;
package/dist/runners.js CHANGED
@@ -1,25 +1,25 @@
1
1
  import { setState, GLOBAL_EXPECT, getState } from '@vitest/expect';
2
- import { g as getSnapshotClient, c as createExpect, v as vi } from './vendor/vi.YFlodzP_.js';
2
+ import { g as getSnapshotClient, c as createExpect, v as vi } from './vendor/vi.hATFzZbX.js';
3
3
  import 'pathe';
4
- import { g as getFullName } from './vendor/tasks.IknbGB2n.js';
4
+ import { g as getTestName } from './vendor/tasks.WC7M-K-v.js';
5
5
  import { createDefer, getSafeTimers } from '@vitest/utils';
6
- import { g as getWorkerState } from './vendor/global.CkGT_TMy.js';
7
- import './vendor/env.AtSIuHFg.js';
8
- import { r as rpc } from './vendor/rpc.joBhAkyK.js';
6
+ import { g as getWorkerState } from './vendor/global.7bFbnyXl.js';
7
+ import './vendor/env.bmJgw1qP.js';
8
+ import { r as rpc } from './vendor/rpc.DRDE9Pu1.js';
9
9
  import { getTests, getNames } from '@vitest/runner/utils';
10
10
  import { updateTask } from '@vitest/runner';
11
- import { a as getBenchOptions, g as getBenchFn } from './vendor/benchmark.yGkUTKnC.js';
11
+ import { a as getBenchOptions, g as getBenchFn } from './vendor/benchmark.BNLebNi5.js';
12
12
  import 'chai';
13
- import './vendor/_commonjsHelpers.jjO7Zipk.js';
13
+ import './vendor/_commonjsHelpers.BFTU3MAI.js';
14
14
  import '@vitest/snapshot';
15
15
  import '@vitest/utils/error';
16
16
  import '@vitest/utils/source-map';
17
- import './vendor/base.5NT-gWu5.js';
18
- import './vendor/date.Ns1pGd_X.js';
17
+ import './vendor/base._gnK9Slw.js';
18
+ import './vendor/date.BKM1wewY.js';
19
19
  import '@vitest/spy';
20
20
  import 'std-env';
21
- import './vendor/index.8bPxjt7g.js';
22
- import './vendor/index.SMVOaj7F.js';
21
+ import './vendor/index.BpSiYbpB.js';
22
+ import './vendor/index._7XLd8Kd.js';
23
23
 
24
24
  class VitestTestRunner {
25
25
  constructor(config) {
@@ -29,11 +29,15 @@ class VitestTestRunner {
29
29
  workerState = getWorkerState();
30
30
  __vitest_executor;
31
31
  cancelRun = false;
32
+ assertionsErrors = /* @__PURE__ */ new WeakMap();
32
33
  importFile(filepath, source) {
33
34
  if (source === "setup")
34
35
  this.workerState.moduleCache.delete(filepath);
35
36
  return this.__vitest_executor.executeId(filepath);
36
37
  }
38
+ onCollectStart(file) {
39
+ this.workerState.current = file;
40
+ }
37
41
  onBeforeRunFiles() {
38
42
  this.snapshotClient.clear();
39
43
  }
@@ -43,7 +47,7 @@ class VitestTestRunner {
43
47
  async onAfterRunSuite(suite) {
44
48
  if (this.config.logHeapUsage && typeof process !== "undefined")
45
49
  suite.result.heap = process.memoryUsage().heapUsed;
46
- if (suite.mode !== "skip" && typeof suite.filepath !== "undefined") {
50
+ if (suite.mode !== "skip" && "filepath" in suite) {
47
51
  for (const test of getTests(suite)) {
48
52
  if (test.mode === "skip") {
49
53
  const name = getNames(test).slice(1).join(" > ");
@@ -54,13 +58,13 @@ class VitestTestRunner {
54
58
  if (result)
55
59
  await rpc().snapshotSaved(result);
56
60
  }
57
- this.workerState.current = suite.suite;
61
+ this.workerState.current = suite.suite || suite.file;
58
62
  }
59
63
  onAfterRunTask(test) {
60
64
  this.snapshotClient.clearTest();
61
65
  if (this.config.logHeapUsage && typeof process !== "undefined")
62
66
  test.result.heap = process.memoryUsage().heapUsed;
63
- this.workerState.current = test.suite;
67
+ this.workerState.current = test.suite || test.file;
64
68
  }
65
69
  onCancel(_reason) {
66
70
  this.cancelRun = true;
@@ -76,21 +80,20 @@ class VitestTestRunner {
76
80
  async onBeforeRunSuite(suite) {
77
81
  if (this.cancelRun)
78
82
  suite.mode = "skip";
79
- if (suite.mode !== "skip" && typeof suite.filepath !== "undefined") {
83
+ if (suite.mode !== "skip" && "filepath" in suite) {
80
84
  await this.snapshotClient.startCurrentRun(suite.filepath, "__default_name_", this.workerState.config.snapshotOptions);
81
85
  }
82
86
  this.workerState.current = suite;
83
87
  }
84
88
  onBeforeTryTask(test) {
85
- var _a, _b;
86
89
  setState({
87
90
  assertionCalls: 0,
88
91
  isExpectingAssertions: false,
89
92
  isExpectingAssertionsError: null,
90
93
  expectedAssertionsNumber: null,
91
94
  expectedAssertionsNumberErrorGen: null,
92
- testPath: (_b = (_a = test.suite) == null ? void 0 : _a.file) == null ? void 0 : _b.filepath,
93
- currentTestName: getFullName(test),
95
+ testPath: test.file.filepath,
96
+ currentTestName: getTestName(test),
94
97
  snapshotState: this.snapshotClient.snapshotState
95
98
  }, globalThis[GLOBAL_EXPECT]);
96
99
  }
@@ -107,8 +110,12 @@ class VitestTestRunner {
107
110
  throw expectedAssertionsNumberErrorGen();
108
111
  if (isExpectingAssertions === true && assertionCalls === 0)
109
112
  throw isExpectingAssertionsError;
113
+ if (this.config.expect.requireAssertions && assertionCalls === 0)
114
+ throw this.assertionsErrors.get(test);
110
115
  }
111
116
  extendTaskContext(context) {
117
+ if (this.config.expect.requireAssertions)
118
+ this.assertionsErrors.set(context.task, new Error("expected any number of assertion, but got none"));
112
119
  let _expect;
113
120
  Object.defineProperty(context, "expect", {
114
121
  get() {
package/dist/snapshot.js CHANGED
@@ -1,8 +1,8 @@
1
- export { VitestNodeSnapshotEnvironment as VitestSnapshotEnvironment } from './chunks/environments-node.vcoXCoKs.js';
1
+ export { VitestNodeSnapshotEnvironment as VitestSnapshotEnvironment } from './chunks/environments-node.39w4gmlF.js';
2
2
  import '@vitest/snapshot/environment';
3
3
  import 'pathe';
4
4
  import '@vitest/runner/utils';
5
5
  import '@vitest/utils';
6
- import './vendor/global.CkGT_TMy.js';
7
- import './vendor/env.AtSIuHFg.js';
6
+ import './vendor/global.7bFbnyXl.js';
7
+ import './vendor/env.bmJgw1qP.js';
8
8
  import 'std-env';
@@ -1,6 +1,6 @@
1
1
  import { Custom } from '@vitest/runner';
2
2
  import '@vitest/runner/utils';
3
- import { ap as BenchFunction, aq as BenchmarkAPI } from './reporters-yx5ZTtEV.js';
3
+ import { ag as BenchFunction, ah as BenchmarkAPI } from './reporters-CYVC6LOl.js';
4
4
  import { Options } from 'tinybench';
5
5
 
6
6
  declare function getBenchOptions(key: Custom): Options;
package/dist/suite.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  export { createTaskCollector, getCurrentSuite, getCurrentTest, getFn, getHooks, setFn, setHooks } from '@vitest/runner';
2
2
  export { createChainable } from '@vitest/runner/utils';
3
- export { g as getBenchFn, a as getBenchOptions } from './suite-IbNSsUWN.js';
4
- import './reporters-yx5ZTtEV.js';
3
+ export { g as getBenchFn, a as getBenchOptions } from './suite-Dpu9EC_k.js';
4
+ import './reporters-CYVC6LOl.js';
5
5
  import 'vite';
6
6
  import 'vite-node';
7
7
  import '@vitest/snapshot';
package/dist/suite.js CHANGED
@@ -1,9 +1,9 @@
1
1
  export { createTaskCollector, getCurrentSuite, getCurrentTest, getFn, getHooks, setFn, setHooks } from '@vitest/runner';
2
2
  export { createChainable } from '@vitest/runner/utils';
3
- export { g as getBenchFn, a as getBenchOptions } from './vendor/benchmark.yGkUTKnC.js';
3
+ export { g as getBenchFn, a as getBenchOptions } from './vendor/benchmark.BNLebNi5.js';
4
4
  import '@vitest/utils';
5
- import './vendor/index.SMVOaj7F.js';
5
+ import './vendor/index._7XLd8Kd.js';
6
6
  import 'pathe';
7
- import './vendor/global.CkGT_TMy.js';
8
- import './vendor/env.AtSIuHFg.js';
7
+ import './vendor/global.7bFbnyXl.js';
8
+ import './vendor/env.bmJgw1qP.js';
9
9
  import 'std-env';
@@ -1,6 +1,6 @@
1
1
  import { ModuleCacheMap } from 'vite-node/client';
2
- import { p as provideWorkerState } from './global.CkGT_TMy.js';
3
- import { g as getDefaultRequestStubs, s as startVitestExecutor } from './execute.fL3szUAI.js';
2
+ import { p as provideWorkerState } from './global.7bFbnyXl.js';
3
+ import { g as getDefaultRequestStubs, s as startVitestExecutor } from './execute.BHj6OMh4.js';
4
4
 
5
5
  let _viteNode;
6
6
  const moduleCache = new ModuleCacheMap();
@@ -25,7 +25,7 @@ async function runBaseTests(state) {
25
25
  ctx.files.forEach((i) => state.moduleCache.delete(i));
26
26
  const [executor, { run }] = await Promise.all([
27
27
  startViteNode({ state, requestStubs: getDefaultRequestStubs() }),
28
- import('../chunks/runtime-runBaseTests.oAvMKtQC.js')
28
+ import('../chunks/runtime-runBaseTests.Cukyr5-I.js')
29
29
  ]);
30
30
  await run(
31
31
  ctx.files,
@@ -111,8 +111,7 @@ const urlAlphabet = "useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwy
111
111
  function nanoid(size = 21) {
112
112
  let id = "";
113
113
  let i = size;
114
- while (i--)
115
- id += urlAlphabet[Math.random() * 64 | 0];
114
+ while (i--) id += urlAlphabet[Math.random() * 64 | 0];
116
115
  return id;
117
116
  }
118
117
 
@@ -1,7 +1,7 @@
1
1
  import { getCurrentSuite } from '@vitest/runner';
2
2
  import { createChainable } from '@vitest/runner/utils';
3
3
  import { noop } from '@vitest/utils';
4
- import { i as isRunningInBenchmark } from './index.SMVOaj7F.js';
4
+ import { i as isRunningInBenchmark } from './index._7XLd8Kd.js';
5
5
 
6
6
  const benchFns = /* @__PURE__ */ new WeakMap();
7
7
  const benchOptsMap = /* @__PURE__ */ new WeakMap();
@@ -1,8 +1,8 @@
1
1
  import { normalize } from 'pathe';
2
2
  import { EventEmitter } from 'events';
3
3
  import c from 'picocolors';
4
- import { t as toArray } from './base.5NT-gWu5.js';
5
- import { d as defaultPort, a as defaultBrowserPort } from './constants.5J7I254_.js';
4
+ import { t as toArray } from './base._gnK9Slw.js';
5
+ import { d as defaultPort, a as defaultBrowserPort } from './constants.TCjCaw2D.js';
6
6
 
7
7
  function toArr(any) {
8
8
  return any == null ? [] : Array.isArray(any) ? any : [any];
@@ -618,7 +618,7 @@ class CAC extends EventEmitter {
618
618
 
619
619
  const cac = (name = "") => new CAC(name);
620
620
 
621
- var version = "1.6.0";
621
+ var version = "2.0.0-beta.10";
622
622
 
623
623
  const apiConfig = (port) => ({
624
624
  port: {
@@ -925,7 +925,7 @@ const cliOptionsConfig = {
925
925
  subcommands: apiConfig(defaultBrowserPort)
926
926
  },
927
927
  provider: {
928
- description: 'Provider used to run browser tests. Some browsers are only available for specific providers. Can be "webdriverio", "playwright", or the path to a custom provider. Visit [`browser.provider`](https://vitest.dev/config/#browser-provider) for more information (default: `"webdriverio"`)',
928
+ description: 'Provider used to run browser tests. Some browsers are only available for specific providers. Can be "webdriverio", "playwright", "preview", or the path to a custom provider. Visit [`browser.provider`](https://vitest.dev/config/#browser-provider) for more information (default: `"preview"`)',
929
929
  argument: "<name>",
930
930
  subcommands: null
931
931
  // don't support custom objects
@@ -936,17 +936,20 @@ const cliOptionsConfig = {
936
936
  subcommands: null
937
937
  // don't support custom objects
938
938
  },
939
- slowHijackESM: {
940
- description: "Let Vitest use its own module resolution on the browser to enable APIs such as vi.mock and vi.spyOn. Visit [`browser.slowHijackESM`](https://vitest.dev/config/#browser-slowhijackesm) for more information (default: `false`)"
941
- },
942
939
  isolate: {
943
940
  description: "Run every browser test file in isolation. To disable isolation, use `--browser.isolate=false` (default: `true`)"
944
941
  },
942
+ ui: {
943
+ description: "Show Vitest UI when running tests (default: `!process.env.CI`)"
944
+ },
945
945
  fileParallelism: {
946
- description: "Should all test files run in parallel. Use `--browser.file-parallelism=false` to disable (default: same as `--file-parallelism`)"
946
+ description: "Should browser test files run in parallel. Use `--browser.fileParallelism=false` to disable (default: `true`)"
947
947
  },
948
- indexScripts: null,
949
- testerScripts: null
948
+ orchestratorScripts: null,
949
+ testerScripts: null,
950
+ commands: null,
951
+ viewport: null,
952
+ screenshotDirectory: null
950
953
  }
951
954
  },
952
955
  pool: {
@@ -1044,7 +1047,7 @@ const cliOptionsConfig = {
1044
1047
  description: "Run files in a random order. Long running tests will not start earlier if you enable this option. (default: `false`)"
1045
1048
  },
1046
1049
  tests: {
1047
- description: "Run tests in a random oder (default: `false`)"
1050
+ description: "Run tests in a random order (default: `false`)"
1048
1051
  }
1049
1052
  }
1050
1053
  },
@@ -1111,7 +1114,8 @@ const cliOptionsConfig = {
1111
1114
  },
1112
1115
  exclude: {
1113
1116
  description: "Additional file globs to be excluded from test",
1114
- argument: "<glob>"
1117
+ argument: "<glob>",
1118
+ array: true
1115
1119
  },
1116
1120
  expandSnapshotDiff: {
1117
1121
  description: "Show full diff when snapshot fails"
@@ -1132,7 +1136,7 @@ const cliOptionsConfig = {
1132
1136
  description: "Run only typecheck tests. This automatically enables typecheck (default: `false`)"
1133
1137
  },
1134
1138
  checker: {
1135
- description: 'Specify the typechecker to use. Available values are: "tcs" and "vue-tsc" and a path to an executable (default: `"tsc"`)',
1139
+ description: 'Specify the typechecker to use. Available values are: "tsc" and "vue-tsc" and a path to an executable (default: `"tsc"`)',
1136
1140
  argument: "<name>",
1137
1141
  subcommands: null
1138
1142
  },
@@ -1185,15 +1189,47 @@ const cliOptionsConfig = {
1185
1189
  description: "Maximum number of concurrent tests in a suite (default: `5`)",
1186
1190
  argument: "<number>"
1187
1191
  },
1192
+ expect: {
1193
+ description: "Configuration options for `expect()` matches",
1194
+ argument: "",
1195
+ // no displayed
1196
+ subcommands: {
1197
+ requireAssertions: {
1198
+ description: "Require that all tests have at least one assertion"
1199
+ },
1200
+ poll: {
1201
+ description: "Default options for `expect.poll()`",
1202
+ argument: "",
1203
+ subcommands: {
1204
+ interval: {
1205
+ description: "Poll interval in milliseconds for `expect.poll()` assertions (default: `50`)",
1206
+ argument: "<interval>"
1207
+ },
1208
+ timeout: {
1209
+ description: "Poll timeout in milliseconds for `expect.poll()` assertions (default: `1000`)",
1210
+ argument: "<timeout>"
1211
+ }
1212
+ },
1213
+ transform(value) {
1214
+ if (typeof value !== "object")
1215
+ throw new Error(`Unexpected value for --expect.poll: ${value}. If you need to configure timeout, use --expect.poll.timeout=<timeout>`);
1216
+ return value;
1217
+ }
1218
+ }
1219
+ },
1220
+ transform(value) {
1221
+ if (typeof value !== "object")
1222
+ throw new Error(`Unexpected value for --expect: ${value}. If you need to configure expect options, use --expect.{name}=<value> syntax`);
1223
+ return value;
1224
+ }
1225
+ },
1226
+ printConsoleTrace: {
1227
+ description: "Always print console stack traces"
1228
+ },
1188
1229
  // CLI only options
1189
1230
  run: {
1190
1231
  description: "Disable watch mode"
1191
1232
  },
1192
- segfaultRetry: {
1193
- description: "Retry the test suite if it crashes due to a segfault (default: `true`)",
1194
- argument: "<times>",
1195
- default: 0
1196
- },
1197
1233
  color: {
1198
1234
  description: "Removes colors from the console output",
1199
1235
  alias: "no-color"
@@ -1204,6 +1240,15 @@ const cliOptionsConfig = {
1204
1240
  standalone: {
1205
1241
  description: "Start Vitest without running tests. File filters will be ignored, tests will be running only on change (default: `false`)"
1206
1242
  },
1243
+ mergeReports: {
1244
+ description: "Paths to blob reports directory. If this options is used, Vitest won't run any tests, it will only report previously recorded tests",
1245
+ argument: "[path]",
1246
+ transform(value) {
1247
+ if (!value || typeof value === "boolean")
1248
+ return ".vitest-reports";
1249
+ return value;
1250
+ }
1251
+ },
1207
1252
  // disable CLI options
1208
1253
  cliExclude: null,
1209
1254
  server: null,
@@ -1212,7 +1257,6 @@ const cliOptionsConfig = {
1212
1257
  snapshotFormat: null,
1213
1258
  snapshotSerializers: null,
1214
1259
  includeSource: null,
1215
- watchExclude: null,
1216
1260
  alias: null,
1217
1261
  env: null,
1218
1262
  environmentMatchGlobs: null,
@@ -1318,7 +1362,7 @@ function createCLI(options = {}) {
1318
1362
  if (subcommands.length === 1 && (subcommands[0] === "--expand-help" || subcommands[0] === "--expandHelp"))
1319
1363
  return info;
1320
1364
  const subcommandMarker = "$SUB_COMMAND_MARKER$";
1321
- const banner = info.find((current) => /^vitest\/[0-9]+\.[0-9]+\.[0-9]+$/.test(current.body));
1365
+ const banner = info.find((current) => /^vitest\/\d+\.\d+\.\d+$/.test(current.body));
1322
1366
  function addBannerWarning(warning) {
1323
1367
  if (typeof (banner == null ? void 0 : banner.body) === "string") {
1324
1368
  if (banner == null ? void 0 : banner.body.includes(warning))
@@ -1352,9 +1396,6 @@ function createCLI(options = {}) {
1352
1396
  cli.command("bench [...filters]", void 0, options).action(benchmark),
1353
1397
  benchCliOptionsConfig
1354
1398
  );
1355
- cli.command("typecheck [...filters]").action(() => {
1356
- throw new Error(`Running typecheck via "typecheck" command is removed. Please use "--typecheck" to run your regular tests alongside typechecking, or "--typecheck.only" to run only typecheck tests.`);
1357
- });
1358
1399
  cli.command("[...filters]", void 0, options).action((filters, options2) => start("test", filters, options2));
1359
1400
  return cli;
1360
1401
  }
@@ -1411,13 +1452,13 @@ async function start(mode, cliFilters, options) {
1411
1452
  } catch {
1412
1453
  }
1413
1454
  try {
1414
- const { startVitest } = await import('./cli-api.E07AF1Yq.js').then(function (n) { return n.d; });
1455
+ const { startVitest } = await import('./cli-api.CUtJc4r3.js').then(function (n) { return n.d; });
1415
1456
  const ctx = await startVitest(mode, cliFilters.map(normalize), normalizeCliOptions(options));
1416
1457
  if (!(ctx == null ? void 0 : ctx.shouldKeepServer()))
1417
1458
  await (ctx == null ? void 0 : ctx.exit());
1418
1459
  return ctx;
1419
1460
  } catch (e) {
1420
- const { divider } = await import('./utils.dEtNIEgr.js').then(function (n) { return n.u; });
1461
+ const { divider } = await import('./utils.YuQ3LT2a.js').then(function (n) { return n.u; });
1421
1462
  console.error(`
1422
1463
  ${c.red(divider(c.bold(c.inverse(" Unhandled Error "))))}`);
1423
1464
  console.error(e);