vitest 5.0.3 → 5.0.5

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 (72) hide show
  1. package/LICENSE.md +1 -1
  2. package/dist/browser.d.ts +4 -4
  3. package/dist/browser.js +11 -11
  4. package/dist/chunks/{base.DhkQeZwd.js → base.CzXt2BO_.js} +40 -15
  5. package/dist/chunks/{browser.d.3cffPS1V.d.ts → browser.d.FGQ9_rK6.d.ts} +3 -3
  6. package/dist/chunks/{cac.DfDGTQ9W.js → cac.CLrZKo1g.js} +21 -23
  7. package/dist/chunks/cli-api.De07GUeT.js +13894 -0
  8. package/dist/chunks/{config.d.BxjInJat.d.ts → config.d.QBNYCgFU.d.ts} +20 -9
  9. package/dist/chunks/{console.RBA5x-0t.js → console.DtI4yxfN.js} +5 -5
  10. package/dist/chunks/{coverage.S6Dao4g-.js → coverage.-bm5IxnW.js} +1 -1
  11. package/dist/chunks/{coverage._yXj5zeb.js → coverage.cTDc4uSS.js} +1 -1
  12. package/dist/chunks/{creator.203NYCo3.js → creator.C5g4egeG.js} +43 -53
  13. package/dist/chunks/{defaults.D2ip7f-X.js → defaults.B1FCaFfh.js} +2 -2
  14. package/dist/chunks/{display.CXBnkt9a.js → display.BlTmubjj.js} +1 -1
  15. package/dist/chunks/{doctor.CpHPRoza.js → doctor.BK86Cncq.js} +40 -41
  16. package/dist/chunks/{env.DzFJjrmK.js → env.BKKtU2WC.js} +1 -1
  17. package/dist/chunks/{environment.d.DAj1Vt__.d.ts → environment.d.BY56MoGs.d.ts} +1 -1
  18. package/dist/chunks/{globals.9QtHn8Sr.js → globals.CXEE6_2C.js} +10 -10
  19. package/dist/chunks/{index.DpLw24bj.js → index.1TqnEahn.js} +7209 -19488
  20. package/dist/chunks/{index.DXQx-kDM.js → index.BoyTG_B7.js} +9 -4
  21. package/dist/chunks/{index.k8L_ZRzq.js → index.CK-t0WMg.js} +60 -53
  22. package/dist/chunks/{index.ggMXe2IF.js → index.CoUIxZd4.js} +7 -5
  23. package/dist/chunks/{index.cx-_w29y.js → index.D0heQG4v.js} +5 -3
  24. package/dist/chunks/{index.C4tKZ0yW.js → index.aTZaPVhf.js} +88 -68
  25. package/dist/chunks/{init-forks.hzLs7kMZ.js → init-forks.CRxIPOJR.js} +1 -1
  26. package/dist/chunks/{init-threads.COb0VD5D.js → init-threads.Dv3kwST_.js} +1 -1
  27. package/dist/chunks/{init.D0qF-GGk.js → init.PvxYpuCm.js} +7 -6
  28. package/dist/chunks/module-dependencies.CwNPkcV4.js +71 -0
  29. package/dist/chunks/{native.CBlba4VV.js → native.cdzHIdmv.js} +47 -33
  30. package/dist/chunks/{nativeModuleMocker.CXSh3m91.js → nativeModuleMocker.BxrHJNAF.js} +26 -5
  31. package/dist/chunks/{nativeModuleRunner.jwZPY3dg.js → nativeModuleRunner.xi64Afb2.js} +1 -1
  32. package/dist/chunks/{node.BzimPqT5.js → node.uQulW0ei.js} +1 -1
  33. package/dist/chunks/{pathe.M-eThtNZ.CknpM8Or.js → pathe.M-eThtNZ.Ba-7h1rE.js} +8 -6
  34. package/dist/chunks/{plugin.d.BsjqSb4-.d.ts → plugin.d.C8mmycim.d.ts} +88 -53
  35. package/dist/chunks/{plugins.D2ut1V9b.js → plugins.DPQHVT0p.js} +1 -1
  36. package/dist/chunks/{resolver.fbW9AUvG.js → resolver.CtCcxIy1.js} +1 -1
  37. package/dist/chunks/{rpc.BTmCtPly.js → rpc.DpkUyY1N.js} +2 -2
  38. package/dist/chunks/{rpc.d.BPFHl-HE.d.ts → rpc.d.Cft1biqy.d.ts} +2 -1
  39. package/dist/chunks/{run.BTlFXlnv.js → run.BPv-BBRv.js} +134 -110
  40. package/dist/chunks/{setup-common.BglbuAHD.js → setup-common.HGAqWOnX.js} +3 -3
  41. package/dist/chunks/{source-map.DUxvo12T.js → source-map.DdKI5IHB.js} +13 -4
  42. package/dist/chunks/{source-map.d.BLHtC2OB.d.ts → source-map.d.kzFtk_dj.d.ts} +1 -1
  43. package/dist/chunks/{spy.DgMTfhrK.js → spy.DDMXghXv.js} +45 -16
  44. package/dist/chunks/{task-utils.d.C-IeGxLU.d.ts → task-utils.d.PFh2BV6Q.d.ts} +1 -1
  45. package/dist/chunks/tinyrainbow.Do8I1XRG.js +88 -0
  46. package/dist/chunks/{utils.RcGwuOc_.js → utils.DSfl_w8V.js} +44 -42
  47. package/dist/chunks/{vm.vTyZj_02.js → vm.FGl2rw_t.js} +14 -11
  48. package/dist/chunks/{worker.d.Bt2A2mmi.d.ts → worker.d.BH-r1bPu.d.ts} +8 -3
  49. package/dist/cli.js +4 -4
  50. package/dist/config.cjs +1 -1
  51. package/dist/config.d.ts +9 -10
  52. package/dist/config.js +2 -2
  53. package/dist/index.d.ts +10 -10
  54. package/dist/index.js +10 -10
  55. package/dist/module-evaluator.d.ts +2 -2
  56. package/dist/module-evaluator.js +16 -12
  57. package/dist/node.d.ts +9 -10
  58. package/dist/node.js +26 -25
  59. package/dist/runtime.d.ts +4 -4
  60. package/dist/runtime.js +4 -4
  61. package/dist/spy.js +1 -1
  62. package/dist/task-utils.js +6 -4
  63. package/dist/worker.d.ts +4 -4
  64. package/dist/worker.js +21 -20
  65. package/dist/workers/forks.js +19 -18
  66. package/dist/workers/runVmTests.js +24 -14
  67. package/dist/workers/threads.js +19 -18
  68. package/dist/workers/vmForks.js +13 -13
  69. package/dist/workers/vmThreads.js +13 -13
  70. package/package.json +28 -27
  71. package/dist/chunks/cli-api.C4x4GGip.js +0 -528
  72. package/dist/chunks/tinyrainbow.Ht9iggcq.js +0 -95
