vitest 1.0.0-beta.1 → 1.0.0-beta.2

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 (40) hide show
  1. package/dist/browser.d.ts +2 -2
  2. package/dist/browser.js +2 -2
  3. package/dist/child.js +1 -1
  4. package/dist/{chunk-api-setup.0aeabd21.js → chunk-api-setup.5d9a93c7.js} +3 -0
  5. package/dist/{chunk-install-pkg.a430b45e.js → chunk-install-pkg.43d58972.js} +17 -14
  6. package/dist/{chunk-integrations-globals.c3c5e678.js → chunk-integrations-globals.9df12d91.js} +2 -3
  7. package/dist/{chunk-node-git.36288174.js → chunk-node-git.2f1df48f.js} +1 -1
  8. package/dist/{chunk-runtime-console.ea222ffb.js → chunk-runtime-console.f3263f87.js} +19 -4
  9. package/dist/cli-wrapper.js +1 -1
  10. package/dist/cli.js +7 -4
  11. package/dist/config.cjs +2 -1
  12. package/dist/config.d.ts +2 -2
  13. package/dist/config.js +2 -1
  14. package/dist/coverage.d.ts +1 -1
  15. package/dist/entry-vm.js +8 -3
  16. package/dist/entry.js +9 -4
  17. package/dist/environments.d.ts +1 -1
  18. package/dist/environments.js +1 -1
  19. package/dist/execute.d.ts +1 -1
  20. package/dist/index.d.ts +5 -4
  21. package/dist/index.js +3 -4
  22. package/dist/node.d.ts +2 -2
  23. package/dist/node.js +8 -5
  24. package/dist/{reporters-7bd09217.d.ts → reporters-d10f25e1.d.ts} +23 -18
  25. package/dist/reporters.d.ts +1 -1
  26. package/dist/reporters.js +6 -1
  27. package/dist/runners.d.ts +1 -1
  28. package/dist/runners.js +1 -2
  29. package/dist/{suite-543d56bd.d.ts → suite-919dd548.d.ts} +1 -1
  30. package/dist/suite.d.ts +2 -2
  31. package/dist/{vendor-environments.e73c5410.js → vendor-environments.094f240c.js} +2 -0
  32. package/dist/{vendor-index.f7fcd5e8.js → vendor-index.68ecee35.js} +1 -1
  33. package/dist/{vendor-index.85fc950a.js → vendor-index.e006069f.js} +4 -4
  34. package/dist/{vendor-node.bde9fb47.js → vendor-node.e5a35bfe.js} +83 -46
  35. package/dist/{vendor-reporters.f6975b8d.js → vendor-reporters.2953082e.js} +2 -1
  36. package/dist/vendor-vi.d30b47ae.js +3510 -0
  37. package/dist/vm.js +2 -2
  38. package/dist/worker.js +1 -1
  39. package/package.json +9 -9
  40. package/dist/vendor-vi.7f2b988f.js +0 -3491
package/dist/browser.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- export { startTests } from '@vitest/runner';
2
- import { R as ResolvedConfig, e as CoverageOptions, f as CoverageProvider, g as CoverageProviderModule } from './reporters-7bd09217.js';
1
+ export { processError, startTests } from '@vitest/runner';
2
+ import { R as ResolvedConfig, e as CoverageOptions, f as CoverageProvider, g as CoverageProviderModule } from './reporters-d10f25e1.js';
3
3
  import { VitestExecutor } from './execute.js';
4
4
  import 'vite';
5
5
  import 'vite-node';
package/dist/browser.js CHANGED
@@ -1,4 +1,4 @@
1
- export { startTests } from '@vitest/runner';
1
+ export { processError, startTests } from '@vitest/runner';
2
2
  import { setSafeTimers } from '@vitest/utils';
3
3
  import { a as resetRunOnceCounter } from './vendor-run-once.3e5ef7d7.js';
4
4
  export { g as getCoverageProvider, s as startCoverageInsideWorker, a as stopCoverageInsideWorker, t as takeCoverageInsideWorker } from './vendor-coverage.78040316.js';
@@ -13,7 +13,7 @@ async function setupCommonEnv(config) {
13
13
  globalSetup = true;
14
14
  setSafeTimers();
15
15
  if (config.globals)
16
- (await import('./chunk-integrations-globals.c3c5e678.js')).registerApiGlobally();
16
+ (await import('./chunk-integrations-globals.9df12d91.js')).registerApiGlobally();
17
17
  }