@@ -2,12 +2,12 @@ import { readFileSync } from 'node:fs';
2
2
  import module$1, { isBuiltin } from 'node:module';
3
3
  import { pathToFileURL } from 'node:url';
4
4
  import { EvaluatedModules, ModuleRunner } from 'vite/module-runner';
5
- import { e as environments, b as VitestTransport } from './index.k8L_ZRzq.js';
6
- import { r as resolve } from './pathe.M-eThtNZ.CknpM8Or.js';
7
- import { b as serializeValue, c as createStackString, p as parseStacktrace } from './source-map.DUxvo12T.js';
8
- import { m } from './tinyrainbow.Ht9iggcq.js';
5
+ import { e as environments, b as VitestTransport } from './index.CK-t0WMg.js';
6
+ import { r as resolve } from './pathe.M-eThtNZ.Ba-7h1rE.js';
7
+ import { b as serializeValue, c as createStackString, p as parseStacktrace } from './source-map.DdKI5IHB.js';
8
+ import { w } from './tinyrainbow.Do8I1XRG.js';
9
9
  import { Traces } from '../traces.js';
10
- import { o as onCancel, V as VitestEvaluatedModules, a as rpcDone, c as createRuntimeRpc } from './rpc.BTmCtPly.js';
10
+ import { o as onCancel, V as VitestEvaluatedModules, a as rpcDone, c as createRuntimeRpc } from './rpc.DpkUyY1N.js';
11
11
  import { s as setupInspect } from './inspector.CvyFGlXm.js';
12
12
  import { E as EnvironmentTeardownError } from './utils.DYj33du9.js';
13
13
 
@@ -163,6 +163,7 @@ async function execute(method, ctx, worker, traces) {
163
163
  evaluatedModules: new VitestEvaluatedModules(),
164
164
  resolvingModules,
165
165
  moduleExecutionInfo: /* @__PURE__ */ new Map(),
166
+ dependencies: ctx.config.experimental.recordDependencies ? /* @__PURE__ */ new Set() : void 0,
166
167
  config: ctx.config,
167
168
  // this is set later by vm or base
168
169
  environment: null,
@@ -266,7 +267,7 @@ function init(worker) {
266
267
  process.env.VITEST_WORKER_ID = String(message.workerId);
267
268
  reportMemory = message.options.reportMemory;
268
269
  poolId = message.poolId;
269
- if (message.context.config.disableColors) m();
270
+ if (message.context.config.disableColors) w();
270
271
  traces ??= await new Traces({
271
272
  enabled: message.traces.enabled,
272
273
  sdkPath: message.traces.sdkPath
@@ -0,0 +1,71 @@
1
+ import module$1 from 'node:module';
2
+ import { fileURLToPath } from 'node:url';
3
+ import { s as slash } from './pathe.M-eThtNZ.Ba-7h1rE.js';
4
+ import { distDir } from '../path.js';
5
+
6
+ const vitestDistDir = `${slash(distDir)}/`;
7
+ /**
8
+ * Ids of the roots and of every module reachable from them through the runtime import edges.
9
+ */
10
+ function collectDependencies(getImports, ...roots) {
11
+ const visited = /* @__PURE__ */ new Set();
12
+ const queue = [];
13
+ for (const ids of roots) for (const id of ids) if (!visited.has(id)) {
14
+ visited.add(id);
15
+ queue.push(id);
16
+ }
17
+ while (queue.length) {
18
+ const imports = getImports(queue.pop());
19
+ if (!imports) continue;
20
+ for (const id of imports) if (!visited.has(id)) {
21
+ visited.add(id);
22
+ queue.push(id);
23
+ }
24
+ }
25
+ return Array.from(visited);
26
+ }
27
+ function getEvaluatedImports(evaluatedModules) {
28
+ return (id) => evaluatedModules.getModuleById(id)?.imports;
29
+ }
30
+ class NativeImportGraph {
31
+ imports = /* @__PURE__ */ new Map();
32
+ /**
33
+ * Returns the imported file, or `undefined` if the import is not tracked.
34
+ */
35
+ record(url, parentURL) {
36
+ if (!url.startsWith("file:") || url.includes("/node_modules/")) return;
37
+ const file = slash(fileURLToPath(url));
38
+ const importer = parentURL.startsWith("file:") ? slash(fileURLToPath(parentURL)) : parentURL;
39
+ // Vitest imports every test file, its edges would connect unrelated test files
40
+ if (!importer.startsWith(vitestDistDir)) {
41
+ let imports = this.imports.get(importer);
42
+ if (!imports) this.imports.set(importer, imports = /* @__PURE__ */ new Set());
43
+ imports.add(file);
44
+ }
45
+ return file;
46
+ }
47
+ getImports = (id) => this.imports.get(id);
48
+ }
49
+ /**
50
+ * Import edges of the modules loaded with native `import`, reported by a Node.js resolve hook.
51
+ * Node.js never loads a module twice, so the edges are kept as long as the thread runs.
52
+ */
53
+ const nativeImports = new NativeImportGraph();
54
+ let trackingNativeImports = false;
55
+ /**
56
+ * Registers a resolve hook that records the native imports of this thread.
57
+ * Returns `false` if the runtime has no synchronous module hooks.
58
+ */
59
+ function trackNativeImports() {
60
+ if (!trackingNativeImports && typeof module$1.registerHooks === "function") {
61
+ module$1.registerHooks({ resolve(specifier, context, nextResolve) {
62
+ const result = nextResolve(specifier, context);
63
+ if (context.parentURL) nativeImports.record(result.url, context.parentURL);
64
+ return result;
65
+ } });
66
+ trackingNativeImports = true;
67
+ }
68
+ return trackingNativeImports;
69
+ }
70
+
71
+ export { collectDependencies as c, getEvaluatedImports as g, nativeImports as n, trackNativeImports as t };
@@ -2,10 +2,10 @@ import module$1, { isBuiltin } from 'node:module';
2
2
  import { fileURLToPath } from 'node:url';
3
3
  import { MessageChannel } from 'node:worker_threads';
4
4
  import { initSyntaxLexers, hoistMocks } from '@vitest/mocker/transforms';
5
- import { c as cleanUrl, r as resolve } from './pathe.M-eThtNZ.CknpM8Or.js';
5
+ import { c as cleanUrl, r as resolve } from './pathe.M-eThtNZ.Ba-7h1rE.js';
6
6
  import { p as parse } from './acorn.C1kjbUFw.js';
7
7
  import MagicString from 'magic-string';
8
- import { y } from './tinyrainbow.Ht9iggcq.js';
8
+ import { $ } from './tinyrainbow.Do8I1XRG.js';
9
9
  import { distDir } from '../path.js';
10
10
  import { t as toBuiltin } from './modules.BJuCwlRJ.js';
11
11
  import 'node:path';
@@ -13,40 +13,53 @@ import 'node:path';
13
13
  const NOW_LENGTH = Date.now().toString().length;
14
14
  const REGEXP_VITEST = new RegExp(`%3Fvitest=\\d{${NOW_LENGTH}}`);
15
15
  const REGEXP_MOCK_ACTUAL = /\?mock=actual/;
16
- async function setupNodeLoaderHooks(worker) {
16
+ /**
17
+ * Returns `true` if `onImport` is called for every import, the hooks of `module.register` run in another thread
18
+ * and cannot report imports before the test file finishes.
19
+ */
20
+ async function setupNodeLoaderHooks(worker, onImport) {
17
21
  if (module$1.setSourceMapsSupport) module$1.setSourceMapsSupport(true);
18
22
  else if (process.setSourceMapsEnabled) process.setSourceMapsEnabled(true);
19
23
  if (worker.config.experimental.nodeLoader !== false) await initSyntaxLexers();
20
- if (typeof module$1.registerHooks === "function") module$1.registerHooks({
21
- resolve(specifier, context, nextResolve) {
22
- if (specifier.includes("mock=actual")) {
23
- // url is already resolved by `importActual`
24
- const moduleId = specifier.replace(REGEXP_MOCK_ACTUAL, "");
25
- const builtin = isBuiltin(moduleId);
26
- return {
27
- url: builtin ? toBuiltin(moduleId) : moduleId,
28
- format: builtin ? "builtin" : void 0,
29
- shortCircuit: true
30
- };
31
- }
32
- const isVitest = specifier.includes("%3Fvitest=");
33
- const result = nextResolve(isVitest ? specifier.replace(REGEXP_VITEST, "") : specifier, context);
34
- // avoid tracking /node_modules/ module graph for performance reasons
35
- if (context.parentURL && result.url && !result.url.includes("/node_modules/")) worker.rpc.ensureModuleGraphEntry(result.url, context.parentURL).catch(() => {
36
- // ignore errors
37
- });
38
- // this is require for in-source tests to be invalidated if
39
- // one of the files already imported it in --maxWorkers=1 --no-isolate
40
- if (isVitest) result.url = `${result.url}?vitest=${Date.now()}`;
41
- if (worker.config.experimental.nodeLoader === false || !context.parentURL || result.url.includes(distDir) || context.parentURL?.toString().includes(distDir)) return result;
42
- const mockedResult = getNativeMocker()?.resolveMockedModule(result.url, context.parentURL);
43
- if (mockedResult != null) return mockedResult;
44
- return result;
45
- },
46
- load: worker.config.experimental.nodeLoader === false ? void 0 : createLoadHook()
47
- });
48
- else if (module$1.register) {
49
- if (worker.config.experimental.nodeLoader !== false) console.warn(`${y.bgYellow(" WARNING ")} "module.registerHooks" is not supported in Node.js ${process.version}. This means that some features like module mocking or in-source testing are not supported. Upgrade your Node.js version to at least 22.15 or disable "experimental.nodeLoader" flag manually.\n`);
24
+ if (typeof module$1.registerHooks === "function") {
25
+ module$1.registerHooks({
26
+ resolve(specifier, context, nextResolve) {
27
+ if (specifier.includes("mock=actual")) {
28
+ // url is already resolved by `importActual`
29
+ const moduleId = specifier.replace(REGEXP_MOCK_ACTUAL, "");
30
+ const builtin = isBuiltin(moduleId);
31
+ return {
32
+ url: builtin ? toBuiltin(moduleId) : moduleId,
33
+ format: builtin ? "builtin" : void 0,
34
+ shortCircuit: true
35
+ };
36
+ }
37
+ const isVitest = specifier.includes("%3Fvitest=");
38
+ const result = nextResolve(isVitest ? specifier.replace(REGEXP_VITEST, "") : specifier, context);
39
+ // avoid tracking /node_modules/ module graph for performance reasons
40
+ if (context.parentURL && result.url && !result.url.includes("/node_modules/")) {
41
+ worker.rpc.ensureModuleGraphEntry(result.url, context.parentURL).catch(() => {
42
+ // ignore errors
43
+ });
44
+ onImport?.(result.url, context.parentURL);
45
+ }
46
+ // this is require for in-source tests to be invalidated if
47
+ // one of the files already imported it in --maxWorkers=1 --no-isolate
48
+ if (isVitest) result.url = `${result.url}?vitest=${Date.now()}`;
49
+ if (worker.config.experimental.nodeLoader === false || !context.parentURL || result.url.includes(distDir) || context.parentURL?.toString().includes(distDir)) return result;
50
+ const mockedResult = getNativeMocker()?.resolveMockedModule(result.url, context.parentURL);
51
+ if (mockedResult != null) {
52
+ // a `__mocks__` file is loaded in place of the module
53
+ onImport?.(mockedResult.url, context.parentURL);
54
+ return mockedResult;
55
+ }
56
+ return result;
57
+ },
58
+ load: worker.config.experimental.nodeLoader === false ? void 0 : createLoadHook()
59
+ });
60
+ return true;
61
+ } else if (module$1.register) {
62
+ if (worker.config.experimental.nodeLoader !== false) console.warn(`${$.bgYellow(" WARNING ")} "module.registerHooks" is not supported in Node.js ${process.version}. This means that some features like module mocking or in-source testing are not supported. Upgrade your Node.js version to at least 22.15 or disable "experimental.nodeLoader" flag manually.\n`);
50
63
  const { port1, port2 } = new MessageChannel();
51
64
  port1.unref();
52
65
  port2.unref();
@@ -68,6 +81,7 @@ async function setupNodeLoaderHooks(worker) {
68
81
  transferList: [port2]
69
82
  });
70
83
  } else if (!process.versions.deno && !process.versions.bun) console.warn("\"module.registerHooks\" and \"module.register\" are not supported. Some Vitest features may not work. Please, use Node.js 18.19.0 or higher.");
84
+ return false;
71
85
  }
72
86
  function replaceInSourceMarker(url, source, ms) {
73
87
  const re = /import\.meta\.vitest/g;
@@ -1,10 +1,10 @@
1
1
  import module$1, { isBuiltin } from 'node:module';
2
2
  import { fileURLToPath, pathToFileURL } from 'node:url';
3
3
  import { automockModule, createManualModuleSource, collectModuleExports } from '@vitest/mocker/transforms';
4
- import { c as cleanUrl, e as createDefer, i as isAbsolute } from './pathe.M-eThtNZ.CknpM8Or.js';
4
+ import { c as cleanUrl, e as createDefer, i as isAbsolute } from './pathe.M-eThtNZ.Ba-7h1rE.js';
5
5
  import { p as parse } from './acorn.C1kjbUFw.js';
6
6
  import { t as toBuiltin } from './modules.BJuCwlRJ.js';
7
- import { B as BareModuleMocker, n as normalizeModuleId } from './index.k8L_ZRzq.js';
7
+ import { B as BareModuleMocker, n as normalizeModuleId } from './index.CK-t0WMg.js';
8
8
  import 'node:fs';
9
9
  import './utils.DYj33du9.js';
10
10
  import '../path.js';
@@ -19,12 +19,15 @@ import 'node:console';
19
19
 
20
20
  class NativeModuleMocker extends BareModuleMocker {
21
21
  wrapDynamicImport(moduleFactory) {
22
- if (typeof moduleFactory === "function") return new Promise((resolve, reject) => {
22
+ if (typeof moduleFactory !== "function") return moduleFactory;
23
+ // Node.js can evaluate the module outside of the importer's async chain,
24
+ // so the stack of an import error would not point at the import
25
+ const importer = /* @__PURE__ */ new Error("import location");
26
+ return new Promise((resolve, reject) => {
23
27
  this.resolveMocks().finally(() => {
24
- moduleFactory().then(resolve, reject);
28
+ moduleFactory().then(resolve, (error) => reject(addImporterFrame(error, importer)));
25
29
  });
26
30
  });
27
- return moduleFactory;
28
31
  }
29
32
  resolveMockedModule(url, parentURL) {
30
33
  // don't mock modules inside of packages because there is
@@ -209,5 +212,23 @@ function transformCode(code, format, filename) {
209
212
  }
210
213
  return code;
211
214
  }
215
+ function addImporterFrame(error, importer) {
216
+ const lines = importer.stack?.split("\n") || [];
217
+ const index = lines.findIndex((line) => line.includes("wrapDynamicImport"));
218
+ const frame = index === -1 ? void 0 : lines[index + 1];
219
+ const file = frame?.match(/\(?([^()\s]+):\d+:\d+\)?$/)?.[1];
220
+ if (!frame || !file || frame.includes("node:")) return error;
221
+ const asyncFrame = frame.replace(/^(\s*)at /, "$1at async ");
222
+ const seen = /* @__PURE__ */ new Set();
223
+ let current = error;
224
+ while (current instanceof Error && !seen.has(current)) {
225
+ seen.add(current);
226
+ const stack = current.stack;
227
+ // older Node.js versions keep the async frame of the import themselves
228
+ if (typeof stack === "string" && !stack.split("\n").some((line) => line.includes("at async ") && line.includes(file))) current.stack = `${stack}\n${asyncFrame}`;
229
+ current = current.cause;
230
+ }
231
+ return error;
232
+ }
212
233
 
213
234
  export { NativeModuleMocker };
@@ -7,7 +7,7 @@ import fs from 'node:fs/promises';
7
7
  import assert from 'node:assert';
8
8
  import v8 from 'node:v8';
9
9
  import { format, inspect } from 'node:util';
10
- import { i as isAbsolute, r as resolve } from './pathe.M-eThtNZ.CknpM8Or.js';
10
+ import { i as isAbsolute, r as resolve } from './pathe.M-eThtNZ.Ba-7h1rE.js';
11
11
  import { ModuleRunner } from 'vite/module-runner';
12
12
 
13
13
  const JOIN_LEADING_SLASH_RE = /^\.?\//;
@@ -1,6 +1,6 @@
1
1
  import { g as getWorkerState } from './utils.DYj33du9.js';
2
2
  import { promises, existsSync } from 'node:fs';
3
- import { i as isAbsolute, r as resolve, d as dirname, j as join, b as basename } from './pathe.M-eThtNZ.CknpM8Or.js';
3
+ import { i as isAbsolute, r as resolve, d as dirname, j as join, b as basename } from './pathe.M-eThtNZ.Ba-7h1rE.js';
4
4
 
5
5
  class NodeSnapshotEnvironment {
6
6
  options;
@@ -113,11 +113,13 @@ function filterOutComments(s) {
113
113
  if (s[i] === "\n") commentState = "none";
114
114
  } else if (commentState === "multiline") {
115
115
  if (s[i - 1] === "*" && s[i] === "/") commentState = "none";
116
- } else if (commentState === "none") if (s[i] === "/" && s[i + 1] === "/") commentState = "singleline";
117
- else if (s[i] === "/" && s[i + 1] === "*") {
118
- commentState = "multiline";
119
- i += 2;
120
- } else result.push(s[i]);
116
+ } else if (commentState === "none") {
117
+ if (s[i] === "/" && s[i + 1] === "/") commentState = "singleline";
118
+ else if (s[i] === "/" && s[i + 1] === "*") {
119
+ commentState = "multiline";
120
+ i += 2;
121
+ } else result.push(s[i]);
122
+ }
121
123
  return result.join("");
122
124
  }
123
125
  const bareImportRE = /^(?![a-z]:)[\w@](?!.*:\/\/)/i;
@@ -487,4 +489,4 @@ const basename = function(p, extension) {
487
489
  return extension && lastSegment.endsWith(extension) ? lastSegment.slice(0, -extension.length) : lastSegment;
488
490
  };
489
491
 
490
- export { objectAttr as A, getCallLastIndex as B, CSS_LANGS_RE as C, noop as D, createSimpleStackTrace as E, withTrailingSlash as F, wrapId as G, isExternalUrl as H, unwrapId as I, deepMerge as J, KNOWN_ASSET_TYPES as K, sanitizeFilePath as L, relative as a, basename as b, cleanUrl as c, dirname as d, createDefer as e, extname as f, getType as g, KNOWN_ASSET_RE as h, isAbsolute as i, join as j, splitFileAndPostfix as k, isBareImport as l, isPrimitive as m, normalize as n, notNullish as o, deepClone as p, getOwnProperties as q, resolve as r, slash as s, toArray as t, isObject as u, filterOutComments as v, ordinal as w, assertTypes as x, isNegativeNaN as y, unique as z };
492
+ export { objectAttr as A, getCallLastIndex as B, CSS_LANGS_RE as C, noop as D, createSimpleStackTrace as E, sanitizeFilePath as F, deepMerge as G, withTrailingSlash as H, wrapId as I, isExternalUrl as J, KNOWN_ASSET_TYPES as K, unwrapId as L, relative as a, basename as b, cleanUrl as c, dirname as d, createDefer as e, extname as f, getType as g, KNOWN_ASSET_RE as h, isAbsolute as i, join as j, splitFileAndPostfix as k, isBareImport as l, isPrimitive as m, normalize as n, notNullish as o, deepClone as p, getOwnProperties as q, resolve as r, slash as s, toArray as t, isObject as u, filterOutComments as v, ordinal as w, assertTypes as x, isNegativeNaN as y, unique as z };
@@ -1,18 +1,17 @@
1
1
  import { DevEnvironment, IndexHtmlTransformContext, IndexHtmlTransformResult, ViteDevServer, UserConfig as UserConfig$1, Plugin, ResolvedConfig as ResolvedConfig$1, TransformResult as TransformResult$1, InlineConfig as InlineConfig$1, DepOptimizationConfig, ServerOptions, ConfigEnv, AliasOptions } from 'vite';
2
- import { aU as TaskMeta, U as UserConsoleLog, O as Suite, a as File, bi as SerializableRetry, T as TestError, g as TestAnnotation, h as TestArtifact, b0 as TestBenchmark, aJ as SerializedError, a0 as ImportDuration, m as Test, A as Awaitable, Y as CancelReason, P as ParsedStack, bj as BrowserTraceViewMode, a5 as BaselineData, o as ProvidedContext, b as SerializedConfig, bk as Arrayable, a2 as AfterSuiteRunMeta, aO as SnapshotStateOptions, aP as SnapshotSummary, aM as SnapshotResult, X as Task, bl as AsyncLeak, j as TaskResultPack, F as FileSpecification, l as SerializedRootConfig, L as LabelColor, c as SerializedDiffOptions, bg as SequenceSetupFiles, bf as SequenceHooks, bm as PrettyFormatOptions, C as Config, e as TestTagDefinition } from './config.d.BxjInJat.js';
2
+ import { aU as TaskMeta, U as UserConsoleLog, O as Suite, a as File, bi as SerializableRetry, T as TestError, g as TestAnnotation, h as TestArtifact, b0 as TestBenchmark, aJ as SerializedError, a0 as ImportDuration, m as Test, A as Awaitable, Y as CancelReason, P as ParsedStack, bj as BrowserTraceViewMode, a5 as BaselineData, o as ProvidedContext, b as SerializedConfig, bk as Arrayable, a2 as AfterSuiteRunMeta, aO as SnapshotStateOptions, aP as SnapshotSummary, aM as SnapshotResult, X as Task, bl as AsyncLeak, j as TaskResultPack, F as FileSpecification, l as SerializedRootConfig, L as LabelColor, c as SerializedDiffOptions, bg as SequenceSetupFiles, bf as SequenceHooks, bm as PrettyFormatOptions, C as Config, e as TestTagDefinition } from './config.d.QBNYCgFU.js';
3
3
  import { Writable } from 'node:stream';
4
- import { S as SerializedTestSpecification, B as BrowserTesterOptions, c as SourceModuleDiagnostic } from './browser.d.3cffPS1V.js';
4
+ import { S as SerializedTestSpecification, B as BrowserTesterOptions, c as SourceModuleDiagnostic } from './browser.d.FGQ9_rK6.js';
5
5
  import * as chai from 'chai';
6
6
  import { happyDomTypes, jsdomTypes } from 'vitest/optional-types.js';
7
- import { a as ContextTestEnvironment, b as WorkerExecuteContext, c as WorkerTestEnvironment } from './worker.d.Bt2A2mmi.js';
8
- import { O as OTELCarrier } from './rpc.d.BPFHl-HE.js';
7
+ import { a as ContextTestEnvironment, b as WorkerExecuteContext, c as WorkerTestEnvironment } from './worker.d.BH-r1bPu.js';
8
+ import { O as OTELCarrier } from './rpc.d.Cft1biqy.js';
9
9
  import { MockedModule } from '@vitest/mocker';
10
- import { S as StackTraceParserOptions, a as RuntimeCoverageProviderModule } from './source-map.d.BLHtC2OB.js';
10
+ import { S as StackTraceParserOptions, a as RuntimeCoverageProviderModule } from './source-map.d.kzFtk_dj.js';
11
11
  import { CDPSession, BrowserCommands, MarkOptions } from 'vitest/browser';
12
12
  import path from 'node:path';
13
13
  import { Console } from 'node:console';
14
14
  import { writeFile } from 'node:fs/promises';
15
- import { Stats } from 'node:fs';
16
15
 
17
16
  type ChaiConfig = Omit<Partial<typeof chai.config>, "useProxy" | "proxyExcludedKeys" | "deepEqual">;
18
17
 
@@ -530,7 +529,16 @@ interface BrowserProvider {
530
529
  parallel: boolean;
531
530
  }) => Promise<void>;
532
531
  getCDPSession?: (sessionId: string) => Promise<CDPSession>;
533
- close: () => Awaitable<void>;
532
+ close: (options?: BrowserProviderCloseOptions) => Awaitable<void>;
533
+ }
534
+ interface BrowserProviderCloseOptions {
535
+ /**
536
+ * The instance is closed to free a slot for another project and can be
537
+ * opened again later, so the provider may keep the browser process alive
538
+ * for the next instance instead of launching a new one.
539
+ * @default false
540
+ */
541
+ keepWarm?: boolean;
534
542
  }
535
543
  type BrowserBuiltinProvider = "webdriverio" | "playwright" | "preview";
536
544
  interface _BrowserNames {}
@@ -840,9 +848,14 @@ interface BrowserServerContribution {
840
848
  interface ProjectBrowser {
841
849
  vite: ViteDevServer;
842
850
  state: BrowserServerState;
843
- provider: BrowserProvider;
851
+ /**
852
+ * The provider of the open browser instance. It is `undefined` until the instance
853
+ * starts running tests and after the instance is closed to free a worker slot.
854
+ */
855
+ provider: BrowserProvider | undefined;
844
856
  close: () => Promise<void>;
845
857
  initBrowserProvider: (project: TestProject) => Promise<void>;
858
+ closeBrowserProvider: (options?: BrowserProviderCloseOptions) => Promise<void>;
846
859
  parseStacktrace: (stack: string) => ParsedStack[];
847
860
  parseErrorStacktrace: (error: TestError, options?: StackTraceParserOptions) => ParsedStack[];
848
861
  registerCommand: <K extends keyof BrowserCommands>(name: K, cb: BrowserCommand<Parameters<BrowserCommands[K]>, ReturnType<BrowserCommands[K]>>) => void;
@@ -1909,7 +1922,7 @@ interface CoverageOptions {
1909
1922
  excludeAfterRemap?: boolean;
1910
1923
  /**
1911
1924
  * Concurrency limit used when processing the coverage results.
1912
- * Defaults to `Math.min(20, os.availableParallelism?.() ?? os.cpus().length)`
1925
+ * Defaults to `Math.min(20, os.availableParallelism())`
1913
1926
  */
1914
1927
  processingConcurrency?: number;
1915
1928
  /**
@@ -2060,46 +2073,42 @@ declare class SnapshotManager {
2060
2073
  resolveRawPath(testPath: string, rawPath: string): string;
2061
2074
  }
2062
2075
 
2063
- interface SuiteResultCache {
2076
+ interface CachedTestFileResult {
2077
+ /**
2078
+ * The file has a known failure. Only a complete run of the file clears it.
2079
+ */
2064
2080
  failed: boolean;
2081
+ /**
2082
+ * Duration of the last complete run in milliseconds.
2083
+ * A file that never ran completely keeps the duration of its first recorded run.
2084
+ */
2065
2085
  duration: number;
2066
- }
2067
- declare class ResultsCache {
2068
- private logger;
2069
- private cache;
2070
- private workspacesKeyMap;
2071
- private cachePath;
2072
- private version;
2073
- private root;
2074
- constructor(logger: Logger);
2075
- getCachePath(): string | null;
2076
- setConfig(root: string, config: ResolvedConfig["cache"]): void;
2077
- getResults(key: string): SuiteResultCache | undefined;
2078
- clearCache(): Promise<void>;
2079
- readFromCache(): Promise<void>;
2080
- updateResults(files: File[]): void;
2081
- removeFromCache(filepath: string): void;
2082
- writeToCache(): Promise<void>;
2083
- }
2084
-
2085
- type FileStatsCache = Pick<Stats, "size">;
2086
- declare class FilesStatsCache {
2087
- cache: Map<string, FileStatsCache>;
2088
- getStats(key: string): FileStatsCache | undefined;
2089
- populateStats(root: string, specs: TestSpecification[]): Promise<void>;
2090
- updateStats(fsPath: string, key: string): Promise<void>;
2091
- removeStats(fsPath: string): void;
2086
+ /**
2087
+ * Unix timestamp in milliseconds of the start of the last complete run.
2088
+ * It is not set if the file never ran completely.
2089
+ */
2090
+ lastRun?: number;
2092
2091
  }
2093
2092
 
2094
2093
  declare class VitestCache {
2095
- results: ResultsCache;
2096
- stats: FilesStatsCache;
2097
- constructor(logger: Logger);
2098
- getFileTestResults(key: string): SuiteResultCache | undefined;
2094
+ private fileStats;
2095
+ private warnedMethods;
2096
+ /**
2097
+ * Returns the result of the test file from the previous test runs.
2098
+ */
2099
+ getTestSpecificationResult(specification: TestSpecification): CachedTestFileResult | undefined;
2100
+ /**
2101
+ * @deprecated Use `getTestSpecificationResult(specification)` instead.
2102
+ */
2103
+ getFileTestResults(key: string): CachedTestFileResult | undefined;
2104
+ /**
2105
+ * @deprecated Vitest does not cache file sizes anymore. Read the size from the file system instead.
2106
+ */
2099
2107
  getFileStats(key: string): {
2100
2108
  size: number;
2101
2109
  } | undefined;
2102
- static resolveCacheDir(root: string, dir?: string, projectName?: string): string;
2110
+ private readFileStats;
2111
+ private deprecate;
2103
2112
  }
2104
2113
 
2105
2114
  type TestRunEndReason = "passed" | "interrupted" | "failed";
@@ -2280,7 +2289,7 @@ declare class VitestWatcher {
2280
2289
  onFileChange: (id: string) => void;
2281
2290
  onFileDelete: (id: string) => void;
2282
2291
  onFileCreate: (id: string) => void;
2283
- private handleSetupFile;
2292
+ private handleProjectFile;
2284
2293
  /**
2285
2294
  * @returns A value indicating whether rerun is needed (changedTests was mutated)
2286
2295
  */
@@ -2365,7 +2374,7 @@ declare class Vitest {
2365
2374
  */
2366
2375
  snapshot: SnapshotManager;
2367
2376
  /**
2368
- * Test results and test file stats cache. Primarily used by the sequencer to sort tests.
2377
+ * The cache of the previous test runs. Primarily used by the sequencer to sort tests.
2369
2378
  */
2370
2379
  cache: VitestCache;
2371
2380
  private _warnedExperimentalCacheKeyGenerator;
@@ -2823,8 +2832,8 @@ declare abstract class BaseReporter implements Reporter {
2823
2832
  shouldLog(log: UserConsoleLog, taskState?: TestResult["state"]): boolean;
2824
2833
  onServerRestart(reason?: string): void;
2825
2834
  reportSummary(files: File[], errors: unknown[]): void;
2835
+ private printSourceFilterSummary;
2826
2836
  reportTestSummary(files: File[], errors: unknown[], leakCount: number): void;
2827
- private getEffectiveMaxWorkers;
2828
2837
  /**
2829
2838
  * Surfaces the cost of re-creating a DOM environment for every test file:
2830
2839
  * with an isolating pool, `jsdom`/`happy-dom` are imported and set up once
@@ -3360,6 +3369,21 @@ type ResolvedApiConfig = ApiConfig & {
3360
3369
  token: string;
3361
3370
  tokenCreated: boolean;
3362
3371
  };
3372
+ interface UIOptions {
3373
+ /**
3374
+ * Enable Vitest UI
3375
+ *
3376
+ * @default false
3377
+ */
3378
+ enabled?: boolean;
3379
+ /**
3380
+ * Color theme of Vitest UI and the browser mode UI. `auto` follows the system preference
3381
+ * and remembers the theme toggled in the UI. `dark` and `light` are applied on every page load.
3382
+ *
3383
+ * @default 'auto'
3384
+ */
3385
+ theme?: "dark" | "light" | "auto";
3386
+ }
3363
3387
  interface EnvironmentOptions {
3364
3388
  /**
3365
3389
  * jsdom options.
@@ -3793,7 +3817,7 @@ interface InlineConfig {
3793
3817
  *
3794
3818
  * @default false
3795
3819
  */
3796
- ui?: boolean;
3820
+ ui?: boolean | UIOptions;
3797
3821
  /**
3798
3822
  * options for test in a browser environment
3799
3823
  *
@@ -3899,12 +3923,13 @@ interface InlineConfig {
3899
3923
  */
3900
3924
  maxConcurrency?: number;
3901
3925
  /**
3902
- * Options for configuring cache policy.
3903
- * @default { dir: 'node_modules/.vite/vitest/{project-hash}' }
3926
+ * Store the results of test runs on the file system to run failed
3927
+ * and longer test files first. The cache is stored in Vite's "cacheDir".
3928
+ * @default true
3904
3929
  */
3905
- cache?: false | {
3930
+ cache?: boolean | {
3906
3931
  /**
3907
- * @deprecated Use Vite's "cacheDir" instead if you want to change the cache director. Note caches will be written to "cacheDir\/vitest".
3932
+ * @deprecated This option has no effect. Use Vite's "cacheDir" instead if you want to change the cache directory.
3908
3933
  */
3909
3934
  dir: string;
3910
3935
  };
@@ -3912,7 +3937,7 @@ interface InlineConfig {
3912
3937
  * Cache transformed modules on the file system and reuse them between reruns
3913
3938
  * and separate Vitest processes, which can significantly speed up cold starts.
3914
3939
  *
3915
- * @default false
3940
+ * @default true
3916
3941
  */
3917
3942
  fsModuleCache?: boolean;
3918
3943
  /**
@@ -4187,6 +4212,14 @@ interface InlineConfig {
4187
4212
  */
4188
4213
  vcsProvider?: VCSProvider | string;
4189
4214
  /**
4215
+ * Record the modules that every test file loads in the cache and use the records
4216
+ * with `--changed` and `--related` instead of walking the module graph statically.
4217
+ *
4218
+ * A test file without a record always runs.
4219
+ * @default false
4220
+ */
4221
+ recordDependencies?: boolean;
4222
+ /**
4190
4223
  * Parse test specifications before running them.
4191
4224
  * This will apply `.only` flag and test name pattern across all files without running them.
4192
4225
  */
@@ -4360,7 +4393,7 @@ interface UserConfig extends InlineConfig {
4360
4393
  type OnUnhandledErrorCallback = (error: (TestError | Error) & {
4361
4394
  type: string;
4362
4395
  }) => boolean | void;
4363
- interface ResolvedConfig extends Omit<Required<UserConfig>, "project" | "config" | "filters" | "browser" | "coverage" | "testNamePattern" | "related" | "api" | "reporters" | "resolveSnapshotPath" | "benchmark" | "shard" | "cache" | "sequence" | "typecheck" | "runner" | "pool" | "cliExclude" | "diff" | "setupFiles" | "snapshotEnvironment" | "bail" | "name" | "vmMemoryLimit" | "fileParallelism" | "tagsFilter" | "reporter"> {
4396
+ interface ResolvedConfig extends Omit<Required<UserConfig>, "project" | "config" | "filters" | "browser" | "coverage" | "testNamePattern" | "related" | "api" | "reporters" | "resolveSnapshotPath" | "benchmark" | "shard" | "cache" | "sequence" | "typecheck" | "runner" | "pool" | "cliExclude" | "diff" | "setupFiles" | "snapshotEnvironment" | "bail" | "name" | "vmMemoryLimit" | "fileParallelism" | "tagsFilter" | "reporter" | "ui"> {
4364
4397
  name: ProjectName["label"];
4365
4398
  color?: ProjectName["color"];
4366
4399
  base?: string;
@@ -4380,6 +4413,8 @@ interface ResolvedConfig extends Omit<Required<UserConfig>, "project" | "config"
4380
4413
  reporters: (InlineReporter | ReporterWithOptions)[];
4381
4414
  defines: Record<string, any>;
4382
4415
  api: ResolvedApiConfig;
4416
+ ui: boolean;
4417
+ uiOptions: Required<Omit<UIOptions, "enabled">>;
4383
4418
  cliExclude?: string[];
4384
4419
  project: string[];
4385
4420
  benchmark: ResolvedBenchmarkOptions;
@@ -4541,5 +4576,5 @@ interface VitestPluginContext {
4541
4576
  experimental_defineCacheKeyGenerator: (callback: CacheKeyIdGenerator) => void;
4542
4577
  }
4543
4578
 
4544
- export { Logger as L, MinimalReporter as M, PluginHarness as P, VerboseReporter as a$, DefaultReporter as a6, DotReporter as a8, TapFlatReporter as aE, TapReporter as aF, TestCase as aH, TestCollection as aI, TestModule as aK, TestSuite as aW, GithubActionsReporter as aa, HangingProcessReporter as ac, JUnitReporter as af, JsonReporter as ai, ReportersMap as ax, VitestPackageInstaller as b1, experimental_getRunnerTask as b4, startVitest as b5, Vitest as f, CoverageMap as h, TestProject as j, TestSpecification as m, BaseReporter as r };
4545
- export type { CoverageInstrumenter as $, ApiConfig as A, BaseCoverageOptions as B, CoverageOptions as C, BrowserProvider as D, BrowserProviderOption as E, FieldsWithDefaultValues as F, BrowserScript as G, BrowserServerContribution as H, InlineConfig as I, BrowserServerFactory as J, BrowserServerState as K, BrowserServerStateSession as N, BrowserTraceViewOptions as O, BuiltinEnvironment as Q, ResolvedConfig as R, BuiltinReporterOptions as S, TestProjectConfiguration as T, UserWorkspaceConfig as U, VitestPluginContext as V, WatcherTriggerPattern as W, BuiltinReporters as X, CSSModuleScopeStrategy as Y, CacheKeyIdGenerator as Z, CacheKeyIdGeneratorContext as _, UserProjectConfigFn as a, CoverageIstanbulOptions as a0, CoverageProvider as a1, CoverageProviderModule as a2, CoverageReporter as a3, CoverageV8Options as a4, CustomProviderOptions as a5, DepsOptimizationOptions as a7, EnvironmentOptions as a9, ResolvedBrowserOptions as aA, ResolvedProjectConfig as aB, SerializedTestProject as aC, SuiteNameTemplateVariables as aD, TaskOptions as aG, TestDiagnostic as aJ, TestModuleState as aL, TestResult as aM, TestResultFailed as aN, TestResultPassed as aO, TestResultPending as aP, TestResultSkipped as aQ, TestRunEndReason as aR, TestRunResult as aS, TestSequencerConstructor as aT, TestSpecificationOptions as aU, TestState as aV, TestSuiteState as aX, ToMatchScreenshotComparators as aY, ToMatchScreenshotOptions as aZ, TypecheckConfig as a_, HTMLOptions as ab, InstrumenterOptions as ad, JUnitOptions as ae, JsonAssertionResult as ag, JsonOptions as ah, JsonTestResult as aj, JsonTestResults as ak, ModuleDiagnostic as al, OnServerRestartHandler as am, OnTestsRerunHandler as an, ParentProjectBrowser as ao, Pool as ap, PoolRunnerInitializer as aq, PoolTask as ar, ProjectBrowser as as, ProjectConfig as at, Report as au, ReportedHookContext as av, Reporter as aw, ResolveSnapshotPathHandler as ay, ResolveSnapshotPathHandlerContext as az, UserProjectConfigExport as b, VitestEnvironment as b0, WorkerResponse as b2, _BrowserNames as b3, TestProjectInlineConfiguration as c, UserConfig as d, CliOptions as e, ResolvedCoverageOptions as g, ReportContext as i, VitestOptions as k, VitestRunMode as l, PoolWorker as n, PoolOptions as o, WorkerRequest as p, TestSequencer as q, BenchmarkUserOptions as s, BrowserBuiltinProvider as t, BrowserCommand as u, BrowserCommandContext as v, BrowserConfigOptions as w, BrowserInstanceOption as x, BrowserModuleMocker as y, BrowserOrchestrator as z };
4579
+ export { Logger as L, MinimalReporter as M, PluginHarness as P, DefaultReporter as a8, TapFlatReporter as aG, TapReporter as aH, TestCase as aJ, TestCollection as aK, TestModule as aM, TestSuite as aY, DotReporter as aa, GithubActionsReporter as ac, HangingProcessReporter as ae, JUnitReporter as ah, JsonReporter as ak, ReportersMap as az, VerboseReporter as b2, VitestPackageInstaller as b4, experimental_getRunnerTask as b7, startVitest as b8, Vitest as f, CoverageMap as h, TestProject as j, TestSpecification as m, BaseReporter as r };
4580
+ export type { CacheKeyIdGeneratorContext as $, ApiConfig as A, BaseCoverageOptions as B, CoverageOptions as C, BrowserProvider as D, BrowserProviderCloseOptions as E, FieldsWithDefaultValues as F, BrowserProviderOption as G, BrowserScript as H, InlineConfig as I, BrowserServerContribution as J, BrowserServerFactory as K, BrowserServerState as N, BrowserServerStateSession as O, BrowserTraceViewOptions as Q, ResolvedConfig as R, BuiltinEnvironment as S, TestProjectConfiguration as T, UserWorkspaceConfig as U, VitestPluginContext as V, WatcherTriggerPattern as W, BuiltinReporterOptions as X, BuiltinReporters as Y, CSSModuleScopeStrategy as Z, CacheKeyIdGenerator as _, UserProjectConfigFn as a, ToMatchScreenshotOptions as a$, CachedTestFileResult as a0, CoverageInstrumenter as a1, CoverageIstanbulOptions as a2, CoverageProvider as a3, CoverageProviderModule as a4, CoverageReporter as a5, CoverageV8Options as a6, CustomProviderOptions as a7, DepsOptimizationOptions as a9, ResolveSnapshotPathHandler as aA, ResolveSnapshotPathHandlerContext as aB, ResolvedBrowserOptions as aC, ResolvedProjectConfig as aD, SerializedTestProject as aE, SuiteNameTemplateVariables as aF, TaskOptions as aI, TestDiagnostic as aL, TestModuleState as aN, TestResult as aO, TestResultFailed as aP, TestResultPassed as aQ, TestResultPending as aR, TestResultSkipped as aS, TestRunEndReason as aT, TestRunResult as aU, TestSequencerConstructor as aV, TestSpecificationOptions as aW, TestState as aX, TestSuiteState as aZ, ToMatchScreenshotComparators as a_, EnvironmentOptions as ab, HTMLOptions as ad, InstrumenterOptions as af, JUnitOptions as ag, JsonAssertionResult as ai, JsonOptions as aj, JsonTestResult as al, JsonTestResults as am, ModuleDiagnostic as an, OnServerRestartHandler as ao, OnTestsRerunHandler as ap, ParentProjectBrowser as aq, Pool as ar, PoolRunnerInitializer as as, PoolTask as at, ProjectBrowser as au, ProjectConfig as av, Report as aw, ReportedHookContext as ax, Reporter as ay, UserProjectConfigExport as b, TypecheckConfig as b0, UIOptions as b1, VitestEnvironment as b3, WorkerResponse as b5, _BrowserNames as b6, TestProjectInlineConfiguration as c, UserConfig as d, CliOptions as e, ResolvedCoverageOptions as g, ReportContext as i, VitestOptions as k, VitestRunMode as l, PoolWorker as n, PoolOptions as o, WorkerRequest as p, TestSequencer as q, BenchmarkUserOptions as s, BrowserBuiltinProvider as t, BrowserCommand as u, BrowserCommandContext as v, BrowserConfigOptions as w, BrowserInstanceOption as x, BrowserModuleMocker as y, BrowserOrchestrator as z };
@@ -1,4 +1,4 @@
1
- import { p as plugins } from './index.cx-_w29y.js';
1
+ import { p as plugins } from './index.D0heQG4v.js';
2
2
 
3
3
  const serialize = (val, config, indentation, depth, refs, printer) => {
4
4
  // Serialize a non-default name, even if config.printFunctionName is false.
@@ -1,5 +1,5 @@
1
1
  import fs__default from 'node:fs';
2
- import { b as basename, j as join, d as dirname } from './pathe.M-eThtNZ.CknpM8Or.js';
2
+ import { b as basename, j as join, d as dirname } from './pathe.M-eThtNZ.Ba-7h1rE.js';
3
3
 
4
4
  const packageScopeTypeCache = /* @__PURE__ */ new Map();
5
5
  // mirrors LOOKUP_PACKAGE_SCOPE from the ESM resolution algorithm:
@@ -1,6 +1,6 @@
1
1
  import { EvaluatedModules } from 'vite/module-runner';
2
- import { d as dirname, r as resolve } from './pathe.M-eThtNZ.CknpM8Or.js';
3
- import { a as getSafeTimers } from './source-map.DUxvo12T.js';
2
+ import { d as dirname, r as resolve } from './pathe.M-eThtNZ.Ba-7h1rE.js';
3
+ import { a as getSafeTimers } from './source-map.DdKI5IHB.js';
4
4
  import { c as createBirpc } from './index.DmDMHCg8.js';
5
5
  import { g as getWorkerState } from './utils.DYj33du9.js';
6
6
 
@@ -1,4 +1,4 @@
1
- import { bt as FetchCachedFileSystemResult, bu as ResolveFunctionResult, U as UserConsoleLog, bl as AsyncLeak, a as File, a2 as AfterSuiteRunMeta, b0 as TestBenchmark, h as TestArtifact, j as TaskResultPack, k as TaskEventPack, Y as CancelReason, aM as SnapshotResult, a5 as BaselineData } from './config.d.BxjInJat.js';
1
+ import { bt as FetchCachedFileSystemResult, bu as ResolveFunctionResult, U as UserConsoleLog, bl as AsyncLeak, a as File, a2 as AfterSuiteRunMeta, b0 as TestBenchmark, h as TestArtifact, j as TaskResultPack, k as TaskEventPack, Y as CancelReason, aM as SnapshotResult, a5 as BaselineData } from './config.d.QBNYCgFU.js';
2
2
  import { FetchFunctionOptions, FetchResult } from 'vite/module-runner';
3
3
 
4
4
  interface OTELCarrier {
@@ -52,6 +52,7 @@ interface RuntimeRPC {
52
52
  onUserConsoleLog: (log: UserConsoleLog) => void;
53
53
  onUnhandledError: (err: unknown, type: string) => void;
54
54
  onAsyncLeaks: (leak: AsyncLeak[]) => void;
55
+ onTestModuleDependencies: (filepath: string, dependencies: string[]) => void;
55
56
  onQueued: (file: File) => void;
56
57
  onCollected: (files: File[]) => Promise<void>;
57
58
  onAfterSuiteRun: (meta: AfterSuiteRunMeta) => void;