18
18
  function setupDefines(defines) {
19
19
  for (const key in defines)
package/dist/child.js CHANGED
@@ -3,7 +3,7 @@ import v8 from 'node:v8';
3
3
  import { c as createBirpc } from './vendor-index.1ca68bd5.js';
4
4
  import { parseRegexp } from '@vitest/utils';
5
5
  import { workerId } from 'tinypool';
6
- import { l as loadEnvironment } from './vendor-environments.e73c5410.js';
6
+ import { l as loadEnvironment } from './vendor-environments.094f240c.js';
7
7
  import { s as startViteNode, m as moduleCache, a as mockMap } from './vendor-execute.07d1a420.js';
8
8
  import { r as rpcDone, c as createSafeRpc } from './vendor-rpc.cbd8e972.js';
9
9
  import { s as setupInspect } from './vendor-inspector.209edf5a.js';
@@ -4512,6 +4512,9 @@ function setup(vitestOrWorkspace, server) {
4512
4512
  function setupClient(ws) {
4513
4513
  const rpc = createBirpc(
4514
4514
  {
4515
+ async onUnhandledError(error, type) {
4516
+ ctx.state.catchError(error, type);
4517
+ },
4515
4518
  async onDone(testId) {
4516
4519
  var _a2;
4517
4520
  return (_a2 = ctx.state.browserTestPromises.get(testId)) == null ? void 0 : _a2.resolve(true);
@@ -1,11 +1,11 @@
1
1
  import $ from 'fs';
2
2
  import f from 'path';
3
3
  import { g as getDefaultExportFromCjs } from './vendor-_commonjsHelpers.7d1333e8.js';
4
- import require$$2 from 'util';
5
- import require$$0$1 from 'child_process';
6
- import { p as pathKeyExports, s as signalExitExports, m as mergeStream$1, g as getStreamExports, c as crossSpawnExports } from './vendor-index.85fc950a.js';
7
- import { o as onetimeExports } from './vendor-node.bde9fb47.js';
8
- import require$$0 from 'os';
4
+ import require$$0 from 'util';
5
+ import require$$0$2 from 'child_process';
6
+ import { p as pathKeyExports, s as signalExitExports, m as mergeStream$1, g as getStreamExports, c as crossSpawnExports } from './vendor-index.e006069f.js';
7
+ import { o as onetimeExports } from './vendor-node.e5a35bfe.js';
8
+ import require$$0$1 from 'os';
9
9
  import 'node:buffer';
10
10
  import 'node:path';
11
11
  import 'node:child_process';
@@ -40,8 +40,12 @@ import './vendor-index.1ca68bd5.js';
40
40
  import './vendor-base.9c08bbd0.js';
41
41
  import 'node:worker_threads';
42
42
  import 'local-pkg';
43
- import './vendor-reporters.f6975b8d.js';
43
+ import './vendor-reporters.2953082e.js';
44
44
  import 'node:perf_hooks';
45
+ import './chunk-runtime-console.f3263f87.js';
46
+ import 'node:stream';
47
+ import 'node:console';
48
+ import './vendor-date.6e993429.js';
45
49
  import './vendor-tasks.f9d75aed.js';
46
50
  import '@vitest/utils/source-map';
47
51
  import 'node:module';
@@ -52,10 +56,9 @@ import 'acorn';
52
56
  import 'acorn-walk';
53
57
  import 'magic-string';
54
58
  import 'strip-literal';
55
- import './vendor-environments.e73c5410.js';
59
+ import './vendor-environments.094f240c.js';
56
60
  import './vendor-index.0b5b3600.js';
57
61
  import 'node:assert';
58
- import 'node:console';
59
62
  import 'node:readline';
60
63
  import 'readline';
61
64
 
@@ -255,7 +258,7 @@ var pLocate_1 = pLocate$1;
255
258
 
256
259
  const path$1 = f;
257
260
  const fs$1 = $;
258
- const {promisify: promisify$1} = require$$2;
261
+ const {promisify: promisify$1} = require$$0;
259
262
  const pLocate = pLocate_1;
260
263
 
261
264
  const fsStat = promisify$1(fs$1.stat);
@@ -326,7 +329,7 @@ var locatePathExports = locatePath.exports;
326
329
  var pathExists = {exports: {}};
327
330
 
328
331
  const fs = $;
329
- const {promisify} = require$$2;
332
+ const {promisify} = require$$0;
330
333
 
331
334
  const pAccess = promisify(fs.access);
332
335
 
@@ -816,7 +819,7 @@ standard:"posix"};
816
819
  const SIGRTMIN=34;
817
820
  const SIGRTMAX=64;realtime.SIGRTMAX=SIGRTMAX;
818
821
 
819
- Object.defineProperty(signals,"__esModule",{value:true});signals.getSignals=void 0;var _os$1=require$$0;
822
+ Object.defineProperty(signals,"__esModule",{value:true});signals.getSignals=void 0;var _os$1=require$$0$1;
820
823
 
821
824
  var _core=core;
822
825
  var _realtime$1=realtime;
@@ -851,7 +854,7 @@ const number=supported?constantSignal:defaultNumber;
851
854
  return {name,number,description,supported,action,forced,standard};
852
855
  };
853
856
 
854
- Object.defineProperty(main,"__esModule",{value:true});main.signalsByNumber=main.signalsByName=void 0;var _os=require$$0;
857
+ Object.defineProperty(main,"__esModule",{value:true});main.signalsByNumber=main.signalsByName=void 0;var _os=require$$0$1;
855
858
 
856
859
  var _signals=signals;
857
860
  var _realtime=realtime;
@@ -1066,7 +1069,7 @@ stdio.exports.node = options => {
1066
1069
 
1067
1070
  var stdioExports = stdio.exports;
1068
1071
 
1069
- const os = require$$0;
1072
+ const os = require$$0$1;
1070
1073
  const onExit = signalExitExports;
1071
1074
 
1072
1075
  const DEFAULT_FORCE_KILL_TIMEOUT = 1000 * 5;
@@ -1401,7 +1404,7 @@ var command = {
1401
1404
  };
1402
1405
 
1403
1406
  const path = f;
1404
- const childProcess = require$$0$1;
1407
+ const childProcess = require$$0$2;
1405
1408
  const crossSpawn = crossSpawnExports;
1406
1409
  const stripFinalNewline = stripFinalNewline$1;
1407
1410
  const npmRunPath = npmRunPathExports;
@@ -1,5 +1,5 @@
1
1
  import { g as globalApis } from './vendor-constants.538d9b49.js';
2
- import { i as index } from './vendor-index.f7fcd5e8.js';
2
+ import { i as index } from './vendor-index.68ecee35.js';
3
3
  import '@vitest/runner';
4
4
  import './vendor-benchmark.44931cfa.js';
5
5
  import '@vitest/runner/utils';
@@ -9,7 +9,7 @@ import 'pathe';
9
9
  import 'std-env';
10
10
  import './vendor-global.97e4527c.js';
11
11
  import './vendor-run-once.3e5ef7d7.js';
12
- import './vendor-vi.7f2b988f.js';
12
+ import './vendor-vi.d30b47ae.js';
13
13
  import 'chai';
14
14
  import './vendor-_commonjsHelpers.7d1333e8.js';
15
15
  import '@vitest/expect';
@@ -17,7 +17,6 @@ import '@vitest/snapshot';
17
17
  import '@vitest/utils/error';
18
18
  import './vendor-tasks.f9d75aed.js';
19
19
  import '@vitest/utils/source-map';
20
- import 'util';
21
20
  import './vendor-date.6e993429.js';
22
21
  import '@vitest/spy';
23
22
 
@@ -1,5 +1,5 @@
1
1
  import { resolve } from 'pathe';
2
- import { e as execa } from './vendor-index.85fc950a.js';
2
+ import { e as execa } from './vendor-index.e006069f.js';
3
3
  import 'node:buffer';
4
4
  import 'node:path';
5
5
  import 'node:child_process';
@@ -1,13 +1,28 @@
1
1
  import { Writable } from 'node:stream';
2
2
  import { Console } from 'node:console';
3
+ import { relative } from 'node:path';
3
4
  import { getSafeTimers } from '@vitest/utils';
4
5
  import { R as RealDate } from './vendor-date.6e993429.js';
5
6
 
7
+ const UNKNOWN_TEST_ID = "__vitest__unknown_test__";
8
+ function getTaskIdByStack(root) {
9
+ var _a, _b;
10
+ const stack = (_a = new Error("STACK_TRACE_ERROR").stack) == null ? void 0 : _a.split("\n");
11
+ if (!stack)
12
+ return UNKNOWN_TEST_ID;
13
+ const index = stack.findIndex((line2) => line2.includes("at Console.value (node:internal/console/"));
14
+ const line = index === -1 ? null : stack[index + 2];
15
+ if (!line)
16
+ return UNKNOWN_TEST_ID;
17
+ const filepath = (_b = line.match(/at\s(.*)\s?/)) == null ? void 0 : _b[1];
18
+ if (filepath)
19
+ return relative(root, filepath);
20
+ return UNKNOWN_TEST_ID;
21
+ }
6
22
  function createCustomConsole(state) {
7
23
  const stdoutBuffer = /* @__PURE__ */ new Map();
8
24
  const stderrBuffer = /* @__PURE__ */ new Map();
9
25
  const timers = /* @__PURE__ */ new Map();
10
- const unknownTestId = "__vitest__unknown_test__";
11
26
  const { setTimeout, clearTimeout } = getSafeTimers();
12
27
  function schedule(taskId) {
13
28
  const timer = timers.get(taskId);
@@ -58,7 +73,7 @@ function createCustomConsole(state) {
58
73
  const stdout = new Writable({
59
74
  write(data, encoding, callback) {
60
75
  var _a;
61
- const id = ((_a = state == null ? void 0 : state.current) == null ? void 0 : _a.id) ?? unknownTestId;
76
+ const id = ((_a = state == null ? void 0 : state.current) == null ? void 0 : _a.id) ?? getTaskIdByStack(state.ctx.config.root);
62
77
  let timer = timers.get(id);
63
78
  if (timer) {
64
79
  timer.stdoutTime = timer.stdoutTime || RealDate.now();
@@ -79,7 +94,7 @@ function createCustomConsole(state) {
79
94
  const stderr = new Writable({
80
95
  write(data, encoding, callback) {
81
96
  var _a;
82
- const id = ((_a = state == null ? void 0 : state.current) == null ? void 0 : _a.id) ?? unknownTestId;
97
+ const id = ((_a = state == null ? void 0 : state.current) == null ? void 0 : _a.id) ?? getTaskIdByStack(state.ctx.config.root);
83
98
  let timer = timers.get(id);
84
99
  if (timer) {
85
100
  timer.stderrTime = timer.stderrTime || RealDate.now();
@@ -105,4 +120,4 @@ function createCustomConsole(state) {
105
120
  });
106
121
  }
107
122
 
108
- export { createCustomConsole };
123
+ export { UNKNOWN_TEST_ID, createCustomConsole };
@@ -1,6 +1,6 @@
1
1
  import { fileURLToPath } from 'node:url';
2
2
  import c from 'picocolors';
3
- import { e as execa } from './vendor-index.85fc950a.js';
3
+ import { e as execa } from './vendor-index.e006069f.js';
4
4
  import { E as EXIT_CODE_RESTART } from './vendor-constants.538d9b49.js';
5
5
  import 'node:buffer';
6
6
  import 'node:path';
package/dist/cli.js CHANGED
@@ -1,9 +1,9 @@
1
1
  import { normalize } from 'pathe';
2
2
  import cac from 'cac';
3
3
  import c from 'picocolors';
4
- import { v as version, s as startVitest } from './vendor-node.bde9fb47.js';
4
+ import { v as version, s as startVitest } from './vendor-node.e5a35bfe.js';
5
5
  import './vendor-index.29282562.js';
6
- import { d as divider } from './vendor-reporters.f6975b8d.js';
6
+ import { d as divider } from './vendor-reporters.2953082e.js';
7
7
  import { t as toArray } from './vendor-base.9c08bbd0.js';
8
8
  import 'vite';
9
9
  import 'node:path';
@@ -34,7 +34,7 @@ import '@vitest/utils';
34
34
  import 'local-pkg';
35
35
  import 'std-env';
36
36
  import 'node:crypto';
37
- import './vendor-index.85fc950a.js';
37
+ import './vendor-index.e006069f.js';
38
38
  import 'node:buffer';
39
39
  import 'node:child_process';
40
40
  import 'child_process';
@@ -49,7 +49,7 @@ import 'acorn-walk';
49
49
  import '@vitest/runner/utils';
50
50
  import 'magic-string';
51
51
  import 'strip-literal';
52
- import './vendor-environments.e73c5410.js';
52
+ import './vendor-environments.094f240c.js';
53
53
  import './vendor-index.0b5b3600.js';
54
54
  import 'node:module';
55
55
  import 'node:assert';
@@ -58,6 +58,9 @@ import 'node:readline';
58
58
  import 'readline';
59
59
  import './vendor-global.97e4527c.js';
60
60
  import 'node:perf_hooks';
61
+ import './chunk-runtime-console.f3263f87.js';
62
+ import 'node:stream';
63
+ import './vendor-date.6e993429.js';
61
64
  import './vendor-tasks.f9d75aed.js';
62
65
 
63
66
  const cli = cac("vitest");
package/dist/config.cjs CHANGED
@@ -28,13 +28,14 @@ const defaultCoverageExcludes = [
28
28
  const coverageConfigDefaults = {
29
29
  provider: "v8",
30
30
  enabled: false,
31
+ all: true,
31
32
  clean: true,
32
33
  cleanOnRerun: true,
33
34
  reportsDirectory: "./coverage",
34
35
  exclude: defaultCoverageExcludes,
35
36
  reportOnFailure: false,
36
37
  reporter: [["text", {}], ["html", {}], ["clover", {}], ["json", {}]],
37
- extension: [".js", ".cjs", ".mjs", ".ts", ".mts", ".cts", ".tsx", ".jsx", ".vue", ".svelte"],
38
+ extension: [".js", ".cjs", ".mjs", ".ts", ".mts", ".cts", ".tsx", ".jsx", ".vue", ".svelte", ".marko"],
38
39
  allowExternal: false
39
40
  };
40
41
  const fakeTimersDefaults = {
package/dist/config.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { UserConfig as UserConfig$1, ConfigEnv } from 'vite';
2
2
  export { ConfigEnv, UserConfig, mergeConfig } from 'vite';
3
- import { a as ResolvedCoverageOptions, U as UserConfig, C as CoverageV8Options, P as ProjectConfig } from './reporters-7bd09217.js';
3
+ import { a as ResolvedCoverageOptions, U as UserConfig, C as CoverageV8Options, P as ProjectConfig } from './reporters-d10f25e1.js';
4
4
  import '@vitest/runner';
5
5
  import 'vite-node';
6
6
  import '@vitest/snapshot';
@@ -84,4 +84,4 @@ declare function defineWorkspace(config: (string | (UserProjectConfigExport & {
84
84
  extends?: string | undefined;
85
85
  }))[];
86
86
 
87
- export { UserConfigExport, UserConfigFn, UserConfigFnObject, UserConfigFnPromise, UserProjectConfigExport, UserProjectConfigFn, UserWorkspaceConfig, configDefaults, coverageConfigDefaults, defaultExclude, defaultInclude, defineConfig, defineProject, defineWorkspace };
87
+ export { type UserConfigExport, type UserConfigFn, type UserConfigFnObject, type UserConfigFnPromise, type UserProjectConfigExport, type UserProjectConfigFn, type UserWorkspaceConfig, configDefaults, coverageConfigDefaults, defaultExclude, defaultInclude, defineConfig, defineProject, defineWorkspace };
package/dist/config.js CHANGED
@@ -26,13 +26,14 @@ const defaultCoverageExcludes = [
26
26
  const coverageConfigDefaults = {
27
27
  provider: "v8",
28
28
  enabled: false,
29
+ all: true,
29
30
  clean: true,
30
31
  cleanOnRerun: true,
31
32
  reportsDirectory: "./coverage",
32
33
  exclude: defaultCoverageExcludes,
33
34
  reportOnFailure: false,
34
35
  reporter: [["text", {}], ["html", {}], ["clover", {}], ["json", {}]],
35
- extension: [".js", ".cjs", ".mjs", ".ts", ".mts", ".cts", ".tsx", ".jsx", ".vue", ".svelte"],
36
+ extension: [".js", ".cjs", ".mjs", ".ts", ".mts", ".cts", ".tsx", ".jsx", ".vue", ".svelte", ".marko"],
36
37
  allowExternal: false
37
38
  };
38
39
  const fakeTimersDefaults = {
@@ -1,4 +1,4 @@
1
- import { B as BaseCoverageOptions, a as ResolvedCoverageOptions } from './reporters-7bd09217.js';
1
+ import { B as BaseCoverageOptions, a as ResolvedCoverageOptions } from './reporters-d10f25e1.js';
2
2
  import 'vite';
3
3
  import '@vitest/runner';
4
4
  import 'vite-node';
package/dist/entry-vm.js CHANGED
@@ -1,12 +1,14 @@
1
1
  import { isatty } from 'node:tty';
2
2
  import { createRequire } from 'node:module';
3
+ import util from 'node:util';
4
+ import timers from 'node:timers';
3
5
  import { performance } from 'node:perf_hooks';
4
6
  import { startTests } from '@vitest/runner';
5
7
  import { setupColors, createColors } from '@vitest/utils';
6
8
  import { V as VitestSnapshotEnvironment, s as setupChaiConfig, r as resolveTestRunner } from './vendor-index.d36f5516.js';
7
9
  import { s as startCoverageInsideWorker, a as stopCoverageInsideWorker } from './vendor-coverage.78040316.js';
8
10
  import { g as getWorkerState } from './vendor-global.97e4527c.js';
9
- import { i as index } from './vendor-index.f7fcd5e8.js';
11
+ import { i as index } from './vendor-index.68ecee35.js';
10
12
  import { setupCommonEnv } from './browser.js';
11
13
  import 'chai';
12
14
  import '@vitest/snapshot/environment';
@@ -19,14 +21,13 @@ import '@vitest/runner/utils';
19
21
  import './vendor-index.29282562.js';
20
22
  import 'std-env';
21
23
  import './vendor-run-once.3e5ef7d7.js';
22
- import './vendor-vi.7f2b988f.js';
24
+ import './vendor-vi.d30b47ae.js';
23
25
  import './vendor-_commonjsHelpers.7d1333e8.js';
24
26
  import '@vitest/expect';
25
27
  import '@vitest/snapshot';
26
28
  import '@vitest/utils/error';
27
29
  import './vendor-tasks.f9d75aed.js';
28
30
  import '@vitest/utils/source-map';
29
- import 'util';
30
31
  import './vendor-date.6e993429.js';
31
32
  import '@vitest/spy';
32
33
 
@@ -46,6 +47,10 @@ async function run(files, config, executor) {
46
47
  _require.extensions[".sass"] = () => ({});
47
48
  _require.extensions[".less"] = () => ({});
48
49
  }
50
+ globalThis.__vitest_required__ = {
51
+ util,
52
+ timers
53
+ };
49
54
  await startCoverageInsideWorker(config.coverage, executor);
50
55
  if (config.chaiConfig)
51
56
  setupChaiConfig(config.chaiConfig);
package/dist/entry.js CHANGED
@@ -1,14 +1,16 @@
1
1
  import { performance } from 'node:perf_hooks';
2
2
  import { startTests } from '@vitest/runner';
3
3
  import './vendor-index.29282562.js';
4
- import { a as globalExpect, r as resetModules, v as vi } from './vendor-vi.7f2b988f.js';
4
+ import { a as globalExpect, r as resetModules, v as vi } from './vendor-vi.d30b47ae.js';
5
5
  import { s as startCoverageInsideWorker, a as stopCoverageInsideWorker } from './vendor-coverage.78040316.js';
6
6
  import { V as VitestSnapshotEnvironment, s as setupChaiConfig, r as resolveTestRunner } from './vendor-index.d36f5516.js';
7
7
  import { createRequire } from 'node:module';
8
+ import util from 'node:util';
9
+ import timers from 'node:timers';
8
10
  import { isatty } from 'node:tty';
9
11
  import { installSourcemapsSupport } from 'vite-node/source-map';
10
12
  import { setupColors, createColors, getSafeTimers } from '@vitest/utils';
11
- import { i as index } from './vendor-index.f7fcd5e8.js';
13
+ import { i as index } from './vendor-index.68ecee35.js';
12
14
  import { setupCommonEnv } from './browser.js';
13
15
  import { g as getWorkerState } from './vendor-global.97e4527c.js';
14
16
  import 'pathe';
@@ -21,7 +23,6 @@ import '@vitest/snapshot';
21
23
  import '@vitest/utils/error';
22
24
  import './vendor-tasks.f9d75aed.js';
23
25
  import '@vitest/utils/source-map';
24
- import 'util';
25
26
  import './vendor-date.6e993429.js';
26
27
  import '@vitest/spy';
27
28
  import '@vitest/snapshot/environment';
@@ -55,13 +56,17 @@ async function setupGlobalEnv(config, { environment }) {
55
56
  } else {
56
57
  process.env.SSR = "1";
57
58
  }
59
+ globalThis.__vitest_required__ = {
60
+ util,
61
+ timers
62
+ };
58
63
  installSourcemapsSupport({
59
64
  getSourceMap: (source) => state.moduleCache.getSourceMap(source)
60
65
  });
61
66
  await setupConsoleLogSpy(state);
62
67
  }
63
68
  async function setupConsoleLogSpy(state) {
64
- const { createCustomConsole } = await import('./chunk-runtime-console.ea222ffb.js');
69
+ const { createCustomConsole } = await import('./chunk-runtime-console.f3263f87.js');
65
70
  globalThis.console = createCustomConsole(state);
66
71
  }
67
72
  async function withEnv({ environment }, options, fn) {
@@ -1,4 +1,4 @@
1
- import { E as Environment } from './reporters-7bd09217.js';
1
+ import { E as Environment } from './reporters-d10f25e1.js';
2
2
  import 'vite';
3
3
  import '@vitest/runner';
4
4
  import 'vite-node';
@@ -1,4 +1,4 @@
1
- export { e as builtinEnvironments, p as populateGlobal } from './vendor-environments.e73c5410.js';
1
+ export { e as builtinEnvironments, p as populateGlobal } from './vendor-environments.094f240c.js';
2
2
  import 'pathe';
3
3
  import './vendor-index.0b5b3600.js';
4
4
  import 'acorn';
package/dist/execute.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import vm from 'node:vm';
2
2
  import { ViteNodeRunner } from 'vite-node/client';
3
3
  import { ViteNodeRunnerOptions } from 'vite-node';
4
- import { ah as PendingSuiteMock, ai as MockFactory, Z as WorkerGlobalState, aj as MockMap, K as RuntimeRPC } from './reporters-7bd09217.js';
4
+ import { ah as PendingSuiteMock, ai as MockFactory, Z as WorkerGlobalState, aj as MockMap, K as RuntimeRPC } from './reporters-d10f25e1.js';
5
5
  import 'vite';
6
6
  import '@vitest/runner';
7
7
  import '@vitest/snapshot';
package/dist/index.d.ts CHANGED
@@ -1,10 +1,10 @@
1
1
  import { TaskPopulated, File, TaskResultPack, CancelReason } from '@vitest/runner';
2
2
  export { Custom, DoneCallback, ExtendedContext, File, HookCleanupCallback, HookListener, OnTestFailedHandler, RunMode, RuntimeContext, SequenceHooks, SequenceSetupFiles, Suite, SuiteAPI, SuiteCollector, SuiteFactory, SuiteHooks, Task, TaskBase, TaskContext, TaskCustomOptions, TaskMeta, TaskResult, TaskResultPack, TaskState, Test, TestAPI, TestContext, TestFunction, TestOptions, afterAll, afterEach, beforeAll, beforeEach, describe, it, onTestFailed, suite, test } from '@vitest/runner';
3
- export { b as bench } from './suite-543d56bd.js';
3
+ export { b as bench } from './suite-919dd548.js';
4
4
  import { ExpectStatic } from '@vitest/expect';
5
5
  export { Assertion, AsymmetricMatchersContaining, ExpectStatic, JestAssertion } from '@vitest/expect';
6
- import { F as FakeTimerInstallOpts, M as MockFactoryWithHelper, h as RuntimeConfig, A as AfterSuiteRunMeta, i as UserConsoleLog, R as ResolvedConfig, j as ModuleGraphData, k as Reporter } from './reporters-7bd09217.js';
7
- export { x as ApiConfig, a1 as ArgumentsType, a0 as Arrayable, _ as Awaitable, B as BaseCoverageOptions, af as BenchFunction, ad as Benchmark, ag as BenchmarkAPI, ae as BenchmarkResult, ac as BenchmarkUserOptions, u as BuiltinEnvironment, w as CSSModuleScopeStrategy, n as CollectLineNumbers, o as CollectLines, a3 as Constructable, q as Context, Q as ContextRPC, N as ContextTestEnvironment, aa as CoverageIstanbulOptions, e as CoverageOptions, f as CoverageProvider, g as CoverageProviderModule, a9 as CoverageReporter, C as CoverageV8Options, ab as CustomProviderOptions, D as DepsOptimizationOptions, E as Environment, y as EnvironmentOptions, a5 as EnvironmentReturn, H as HappyDOMOptions, I as InlineConfig, J as JSDOMOptions, a4 as ModuleCache, a2 as MutableArray, $ as Nullable, a7 as OnServerRestartHandler, r as Pool, t as PoolOptions, P as ProjectConfig, l as RawErrsMap, a8 as ReportContext, X as ResolveIdFunction, a as ResolvedCoverageOptions, O as ResolvedTestEnvironment, p as RootAndTarget, L as RunnerRPC, K as RuntimeRPC, z as TransformModePatterns, m as TscErrorInfo, G as TypecheckConfig, U as UserConfig, b as Vitest, v as VitestEnvironment, V as VitestRunMode, a6 as VmEnvironmentReturn, S as WorkerContext, Z as WorkerGlobalState, Y as WorkerRPC } from './reporters-7bd09217.js';
6
+ import { F as FakeTimerInstallOpts, M as MockFactoryWithHelper, h as RuntimeConfig, A as AfterSuiteRunMeta, i as UserConsoleLog, R as ResolvedConfig, j as ModuleGraphData, k as Reporter } from './reporters-d10f25e1.js';
7
+ export { x as ApiConfig, a1 as ArgumentsType, a0 as Arrayable, _ as Awaitable, B as BaseCoverageOptions, af as BenchFunction, ad as Benchmark, ag as BenchmarkAPI, ae as BenchmarkResult, ac as BenchmarkUserOptions, u as BuiltinEnvironment, w as CSSModuleScopeStrategy, n as CollectLineNumbers, o as CollectLines, a3 as Constructable, q as Context, Q as ContextRPC, N as ContextTestEnvironment, aa as CoverageIstanbulOptions, e as CoverageOptions, f as CoverageProvider, g as CoverageProviderModule, a9 as CoverageReporter, C as CoverageV8Options, ab as CustomProviderOptions, D as DepsOptimizationOptions, E as Environment, y as EnvironmentOptions, a5 as EnvironmentReturn, H as HappyDOMOptions, I as InlineConfig, J as JSDOMOptions, a4 as ModuleCache, a2 as MutableArray, $ as Nullable, a7 as OnServerRestartHandler, r as Pool, t as PoolOptions, P as ProjectConfig, l as RawErrsMap, a8 as ReportContext, X as ResolveIdFunction, a as ResolvedCoverageOptions, O as ResolvedTestEnvironment, p as RootAndTarget, L as RunnerRPC, K as RuntimeRPC, z as TransformModePatterns, m as TscErrorInfo, G as TypecheckConfig, U as UserConfig, b as Vitest, v as VitestEnvironment, V as VitestRunMode, a6 as VmEnvironmentReturn, S as WorkerContext, Z as WorkerGlobalState, Y as WorkerRPC } from './reporters-d10f25e1.js';
8
8
  import { spyOn, fn, MaybeMockedDeep, MaybeMocked, MaybePartiallyMocked, MaybePartiallyMockedDeep, EnhancedSpy } from '@vitest/spy';
9
9
  export { EnhancedSpy, Mock, MockContext, MockInstance, Mocked, MockedClass, MockedFunction, MockedObject, SpyInstance } from '@vitest/spy';
10
10
  export { SnapshotEnvironment } from '@vitest/snapshot/environment';
@@ -380,6 +380,7 @@ interface TransformResultWithSource extends TransformResult {
380
380
  source?: string;
381
381
  }
382
382
  interface WebSocketHandlers {
383
+ onUnhandledError(error: unknown, type: string): Promise<void>;
383
384
  onCollected(files?: File[]): Promise<void>;
384
385
  onTaskUpdate(packs: TaskResultPack[]): void;
385
386
  onAfterSuiteRun(meta: AfterSuiteRunMeta): void;
@@ -407,4 +408,4 @@ interface WebSocketEvents extends Pick<Reporter, 'onCollected' | 'onFinished' |
407
408
  onCancel(reason: CancelReason): void;
408
409
  }
409
410
 
410
- export { AfterSuiteRunMeta, AssertType, ExpectTypeOf, ModuleGraphData, Reporter, ResolvedConfig, RuntimeConfig, TransformResultWithSource, UserConsoleLog, WebSocketEvents, WebSocketHandlers, assertType, createExpect, globalExpect as expect, expectTypeOf, getRunningMode, isFirstRun, isWatchMode, runOnce, vi, vitest };
411
+ export { AfterSuiteRunMeta, type AssertType, type ExpectTypeOf, ModuleGraphData, Reporter, ResolvedConfig, RuntimeConfig, type TransformResultWithSource, UserConsoleLog, type WebSocketEvents, type WebSocketHandlers, assertType, createExpect, globalExpect as expect, expectTypeOf, getRunningMode, isFirstRun, isWatchMode, runOnce, vi, vitest };
package/dist/index.js CHANGED
@@ -1,9 +1,9 @@
1
1
  export { afterAll, afterEach, beforeAll, beforeEach, describe, it, onTestFailed, suite, test } from '@vitest/runner';
2
2
  export { b as bench } from './vendor-benchmark.44931cfa.js';
3
3
  export { i as isFirstRun, r as runOnce } from './vendor-run-once.3e5ef7d7.js';
4
- export { c as createExpect, a as expect, v as vi, b as vitest } from './vendor-vi.7f2b988f.js';
5
- import { d as dist } from './vendor-index.f7fcd5e8.js';
6
- export { b as assertType, g as getRunningMode, a as isWatchMode } from './vendor-index.f7fcd5e8.js';
4
+ export { c as createExpect, a as expect, v as vi, b as vitest } from './vendor-vi.d30b47ae.js';
5
+ import { d as dist } from './vendor-index.68ecee35.js';
6
+ export { b as assertType, g as getRunningMode, a as isWatchMode } from './vendor-index.68ecee35.js';
7
7
  import * as chai from 'chai';
8
8
  export { chai };
9
9
  export { assert, should } from 'chai';
@@ -19,7 +19,6 @@ import '@vitest/snapshot';
19
19
  import '@vitest/utils/error';
20
20
  import './vendor-tasks.f9d75aed.js';
21
21
  import '@vitest/utils/source-map';
22
- import 'util';
23
22
  import './vendor-date.6e993429.js';
24
23
  import '@vitest/spy';
25
24
 
package/dist/node.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { V as VitestRunMode, U as UserConfig, b as Vitest, T as TestSequencer, W as WorkspaceSpec } from './reporters-7bd09217.js';
2
- export { d as TestSequencerConstructor, c as VitestWorkspace, s as startVitest } from './reporters-7bd09217.js';
1
+ import { V as VitestRunMode, U as UserConfig, b as Vitest, T as TestSequencer, W as WorkspaceSpec } from './reporters-d10f25e1.js';
2
+ export { d as TestSequencerConstructor, c as VitestWorkspace, s as startVitest } from './reporters-d10f25e1.js';
3
3
  import { UserConfig as UserConfig$1, Plugin } from 'vite';
4
4
  import '@vitest/runner';
5
5
  import 'vite-node';
package/dist/node.js CHANGED
@@ -1,4 +1,4 @@
1
- export { B as BaseSequencer, V as VitestPlugin, c as createVitest, r as registerConsoleShortcuts, s as startVitest } from './vendor-node.bde9fb47.js';
1
+ export { B as BaseSequencer, V as VitestPlugin, c as createVitest, r as registerConsoleShortcuts, s as startVitest } from './vendor-node.e5a35bfe.js';
2
2
  import 'pathe';
3
3
  import 'vite';
4
4
  import 'node:path';
@@ -33,13 +33,17 @@ import './vendor-index.1ca68bd5.js';
33
33
  import './vendor-base.9c08bbd0.js';
34
34
  import 'node:worker_threads';
35
35
  import 'local-pkg';
36
- import './vendor-reporters.f6975b8d.js';
36
+ import './vendor-reporters.2953082e.js';
37
37
  import 'node:perf_hooks';
38
+ import './chunk-runtime-console.f3263f87.js';
39
+ import 'node:stream';
40
+ import 'node:console';
41
+ import './vendor-date.6e993429.js';
38
42
  import './vendor-tasks.f9d75aed.js';
39
43
  import '@vitest/utils/source-map';
40
44
  import 'node:module';
41
45
  import 'node:crypto';
42
- import './vendor-index.85fc950a.js';
46
+ import './vendor-index.e006069f.js';
43
47
  import 'node:buffer';
44
48
  import 'node:child_process';
45
49
  import 'child_process';
@@ -52,9 +56,8 @@ import 'acorn';
52
56
  import 'acorn-walk';
53
57
  import 'magic-string';
54
58
  import 'strip-literal';
55
- import './vendor-environments.e73c5410.js';
59
+ import './vendor-environments.094f240c.js';
56
60
  import './vendor-index.0b5b3600.js';
57
61
  import 'node:assert';
58
- import 'node:console';
59
62
  import 'node:readline';
60
63
  import 'readline';
@@ -316,21 +316,21 @@ declare type Test = (arg0: any) => boolean;
316
316
  * Names of clock methods that may be faked by install.
317
317
  */
318
318
  type FakeMethod =
319
- | 'setTimeout'
320
- | 'clearTimeout'
321
- | 'setImmediate'
322
- | 'clearImmediate'
323
- | 'setInterval'
324
- | 'clearInterval'
325
- | 'Date'
326
- | 'nextTick'
327
- | 'hrtime'
328
- | 'requestAnimationFrame'
329
- | 'cancelAnimationFrame'
330
- | 'requestIdleCallback'
331
- | 'cancelIdleCallback'
332
- | 'performance'
333
- | 'queueMicrotask';
319
+ | "setTimeout"
320
+ | "clearTimeout"
321
+ | "setImmediate"
322
+ | "clearImmediate"
323
+ | "setInterval"
324
+ | "clearInterval"
325
+ | "Date"
326
+ | "nextTick"
327
+ | "hrtime"
328
+ | "requestAnimationFrame"
329
+ | "cancelAnimationFrame"
330
+ | "requestIdleCallback"
331
+ | "cancelIdleCallback"
332
+ | "performance"
333
+ | "queueMicrotask";
334
334
 
335
335
  interface FakeTimerInstallOpts {
336
336
  /**
@@ -752,6 +752,11 @@ declare class Vitest {
752
752
  private coreWorkspaceProject;
753
753
  projects: WorkspaceProject[];
754
754
  private projectsTestFiles;
755
+ projectFiles: {
756
+ workerPath: string;
757
+ forksPath: string;
758
+ vmPath: string;
759
+ };
755
760
  constructor(mode: VitestRunMode);
756
761
  private _onRestartListeners;
757
762
  private _onSetServer;
@@ -1267,7 +1272,7 @@ interface BaseCoverageOptions {
1267
1272
  /**
1268
1273
  * Extensions for files to be included in coverage
1269
1274
  *
1270
- * @default ['.js', '.cjs', '.mjs', '.ts', '.tsx', '.jsx', '.vue', '.svelte']
1275
+ * @default ['.js', '.cjs', '.mjs', '.ts', '.tsx', '.jsx', '.vue', '.svelte', '.marko']
1271
1276
  */
1272
1277
  extension?: string | string[];
1273
1278
  /**
@@ -1610,7 +1615,7 @@ interface WorkerContextOptions {
1610
1615
  }
1611
1616
  interface VmOptions {
1612
1617
  /**
1613
- * Specifies the memory limit for `worker_thread` or `child_processe` before they are recycled.
1618
+ * Specifies the memory limit for `worker_thread` or `child_process` before they are recycled.
1614
1619
  * If you see memory leaks, try to tinker this value.
1615
1620
  */
1616
1621
  memoryLimit?: string | number;
@@ -2357,4 +2362,4 @@ type Context = RootAndTarget & {
2357
2362
  lastActivePath?: string;
2358
2363
  };
2359
2364
 
2360
- export { Nullable as $, AfterSuiteRunMeta as A, BaseCoverageOptions as B, CoverageV8Options as C, DepsOptimizationOptions as D, Environment as E, FakeTimerInstallOpts as F, TypecheckConfig as G, HappyDOMOptions as H, InlineConfig as I, JSDOMOptions as J, RuntimeRPC as K, RunnerRPC as L, MockFactoryWithHelper as M, ContextTestEnvironment as N, ResolvedTestEnvironment as O, ProjectConfig as P, ContextRPC as Q, ResolvedConfig as R, WorkerContext as S, TestSequencer as T, UserConfig as U, VitestRunMode as V, WorkspaceSpec as W, ResolveIdFunction as X, WorkerRPC as Y, WorkerGlobalState as Z, Awaitable as _, ResolvedCoverageOptions as a, Arrayable as a0, ArgumentsType$1 as a1, MutableArray as a2, Constructable as a3, ModuleCache as a4, EnvironmentReturn as a5, VmEnvironmentReturn as a6, OnServerRestartHandler as a7, ReportContext as a8, CoverageReporter as a9, CoverageIstanbulOptions as aa, CustomProviderOptions as ab, BenchmarkUserOptions as ac, Benchmark as ad, BenchmarkResult as ae, BenchFunction as af, BenchmarkAPI as ag, PendingSuiteMock as ah, MockFactory as ai, MockMap as aj, DefaultReporter as ak, BasicReporter as al, DotReporter as am, JsonReporter$1 as an, VerboseReporter as ao, TapReporter as ap, JUnitReporter as aq, TapFlatReporter as ar, HangingProcessReporter as as, BaseReporter as at, ReportersMap as au, BuiltinReporters as av, BenchmarkReportsMap as aw, BenchmarkBuiltinReporters as ax, Vitest as b, WorkspaceProject as c, TestSequencerConstructor as d, CoverageOptions as e, CoverageProvider as f, CoverageProviderModule as g, RuntimeConfig as h, UserConsoleLog as i, ModuleGraphData as j, Reporter as k, RawErrsMap as l, TscErrorInfo as m, CollectLineNumbers as n, CollectLines as o, RootAndTarget as p, Context as q, Pool as r, startVitest as s, PoolOptions as t, BuiltinEnvironment as u, VitestEnvironment as v, CSSModuleScopeStrategy as w, ApiConfig as x, EnvironmentOptions as y, TransformModePatterns as z };
2365
+ export { type Nullable as $, type AfterSuiteRunMeta as A, type BaseCoverageOptions as B, type CoverageV8Options as C, type DepsOptimizationOptions as D, type Environment as E, type FakeTimerInstallOpts as F, type TypecheckConfig as G, type HappyDOMOptions as H, type InlineConfig as I, type JSDOMOptions as J, type RuntimeRPC as K, type RunnerRPC as L, type MockFactoryWithHelper as M, type ContextTestEnvironment as N, type ResolvedTestEnvironment as O, type ProjectConfig as P, type ContextRPC as Q, type ResolvedConfig as R, type WorkerContext as S, type TestSequencer as T, type UserConfig as U, type VitestRunMode as V, type WorkspaceSpec as W, type ResolveIdFunction as X, type WorkerRPC as Y, type WorkerGlobalState as Z, type Awaitable as _, type ResolvedCoverageOptions as a, type Arrayable as a0, type ArgumentsType$1 as a1, type MutableArray as a2, type Constructable as a3, type ModuleCache as a4, type EnvironmentReturn as a5, type VmEnvironmentReturn as a6, type OnServerRestartHandler as a7, type ReportContext as a8, type CoverageReporter as a9, type CoverageIstanbulOptions as aa, type CustomProviderOptions as ab, type BenchmarkUserOptions as ac, type Benchmark as ad, type BenchmarkResult as ae, type BenchFunction as af, type BenchmarkAPI as ag, type PendingSuiteMock as ah, type MockFactory as ai, type MockMap as aj, DefaultReporter as ak, BasicReporter as al, DotReporter as am, JsonReporter$1 as an, VerboseReporter as ao, TapReporter as ap, JUnitReporter as aq, TapFlatReporter as ar, HangingProcessReporter as as, BaseReporter as at, ReportersMap as au, type BuiltinReporters as av, BenchmarkReportsMap as aw, type BenchmarkBuiltinReporters as ax, Vitest as b, WorkspaceProject as c, type TestSequencerConstructor as d, type CoverageOptions as e, type CoverageProvider as f, type CoverageProviderModule as g, type RuntimeConfig as h, type UserConsoleLog as i, type ModuleGraphData as j, type Reporter as k, type RawErrsMap as l, type TscErrorInfo as m, type CollectLineNumbers as n, type CollectLines as o, type RootAndTarget as p, type Context as q, type Pool as r, startVitest as s, type PoolOptions as t, type BuiltinEnvironment as u, type VitestEnvironment as v, type CSSModuleScopeStrategy as w, type ApiConfig as x, type EnvironmentOptions as y, type TransformModePatterns as z };
@@ -1,4 +1,4 @@
1
- export { at as BaseReporter, al as BasicReporter, ax as BenchmarkBuiltinReporters, aw as BenchmarkReportsMap, av as BuiltinReporters, ak as DefaultReporter, am as DotReporter, as as HangingProcessReporter, aq as JUnitReporter, an as JsonReporter, k as Reporter, au as ReportersMap, ar as TapFlatReporter, ap as TapReporter, ao as VerboseReporter } from './reporters-7bd09217.js';
1
+ export { at as BaseReporter, al as BasicReporter, ax as BenchmarkBuiltinReporters, aw as BenchmarkReportsMap, av as BuiltinReporters, ak as DefaultReporter, am as DotReporter, as as HangingProcessReporter, aq as JUnitReporter, an as JsonReporter, k as Reporter, au as ReportersMap, ar as TapFlatReporter, ap as TapReporter, ao as VerboseReporter } from './reporters-d10f25e1.js';
2
2
  import 'vite';
3
3
  import '@vitest/runner';
4
4
  import 'vite-node';