vitest 4.0.4 → 4.0.6

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 +3 -3
  2. package/dist/chunks/{base.B04-CjXH.js → base.BAf_bYeI.js} +1 -1
  3. package/dist/chunks/{browser.d.B9iJzZyn.d.ts → browser.d.ScGeWTou.d.ts} +1 -1
  4. package/dist/chunks/{cac.39_DDnyx.js → cac.BBqWH4nd.js} +6 -6
  5. package/dist/chunks/{cli-api.BxbUFDR6.js → cli-api.UL3SwFUb.js} +69 -27
  6. package/dist/chunks/{config.d.u2CUDWwS.d.ts → config.d.BTfZNUu9.d.ts} +0 -1
  7. package/dist/chunks/{coverage.CSfvENE1.js → coverage.DuCn_Tmx.js} +10 -23
  8. package/dist/chunks/{global.d.BgJSTpgQ.d.ts → global.d.DdOkMiVb.d.ts} +1 -1
  9. package/dist/chunks/{index.CcRZ6fUh.js → index.BL8Hg4Uk.js} +2 -1
  10. package/dist/chunks/{index.BdSLhLDZ.js → index.CpdwpN7L.js} +1 -1
  11. package/dist/chunks/{index.DON9WL-E.js → index.DV0mQLEO.js} +26 -6
  12. package/dist/chunks/{init-forks.D3tMfiuX.js → init-forks.CSGFj9zN.js} +1 -1
  13. package/dist/chunks/{init-threads.yLRZD8Id.js → init-threads.CIJLeFO8.js} +1 -1
  14. package/dist/chunks/{init.CfeGZ8J3.js → init.DUeOfNO9.js} +2 -2
  15. package/dist/chunks/{moduleRunner.d.YtNsMIoJ.d.ts → moduleRunner.d.TP-w6tIQ.d.ts} +1 -1
  16. package/dist/chunks/{plugin.d.D8LgBgbU.d.ts → plugin.d.lctzD3Wk.d.ts} +1 -1
  17. package/dist/chunks/{reporters.d.D-el0219.d.ts → reporters.d.PEs0tXod.d.ts} +4 -5
  18. package/dist/chunks/{startModuleRunner.iF1E9Bt4.js → startModuleRunner.Di-EZqh0.js} +15 -3
  19. package/dist/chunks/{vm.CuMWYx_F.js → vm.Co_lR2NL.js} +1 -1
  20. package/dist/chunks/{worker.d.BFk-vvBU.d.ts → worker.d.B4Hthdvt.d.ts} +1 -1
  21. package/dist/cli.js +2 -2
  22. package/dist/config.d.ts +6 -6
  23. package/dist/coverage.d.ts +4 -4
  24. package/dist/coverage.js +1 -1
  25. package/dist/environments.js +1 -1
  26. package/dist/index.d.ts +8 -8
  27. package/dist/module-evaluator.d.ts +3 -3
  28. package/dist/module-runner.js +1 -1
  29. package/dist/node.d.ts +9 -9
  30. package/dist/node.js +7 -7
  31. package/dist/reporters.d.ts +4 -4
  32. package/dist/reporters.js +2 -2
  33. package/dist/runners.d.ts +1 -1
  34. package/dist/worker.d.ts +2 -2
  35. package/dist/worker.js +4 -4
  36. package/dist/workers/forks.js +5 -5
  37. package/dist/workers/threads.js +5 -5
  38. package/dist/workers/vmForks.js +5 -5
  39. package/dist/workers/vmThreads.js +5 -5
  40. package/package.json +12 -12
package/dist/browser.d.ts CHANGED
@@ -1,7 +1,7 @@
1
- import { a as SerializedCoverageConfig, S as SerializedConfig } from './chunks/config.d.u2CUDWwS.js';
1
+ import { a as SerializedCoverageConfig, S as SerializedConfig } from './chunks/config.d.BTfZNUu9.js';
2
2
  import { R as RuntimeCoverageModuleLoader } from './chunks/coverage.d.BZtK59WP.js';
3
3
  import { SerializedDiffOptions } from '@vitest/utils/diff';
4
- import { V as VitestModuleRunner } from './chunks/moduleRunner.d.YtNsMIoJ.js';
4
+ import { V as VitestModuleRunner } from './chunks/moduleRunner.d.TP-w6tIQ.js';
5
5
  export { collectTests, startTests } from '@vitest/runner';
6
6
  import * as _vitest_spy from '@vitest/spy';
7
7
  export { _vitest_spy as SpyModule };
@@ -15,7 +15,7 @@ import '@vitest/pretty-format';
15
15
  import '@vitest/snapshot';
16
16
  import 'node:vm';
17
17
  import 'vite/module-runner';
18
- import './chunks/worker.d.BFk-vvBU.js';
18
+ import './chunks/worker.d.B4Hthdvt.js';
19
19
  import './chunks/environment.d.CrsxCzP1.js';
20
20
  import '@vitest/mocker';
21
21
  import './chunks/mocker.d.BE_2ls6u.js';
@@ -1,7 +1,7 @@
1
1
  import { runInThisContext } from 'node:vm';
2
2
  import * as spyModule from '@vitest/spy';
3
3
  import { V as VitestEvaluatedModules } from './evaluatedModules.Dg1zASAC.js';
4
- import { s as startVitestModuleRunner, c as createNodeImportMeta } from './startModuleRunner.iF1E9Bt4.js';
4
+ import { s as startVitestModuleRunner, c as createNodeImportMeta } from './startModuleRunner.Di-EZqh0.js';
5
5
  import { performance } from 'node:perf_hooks';
6
6
  import { startTests, collectTests } from '@vitest/runner';
7
7
  import { a as resolveSnapshotEnvironment, s as setupChaiConfig, r as resolveTestRunner } from './resolveSnapshotEnvironment.BZzLjzkh.js';
@@ -1,5 +1,5 @@
1
1
  import { FileSpecification } from '@vitest/runner';
2
- import { T as TestExecutionMethod } from './worker.d.BFk-vvBU.js';
2
+ import { T as TestExecutionMethod } from './worker.d.B4Hthdvt.js';
3
3
 
4
4
  type SerializedTestSpecification = [project: {
5
5
  name: string | undefined;
@@ -3,7 +3,7 @@ import { EventEmitter } from 'events';
3
3
  import { normalize } from 'pathe';
4
4
  import c from 'tinyrainbow';
5
5
  import { a as defaultPort, d as defaultBrowserPort } from './constants.D_Q9UYh-.js';
6
- import { R as ReportersMap } from './index.CcRZ6fUh.js';
6
+ import { R as ReportersMap } from './index.BL8Hg4Uk.js';
7
7
 
8
8
  function toArr(any) {
9
9
  return any == null ? [] : Array.isArray(any) ? any : [any];
@@ -619,7 +619,7 @@ class CAC extends EventEmitter {
619
619
 
620
620
  const cac = (name = "") => new CAC(name);
621
621
 
622
- var version = "4.0.4";
622
+ var version = "4.0.6";
623
623
 
624
624
  const apiConfig = (port) => ({
625
625
  port: {
@@ -1294,10 +1294,10 @@ function normalizeCliOptions(cliFilters, argv) {
1294
1294
  }
1295
1295
  async function start(mode, cliFilters, options) {
1296
1296
  try {
1297
- const { startVitest } = await import('./cli-api.BxbUFDR6.js').then(function (n) { return n.p; }), ctx = await startVitest(mode, cliFilters.map(normalize), normalizeCliOptions(cliFilters, options));
1297
+ const { startVitest } = await import('./cli-api.UL3SwFUb.js').then(function (n) { return n.p; }), ctx = await startVitest(mode, cliFilters.map(normalize), normalizeCliOptions(cliFilters, options));
1298
1298
  if (!ctx.shouldKeepServer()) await ctx.exit();
1299
1299
  } catch (e) {
1300
- const { errorBanner } = await import('./index.CcRZ6fUh.js').then(function (n) { return n.u; });
1300
+ const { errorBanner } = await import('./index.BL8Hg4Uk.js').then(function (n) { return n.u; });
1301
1301
  if (console.error(`\n${errorBanner("Startup Error")}`), console.error(e), console.error("\n\n"), process.exitCode == null) process.exitCode = 1;
1302
1302
  process.exit();
1303
1303
  }
@@ -1309,7 +1309,7 @@ async function init(project) {
1309
1309
  }
1310
1310
  async function collect(mode, cliFilters, options) {
1311
1311
  try {
1312
- const { prepareVitest, processCollected, outputFileList } = await import('./cli-api.BxbUFDR6.js').then(function (n) { return n.p; }), ctx = await prepareVitest(mode, {
1312
+ const { prepareVitest, processCollected, outputFileList } = await import('./cli-api.UL3SwFUb.js').then(function (n) { return n.p; }), ctx = await prepareVitest(mode, {
1313
1313
  ...normalizeCliOptions(cliFilters, options),
1314
1314
  watch: false,
1315
1315
  run: true
@@ -1327,7 +1327,7 @@ async function collect(mode, cliFilters, options) {
1327
1327
  }
1328
1328
  await ctx.close();
1329
1329
  } catch (e) {
1330
- const { errorBanner } = await import('./index.CcRZ6fUh.js').then(function (n) { return n.u; });
1330
+ const { errorBanner } = await import('./index.BL8Hg4Uk.js').then(function (n) { return n.u; });
1331
1331
  if (console.error(`\n${errorBanner("Collect Error")}`), console.error(e), console.error("\n\n"), process.exitCode == null) process.exitCode = 1;
1332
1332
  process.exit();
1333
1333
  }
@@ -4,6 +4,7 @@ import { C as CoverageProviderMap } from './coverage.D_JHT54q.js';
4
4
  import path, { resolve as resolve$1 } from 'node:path';
5
5
  import { noop, createDefer, slash, isExternalUrl, unwrapId, nanoid, withTrailingSlash, cleanUrl, wrapId, toArray, deepMerge, deepClone, isPrimitive, notNullish } from '@vitest/utils/helpers';
6
6
  import { a as any, p as prompt } from './index.Dc3xnDvT.js';
7
+ import { h as hash, R as RandomSequencer, i as isPackageExists, c as isBrowserEnabled, r as resolveConfig, g as getCoverageProvider, a as resolveApiServerConfig, d as resolveModule } from './coverage.DuCn_Tmx.js';
7
8
  import * as vite from 'vite';
8
9
  import { parseAst, fetchModule, version, searchForWorkspaceRoot, mergeConfig, createServer } from 'vite';
9
10
  import { A as API_PATH, c as configFiles, d as defaultBrowserPort, a as defaultPort } from './constants.D_Q9UYh-.js';
@@ -11,9 +12,9 @@ import * as nodeos from 'node:os';
11
12
  import nodeos__default, { tmpdir } from 'node:os';
12
13
  import { generateHash as generateHash$1, calculateSuiteHash, someTasksAreOnly, interpretTaskModes, hasFailed, generateFileHash, limitConcurrency, createFileTask as createFileTask$1, getTasks, isTestCase } from '@vitest/runner/utils';
13
14
  import { SnapshotManager } from '@vitest/snapshot/manager';
14
- import { v as version$1 } from './cac.39_DDnyx.js';
15
+ import { v as version$1 } from './cac.BBqWH4nd.js';
15
16
  import { c as createBirpc } from './index.Bgo3tNWt.js';
16
- import { p as parse, d as stringify, e as TraceMap, o as originalPositionFor, h as ancestor, i as printError, f as formatProjectName, w as withLabel, j as errorBanner, k as divider, l as Typechecker, m as generateCodeFrame, n as createDefinesScript, R as ReportersMap, B as BlobReporter, r as readBlobs, q as convertTasksToEvents, H as HangingProcessReporter } from './index.CcRZ6fUh.js';
17
+ import { p as parse, d as stringify, e as TraceMap, o as originalPositionFor, h as ancestor, i as printError, f as formatProjectName, w as withLabel, j as errorBanner, k as divider, l as Typechecker, m as generateCodeFrame, n as createDefinesScript, R as ReportersMap, B as BlobReporter, r as readBlobs, q as convertTasksToEvents, H as HangingProcessReporter } from './index.BL8Hg4Uk.js';
17
18
  import require$$0$3 from 'events';
18
19
  import require$$1$1 from 'https';
19
20
  import require$$2 from 'http';
@@ -28,14 +29,13 @@ import { g as getDefaultExportFromCjs } from './_commonjsHelpers.BFTU3MAI.js';
28
29
  import crypto, { createHash } from 'node:crypto';
29
30
  import { rootDir, distDir } from '../path.js';
30
31
  import createDebug from 'debug';
31
- import { h as hash, R as RandomSequencer, i as isPackageExists, c as isBrowserEnabled, r as resolveConfig, g as getCoverageProvider, a as resolveApiServerConfig } from './coverage.CSfvENE1.js';
32
32
  import { readFile, writeFile, rename, stat, unlink, rm, mkdir, copyFile } from 'node:fs/promises';
33
- import { builtinModules, createRequire, isBuiltin } from 'node:module';
34
33
  import { VitestModuleEvaluator } from '#module-evaluator';
35
34
  import { ModuleRunner } from 'vite/module-runner';
36
35
  import { Console } from 'node:console';
37
36
  import c from 'tinyrainbow';
38
37
  import { highlight } from '@vitest/utils/highlight';
38
+ import { createRequire, isBuiltin, builtinModules } from 'node:module';
39
39
  import url, { fileURLToPath, pathToFileURL } from 'node:url';
40
40
  import { i as isTTY, a as isWindows } from './env.D4Lgay0q.js';
41
41
  import { isatty } from 'node:tty';
@@ -51,7 +51,7 @@ import { c as configDefaults } from './defaults.BOqNVLsY.js';
51
51
  import { KNOWN_ASSET_RE } from '@vitest/utils/constants';
52
52
  import { findNearestPackageData } from '@vitest/utils/resolver';
53
53
  import * as esModuleLexer from 'es-module-lexer';
54
- import { a as BenchmarkReportsMap } from './index.BdSLhLDZ.js';
54
+ import { a as BenchmarkReportsMap } from './index.CpdwpN7L.js';
55
55
  import assert$1 from 'node:assert';
56
56
  import { serializeValue } from '@vitest/utils/serialize';
57
57
  import { parseErrorStacktrace } from '@vitest/utils/source-map';
@@ -5817,7 +5817,6 @@ function normalizeResolvedIdToUrl(environment, resolvedId) {
5817
5817
  return url;
5818
5818
  }
5819
5819
 
5820
- const nodeBuiltins = builtinModules.filter((id) => !id.includes(":"));
5821
5820
  class ServerModuleRunner extends ModuleRunner {
5822
5821
  constructor(environment, fetcher, config) {
5823
5822
  super({
@@ -5825,7 +5824,7 @@ class ServerModuleRunner extends ModuleRunner {
5825
5824
  transport: { async invoke(event) {
5826
5825
  if (event.type !== "custom") throw new Error(`Vitest Module Runner doesn't support Vite HMR events.`);
5827
5826
  const { name, data } = event.data;
5828
- if (name === "getBuiltins") return { result: [...nodeBuiltins, /^node:/] };
5827
+ if (name === "getBuiltins") return await environment.hot.handleInvoke(event);
5829
5828
  if (name !== "fetchModule") return { error: /* @__PURE__ */ new Error(`Unknown method: ${name}. Expected "fetchModule".`) };
5830
5829
  try {
5831
5830
  return { result: await fetcher(data[0], data[1], environment, false, data[2]) };
@@ -6980,7 +6979,7 @@ function createPool(ctx) {
6980
6979
  }
6981
6980
  const taskGroups = [];
6982
6981
  let workerId = 0;
6983
- const sorted = await sequencer.sort(specs), environments = await getSpecificationsEnvironments(specs), groups = groupSpecs(sorted), projectEnvs = /* @__PURE__ */ new WeakMap(), projectExecArgvs = /* @__PURE__ */ new WeakMap();
6982
+ const sorted = await sequencer.sort(specs), environments = await getSpecificationsEnvironments(specs), groups = groupSpecs(sorted, environments), projectEnvs = /* @__PURE__ */ new WeakMap(), projectExecArgvs = /* @__PURE__ */ new WeakMap();
6984
6983
  for (const group of groups) {
6985
6984
  if (!group) continue;
6986
6985
  const taskGroup = [], browserSpecs = [];
@@ -7104,27 +7103,42 @@ function getMemoryLimit(config, pool) {
7104
7103
  // just ignore "memoryLimit" value because we cannot detect memory limit
7105
7104
  return typeof memory === "number" ? stringToBytes(limit, config.watch ? memory / 2 : memory) : typeof limit === "number" && limit > 1 || typeof limit === "string" && limit.at(-1) !== "%" ? stringToBytes(limit) : null;
7106
7105
  }
7107
- function groupSpecs(specs) {
7106
+ function groupSpecs(specs, environments) {
7108
7107
  const groups = [], sequential = {
7109
7108
  specs: [],
7110
7109
  maxWorkers: 1
7111
- }, typechecks = {};
7110
+ }, typechecks = {}, serializedEnvironmentOptions = /* @__PURE__ */ new Map();
7111
+ function getSerializedOptions(env) {
7112
+ const options = serializedEnvironmentOptions.get(env);
7113
+ if (options) return options;
7114
+ const serialized = JSON.stringify(env.options);
7115
+ return serializedEnvironmentOptions.set(env, serialized), serialized;
7116
+ }
7117
+ function isEqualEnvironments(a, b) {
7118
+ const aEnv = environments.get(a), bEnv = environments.get(b);
7119
+ return !aEnv && !bEnv ? true : !aEnv || !bEnv || aEnv.name !== bEnv.name ? false : !aEnv.options && !bEnv.options ? true : !aEnv.options || !bEnv.options ? false : getSerializedOptions(aEnv) === getSerializedOptions(bEnv);
7120
+ }
7112
7121
  specs.forEach((spec) => {
7113
7122
  if (spec.pool === "typescript") {
7114
7123
  typechecks[spec.project.name] ||= [], typechecks[spec.project.name].push(spec);
7115
7124
  return;
7116
7125
  }
7117
- const order = spec.project.config.sequence.groupOrder;
7118
- // Files that have disabled parallelism and default groupId are set into their own group
7119
- if (order === 0 && spec.project.config.fileParallelism === false) return sequential.specs.push([spec]);
7126
+ const order = spec.project.config.sequence.groupOrder, isolate = spec.project.config.isolate;
7127
+ // Files that have disabled parallelism and default groupOrder are set into their own group
7128
+ if (isolate === true && order === 0 && spec.project.config.maxWorkers === 1) return sequential.specs.push([spec]);
7120
7129
  const maxWorkers = resolveMaxWorkers(spec.project);
7121
- // Multiple projects with different maxWorkers but same groupId
7130
+ // Multiple projects with different maxWorkers but same groupOrder
7122
7131
  if (groups[order] ||= {
7123
7132
  specs: [],
7124
7133
  maxWorkers
7125
7134
  }, groups[order].maxWorkers !== maxWorkers) {
7126
7135
  const last = groups[order].specs.at(-1)?.at(-1)?.project.name;
7127
- throw new Error(`Projects "${last}" and "${spec.project.name}" have different 'maxWorkers' but same 'sequence.groupId'.\nProvide unique 'sequence.groupId' for them.`);
7136
+ throw new Error(`Projects "${last}" and "${spec.project.name}" have different 'maxWorkers' but same 'sequence.groupOrder'.\nProvide unique 'sequence.groupOrder' for them.`);
7137
+ }
7138
+ // Non-isolated single worker can receive all files at once
7139
+ if (isolate === false && maxWorkers === 1) {
7140
+ const previous = groups[order].specs[0]?.[0];
7141
+ if (previous && previous.project.name === spec.project.name && isEqualEnvironments(spec, previous)) return groups[order].specs[0].push(spec);
7128
7142
  }
7129
7143
  groups[order].specs.push([spec]);
7130
7144
  });
@@ -7148,7 +7162,6 @@ function serializeConfig(project) {
7148
7162
  environmentOptions: config.environmentOptions,
7149
7163
  mode: config.mode,
7150
7164
  isolate: config.isolate,
7151
- fileParallelism: config.fileParallelism,
7152
7165
  maxWorkers: config.maxWorkers,
7153
7166
  base: config.base,
7154
7167
  logHeapUsage: config.logHeapUsage,
@@ -8058,6 +8071,15 @@ function ModuleRunnerTransform() {
8058
8071
  names.add("client"), names.add("ssr");
8059
8072
  const pool = config.test?.pool;
8060
8073
  if (pool === "vmForks" || pool === "vmThreads") names.add("__vitest_vm__");
8074
+ let moduleDirectories = testConfig.deps?.moduleDirectories || [];
8075
+ const envModuleDirectories = process.env.VITEST_MODULE_DIRECTORIES || process.env.npm_config_VITEST_MODULE_DIRECTORIES;
8076
+ if (envModuleDirectories) moduleDirectories.push(...envModuleDirectories.split(","));
8077
+ if (moduleDirectories = moduleDirectories.map((dir) => {
8078
+ if (dir[0] !== "/") dir = `/${dir}`;
8079
+ if (!dir.endsWith("/")) dir += "/";
8080
+ return normalize(dir);
8081
+ }), !moduleDirectories.includes("/node_modules/")) moduleDirectories.push("/node_modules/");
8082
+ testConfig.deps ??= {}, testConfig.deps.moduleDirectories = moduleDirectories;
8061
8083
  const external = [], noExternal = [];
8062
8084
  let noExternalAll;
8063
8085
  for (const name of names) {
@@ -8070,11 +8092,20 @@ function ModuleRunnerTransform() {
8070
8092
  const resolveExternal = name === "client" ? config.resolve?.external : [], resolveNoExternal = name === "client" ? config.resolve?.noExternal : [], topLevelResolveOptions = {};
8071
8093
  if (resolveExternal != null) topLevelResolveOptions.external = resolveExternal;
8072
8094
  if (resolveNoExternal != null) topLevelResolveOptions.noExternal = resolveNoExternal;
8073
- const currentResolveOptions = mergeConfig(topLevelResolveOptions, environment.resolve || {}), envNoExternal = resolveViteResolveOptions("noExternal", currentResolveOptions);
8095
+ const currentResolveOptions = mergeConfig(topLevelResolveOptions, environment.resolve || {}), envNoExternal = resolveViteResolveOptions("noExternal", currentResolveOptions, moduleDirectories);
8074
8096
  if (envNoExternal === true) noExternalAll = true;
8075
- else noExternal.push(...envNoExternal);
8076
- const envExternal = resolveViteResolveOptions("external", currentResolveOptions);
8077
- if (envExternal !== true) external.push(...envExternal);
8097
+ else if (envNoExternal.length) noExternal.push(...envNoExternal);
8098
+ else if (name === "client" || name === "ssr") {
8099
+ const deprecatedNoExternal = resolveDeprecatedOptions(name === "client" ? config.resolve?.noExternal : config.ssr?.noExternal, moduleDirectories);
8100
+ if (deprecatedNoExternal === true) noExternalAll = true;
8101
+ else noExternal.push(...deprecatedNoExternal);
8102
+ }
8103
+ const envExternal = resolveViteResolveOptions("external", currentResolveOptions, moduleDirectories);
8104
+ if (envExternal !== true && envExternal.length) external.push(...envExternal);
8105
+ else if (name === "client" || name === "ssr") {
8106
+ const deprecatedExternal = resolveDeprecatedOptions(name === "client" ? config.resolve?.external : config.ssr?.external, moduleDirectories);
8107
+ if (deprecatedExternal !== true) external.push(...deprecatedExternal);
8108
+ }
8078
8109
  if (environment.resolve ??= {}, environment.resolve.external = [...builtinModules, ...builtinModules.map((m) => `node:${m}`)], environment.resolve.noExternal = true, name === "__vitest_vm__" || name === "__vitest__") continue;
8079
8110
  const currentOptimizeDeps = environment.optimizeDeps || (name === "client" ? config.optimizeDeps : name === "ssr" ? config.ssr?.optimizeDeps : void 0), optimizeDeps = resolveOptimizerConfig(testConfig.deps?.optimizer?.[name], currentOptimizeDeps);
8080
8111
  // Vite respects the root level optimize deps, so we override it instead
@@ -8091,8 +8122,19 @@ function ModuleRunnerTransform() {
8091
8122
  }
8092
8123
  };
8093
8124
  }
8094
- function resolveViteResolveOptions(key, options) {
8095
- return Array.isArray(options[key]) ? options[key] : typeof options[key] === "string" || options[key] instanceof RegExp ? [options[key]] : typeof options[key] === "boolean" ? true : [];
8125
+ function resolveViteResolveOptions(key, options, moduleDirectories) {
8126
+ return Array.isArray(options[key]) ? options[key].some((p) => p === true) ? true : options[key].map((dep) => processWildcard(dep, moduleDirectories)) : typeof options[key] === "string" || options[key] instanceof RegExp ? [options[key]].map((dep) => processWildcard(dep, moduleDirectories)) : typeof options[key] === "boolean" ? true : [];
8127
+ }
8128
+ function resolveDeprecatedOptions(options, moduleDirectories) {
8129
+ return options === true ? true : Array.isArray(options) ? options.map((dep) => processWildcard(dep, moduleDirectories)) : options == null ? [] : [processWildcard(options, moduleDirectories)];
8130
+ }
8131
+ function processWildcard(dep, moduleDirectories) {
8132
+ if (typeof dep !== "string") return dep;
8133
+ if (typeof dep === "string" && dep.includes("*")) {
8134
+ const directories = (moduleDirectories || ["/node_modules/"]).map((r) => escapeRegExp(r));
8135
+ return /* @__PURE__ */ new RegExp(`(${directories.join("|")})${dep.replace(/\*/g, "[\\w/]+")}`);
8136
+ }
8137
+ return dep;
8096
8138
  }
8097
8139
 
8098
8140
  function VitestProjectResolver(ctx) {
@@ -8324,14 +8366,14 @@ async function _shouldExternalize(id, options) {
8324
8366
  // also externalize network imports since nodejs allows it when --experimental-network-imports
8325
8367
  if (isBuiltin(id) || id.startsWith("data:") || /^(?:https?:)?\/\//.test(id)) return id;
8326
8368
  const moduleDirectories = options?.moduleDirectories || ["/node_modules/"];
8327
- if (matchExternalizePattern(id, moduleDirectories, options?.inline) || options?.inlineFiles && options?.inlineFiles.includes(id)) return false;
8369
+ if (matchPattern(id, moduleDirectories, options?.inline) || options?.inlineFiles && options?.inlineFiles.includes(id)) return false;
8328
8370
  // Unless the user explicitly opted to inline them, externalize Vite deps.
8329
8371
  // They are too big to inline by default.
8330
- if (matchExternalizePattern(id, moduleDirectories, options?.external) || options?.cacheDir && id.includes(options.cacheDir)) return id;
8372
+ if (matchPattern(id, moduleDirectories, options?.external) || options?.cacheDir && id.includes(options.cacheDir)) return id;
8331
8373
  const isLibraryModule = moduleDirectories.some((dir) => id.includes(dir));
8332
- return id = isLibraryModule && options?.fallbackCJS ? guessCJSversion(id) || id : id, matchExternalizePattern(id, moduleDirectories, defaultInline) ? false : matchExternalizePattern(id, moduleDirectories, depsExternal) || isLibraryModule && await isValidNodeImport(id) ? id : false;
8374
+ return id = isLibraryModule && options?.fallbackCJS ? guessCJSversion(id) || id : id, matchPattern(id, moduleDirectories, defaultInline) ? false : matchPattern(id, moduleDirectories, depsExternal) || isLibraryModule && await isValidNodeImport(id) ? id : false;
8333
8375
  }
8334
- function matchExternalizePattern(id, moduleDirectories, patterns) {
8376
+ function matchPattern(id, moduleDirectories, patterns) {
8335
8377
  if (patterns == null) return false;
8336
8378
  if (patterns === true) return true;
8337
8379
  for (const ex of patterns) if (typeof ex === "string") {
@@ -11164,7 +11206,7 @@ function removeUndefinedValues(obj) {
11164
11206
  }
11165
11207
 
11166
11208
  async function createVitest(mode, options, viteOverrides = {}, vitestOptions = {}) {
11167
- const ctx = new Vitest(mode, deepClone(options), vitestOptions), root = slash(resolve$1(options.root || process.cwd())), configPath = options.config === false ? false : options.config ? resolve$1(root, options.config) : any(configFiles, { cwd: root });
11209
+ const ctx = new Vitest(mode, deepClone(options), vitestOptions), root = slash(resolve$1(options.root || process.cwd())), configPath = options.config === false ? false : options.config ? resolveModule(options.config, { paths: [root] }) ?? resolve$1(root, options.config) : any(configFiles, { cwd: root });
11168
11210
  options.config = configPath;
11169
11211
  const { browser: _removeBrowser,...restOptions } = options, config = {
11170
11212
  configFile: configPath,
@@ -78,7 +78,6 @@ interface SerializedConfig {
78
78
  disableConsoleIntercept: boolean | undefined;
79
79
  runner: string | undefined;
80
80
  isolate: boolean;
81
- fileParallelism: boolean;
82
81
  maxWorkers: number;
83
82
  mode: "test" | "benchmark";
84
83
  bail: number | undefined;
@@ -1,6 +1,6 @@
1
1
  import fs, { statSync, realpathSync, existsSync, promises, readdirSync, writeFileSync } from 'node:fs';
2
2
  import path, { win32, dirname, join } from 'node:path';
3
- import { slash, shuffle, toArray, cleanUrl } from '@vitest/utils/helpers';
3
+ import { slash, shuffle, toArray } from '@vitest/utils/helpers';
4
4
  import { isAbsolute, resolve, relative, normalize } from 'pathe';
5
5
  import pm from 'picomatch';
6
6
  import { glob } from 'tinyglobby';
@@ -2468,12 +2468,12 @@ function resolveConfig$1(vitest, options, viteConfig) {
2468
2468
  if (resolved.standalone && !resolved.watch) throw new Error(`Vitest standalone mode requires --watch`);
2469
2469
  if (resolved.mergeReports && resolved.watch) throw new Error(`Cannot merge reports with --watch enabled`);
2470
2470
  if (resolved.maxWorkers) resolved.maxWorkers = resolveInlineWorkerOption(resolved.maxWorkers);
2471
- if (resolved.fileParallelism ??= mode !== "benchmark", !resolved.fileParallelism)
2471
+ if (!(options.fileParallelism ?? mode !== "benchmark"))
2472
2472
  // ignore user config, parallelism cannot be implemented without limiting workers
2473
2473
  resolved.maxWorkers = 1;
2474
2474
  if (resolved.maxConcurrency === 0) logger.console.warn(c.yellow(`The option "maxConcurrency" cannot be set to 0. Using default value ${configDefaults.maxConcurrency} instead.`)), resolved.maxConcurrency = configDefaults.maxConcurrency;
2475
2475
  if (resolved.inspect || resolved.inspectBrk) {
2476
- if (resolved.fileParallelism) {
2476
+ if (resolved.maxWorkers !== 1) {
2477
2477
  const inspectOption = `--inspect${resolved.inspectBrk ? "-brk" : ""}`;
2478
2478
  throw new Error(`You cannot use ${inspectOption} without "--no-file-parallelism"`);
2479
2479
  }
@@ -2539,15 +2539,7 @@ function resolveConfig$1(vitest, options, viteConfig) {
2539
2539
  if (reportsDirectory === resolved.root || reportsDirectory === process.cwd()) throw new Error(`You cannot set "coverage.reportsDirectory" as ${reportsDirectory}. Vitest needs to be able to remove this directory before test run`);
2540
2540
  }
2541
2541
  if (resolved.coverage.enabled && resolved.coverage.provider === "custom" && resolved.coverage.customProviderModule) resolved.coverage.customProviderModule = resolvePath(resolved.coverage.customProviderModule, resolved.root);
2542
- resolved.expect ??= {}, resolved.deps ??= {}, resolved.deps.moduleDirectories ??= [];
2543
- const envModuleDirectories = process.env.VITEST_MODULE_DIRECTORIES || process.env.npm_config_VITEST_MODULE_DIRECTORIES;
2544
- if (envModuleDirectories) resolved.deps.moduleDirectories.push(...envModuleDirectories.split(","));
2545
- if (resolved.deps.moduleDirectories = resolved.deps.moduleDirectories.map((dir) => {
2546
- if (dir[0] !== "/") dir = `/${dir}`;
2547
- if (!dir.endsWith("/")) dir += "/";
2548
- return normalize(dir);
2549
- }), !resolved.deps.moduleDirectories.includes("/node_modules/")) resolved.deps.moduleDirectories.push("/node_modules/");
2550
- if (resolved.deps.optimizer ??= {}, resolved.deps.optimizer.ssr ??= {}, resolved.deps.optimizer.ssr.enabled ??= false, resolved.deps.optimizer.client ??= {}, resolved.deps.optimizer.client.enabled ??= false, resolved.deps.web ??= {}, resolved.deps.web.transformAssets ??= true, resolved.deps.web.transformCss ??= true, resolved.deps.web.transformGlobPattern ??= [], resolved.setupFiles = toArray(resolved.setupFiles || []).map((file) => resolvePath(file, resolved.root)), resolved.globalSetup = toArray(resolved.globalSetup || []).map((file) => resolvePath(file, resolved.root)), resolved.coverage.exclude = [
2542
+ if (resolved.expect ??= {}, resolved.deps ??= {}, resolved.deps.moduleDirectories ??= [], resolved.deps.optimizer ??= {}, resolved.deps.optimizer.ssr ??= {}, resolved.deps.optimizer.ssr.enabled ??= false, resolved.deps.optimizer.client ??= {}, resolved.deps.optimizer.client.enabled ??= false, resolved.deps.web ??= {}, resolved.deps.web.transformAssets ??= true, resolved.deps.web.transformCss ??= true, resolved.deps.web.transformGlobPattern ??= [], resolved.setupFiles = toArray(resolved.setupFiles || []).map((file) => resolvePath(file, resolved.root)), resolved.globalSetup = toArray(resolved.globalSetup || []).map((file) => resolvePath(file, resolved.root)), resolved.coverage.exclude = [
2551
2543
  ...resolved.coverage.exclude,
2552
2544
  ...resolved.setupFiles.map((file) => `${resolved.coverage.allowExternal ? "**/" : ""}${relative(resolved.root, file)}`),
2553
2545
  ...resolved.include,
@@ -2771,17 +2763,12 @@ Update your dependencies and make sure the versions match.`));
2771
2763
  // File outside project root with default allowExternal
2772
2764
  if (this.options.allowExternal === false && roots.every((root) => !filename.startsWith(root))) return this.globCache.set(filename, false), false;
2773
2765
  // By default `coverage.include` matches all files, except "coverage.exclude"
2774
- const glob = this.options.include || "**";
2775
- let included = roots.some((root) => {
2776
- const options = {
2777
- contains: true,
2778
- dot: true,
2779
- cwd: root,
2780
- ignore: this.options.exclude
2781
- };
2782
- return pm.isMatch(filename, glob, options);
2766
+ const glob = this.options.include || "**", included = pm.isMatch(filename, glob, {
2767
+ contains: true,
2768
+ dot: true,
2769
+ ignore: this.options.exclude
2783
2770
  });
2784
- return included &&= existsSync(cleanUrl(filename)), this.globCache.set(filename, included), included;
2771
+ return this.globCache.set(filename, included), included;
2785
2772
  }
2786
2773
  async getUntestedFilesByRoot(testedFiles, include, root) {
2787
2774
  let includedFiles = await glob(include, {
@@ -3113,4 +3100,4 @@ function resolveMergeConfig(mod) {
3113
3100
  }
3114
3101
  }
3115
3102
 
3116
- export { BaseCoverageProvider as B, RandomSequencer as R, resolveApiServerConfig as a, BaseSequencer as b, isBrowserEnabled as c, getCoverageProvider as g, hash as h, isPackageExists as i, resolveConfig$1 as r };
3103
+ export { BaseCoverageProvider as B, RandomSequencer as R, resolveApiServerConfig as a, BaseSequencer as b, isBrowserEnabled as c, resolveModule as d, getCoverageProvider as g, hash as h, isPackageExists as i, resolveConfig$1 as r };
@@ -2,7 +2,7 @@ import { PromisifyAssertion, Tester, ExpectStatic } from '@vitest/expect';
2
2
  import { Plugin } from '@vitest/pretty-format';
3
3
  import { SnapshotState } from '@vitest/snapshot';
4
4
  import { B as BenchmarkResult } from './benchmark.d.DAaHLpsq.js';
5
- import { U as UserConsoleLog } from './worker.d.BFk-vvBU.js';
5
+ import { U as UserConsoleLog } from './worker.d.B4Hthdvt.js';
6
6
 
7
7
  interface SnapshotMatcher<T> {
8
8
  <U extends { [P in keyof T] : any }>(snapshot: Partial<U>, hint?: string): void;
@@ -704,6 +704,7 @@ class BaseReporter {
704
704
  }
705
705
  printErrorsSummary(files, errors) {
706
706
  const suites = getSuites(files), tests = getTests(files), failedSuites = suites.filter((i) => i.result?.errors), failedTests = tests.filter((i) => i.result?.state === "fail"), failedTotal = countTestErrors(failedSuites) + countTestErrors(failedTests);
707
+ // TODO: error divider should take into account merged errors for counting
707
708
  let current = 1;
708
709
  const errorDivider = () => this.error(`${c.red(c.dim(divider(`[${current++}/${failedTotal}]`, void 0, 1)))}\n`);
709
710
  if (failedSuites.length) this.error(`\n${errorBanner(`Failed Suites ${failedSuites.length}`)}\n`), this.printTaskErrors(failedSuites, errorDivider);
@@ -733,7 +734,7 @@ class BaseReporter {
733
734
  task.result?.errors?.forEach((error) => {
734
735
  let previous;
735
736
  if (error?.stack) previous = errorsQueue.find((i) => {
736
- if (i[0]?.stack !== error.stack) return false;
737
+ if (i[0]?.stack !== error.stack || i[0]?.diff !== error.diff) return false;
737
738
  const currentProjectName = task?.projectName || task.file?.projectName || "", projectName = i[1][0]?.projectName || i[1][0].file?.projectName || "", currentAnnotations = task.type === "test" && task.annotations, itemAnnotations = i[1][0].type === "test" && i[1][0].annotations;
738
739
  return projectName === currentProjectName && deepEqual(currentAnnotations, itemAnnotations);
739
740
  });
@@ -2,7 +2,7 @@ import fs from 'node:fs';
2
2
  import { getTasks, getFullName, getTests } from '@vitest/runner/utils';
3
3
  import * as pathe from 'pathe';
4
4
  import c from 'tinyrainbow';
5
- import { g as getStateSymbol, t as truncateString, F as F_RIGHT, D as DefaultReporter, f as formatProjectName, s as separator } from './index.CcRZ6fUh.js';
5
+ import { g as getStateSymbol, t as truncateString, F as F_RIGHT, D as DefaultReporter, f as formatProjectName, s as separator } from './index.BL8Hg4Uk.js';
6
6
  import { stripVTControlCharacters } from 'node:util';
7
7
  import { notNullish } from '@vitest/utils/helpers';
8
8
 
@@ -142,7 +142,6 @@ const LIVING_KEYS = [
142
142
  "ValidityState",
143
143
  "DOMParser",
144
144
  "XMLSerializer",
145
- "FormData",
146
145
  "XMLHttpRequestEventTarget",
147
146
  "XMLHttpRequestUpload",
148
147
  "XMLHttpRequest",
@@ -247,10 +246,10 @@ function isClassLikeName(name) {
247
246
  return name[0] === name[0].toUpperCase();
248
247
  }
249
248
  function populateGlobal(global, win, options = {}) {
250
- const { bindFunctions = false } = options, keys = getWindowKeys(global, win, options.additionalKeys), originals = /* @__PURE__ */ new Map(), overrideObject = /* @__PURE__ */ new Map();
249
+ const { bindFunctions = false } = options, keys = getWindowKeys(global, win, options.additionalKeys), originals = /* @__PURE__ */ new Map(), overridenKeys = new Set([...KEYS, ...options.additionalKeys || []]), overrideObject = /* @__PURE__ */ new Map();
251
250
  for (const key of keys) {
252
251
  const boundFunction = bindFunctions && typeof win[key] === "function" && !isClassLikeName(key) && win[key].bind(win);
253
- if (KEYS.includes(key) && key in global) originals.set(key, global[key]);
252
+ if (overridenKeys.has(key) && key in global) originals.set(key, global[key]);
254
253
  Object.defineProperty(global, key, {
255
254
  get() {
256
255
  return overrideObject.has(key) ? overrideObject.get(key) : boundFunction || win[key];
@@ -354,7 +353,8 @@ var happy = {
354
353
  "AbortController",
355
354
  "AbortSignal",
356
355
  "URL",
357
- "URLSearchParams"
356
+ "URLSearchParams",
357
+ "FormData"
358
358
  ]
359
359
  });
360
360
  return { async teardown(global) {
@@ -379,10 +379,13 @@ function catchWindowErrors(window) {
379
379
  window.removeEventListener("error", throwUnhandlerError);
380
380
  };
381
381
  }
382
+ let _FormData;
382
383
  var jsdom = {
383
384
  name: "jsdom",
384
385
  viteEnvironment: "client",
385
386
  async setupVM({ jsdom = {} }) {
387
+ // delay initialization because it takes ~1s
388
+ _FormData = globalThis.FormData;
386
389
  const { CookieJar, JSDOM, ResourceLoader, VirtualConsole } = await import('jsdom'), { html = "<!DOCTYPE html>", userAgent, url = "http://localhost:3000", contentType = "text/html", pretendToBeVisual = true, includeNodeLocations = false, runScripts = "dangerously", resources, console = false, cookieJar = false,...restOptions } = jsdom;
387
390
  let dom = new JSDOM(html, {
388
391
  pretendToBeVisual,
@@ -397,7 +400,7 @@ var jsdom = {
397
400
  ...restOptions
398
401
  });
399
402
  const clearAddEventListenerPatch = patchAddEventListener(dom.window), clearWindowErrors = catchWindowErrors(dom.window);
400
- dom.window.Buffer = Buffer, dom.window.jsdom = dom;
403
+ dom.window.Buffer = Buffer, dom.window.jsdom = dom, dom.window.FormData = createFormData(dom.window);
401
404
  for (const name of [
402
405
  "structuredClone",
403
406
  "BroadcastChannel",
@@ -432,6 +435,8 @@ var jsdom = {
432
435
  };
433
436
  },
434
437
  async setup(global, { jsdom = {} }) {
438
+ // delay initialization because it takes ~1s
439
+ _FormData = globalThis.FormData;
435
440
  const { CookieJar, JSDOM, ResourceLoader, VirtualConsole } = await import('jsdom'), { html = "<!DOCTYPE html>", userAgent, url = "http://localhost:3000", contentType = "text/html", pretendToBeVisual = true, includeNodeLocations = false, runScripts = "dangerously", resources, console = false, cookieJar = false,...restOptions } = jsdom, dom = new JSDOM(html, {
436
441
  pretendToBeVisual,
437
442
  resources: resources ?? (userAgent ? new ResourceLoader({ userAgent }) : void 0),
@@ -444,11 +449,26 @@ var jsdom = {
444
449
  userAgent,
445
450
  ...restOptions
446
451
  }), clearAddEventListenerPatch = patchAddEventListener(dom.window), { keys, originals } = populateGlobal(global, dom.window, { bindFunctions: true }), clearWindowErrors = catchWindowErrors(global);
447
- return global.jsdom = dom, { teardown(global) {
452
+ return global.jsdom = dom, global.FormData = createFormData(dom.window), { teardown(global) {
448
453
  clearAddEventListenerPatch(), clearWindowErrors(), dom.window.close(), delete global.jsdom, keys.forEach((key) => delete global[key]), originals.forEach((v, k) => global[k] = v);
449
454
  } };
450
455
  }
451
456
  };
457
+ // Node.js 24 has a global FormData that Request accepts
458
+ // FormData is not used anywhere else in JSDOM, so we can safely
459
+ // override it with Node.js implementation, but keep the DOM behaviour
460
+ // this is required because Request (and other fetch API)
461
+ // are not implemented by JSDOM
462
+ function createFormData(window) {
463
+ const JSDOMFormData = window.FormData;
464
+ return _FormData ? class FormData extends _FormData {
465
+ constructor(...args) {
466
+ super(), new JSDOMFormData(...args).forEach((value, key) => {
467
+ this.append(key, value);
468
+ });
469
+ }
470
+ } : JSDOMFormData;
471
+ }
452
472
  function patchAddEventListener(window) {
453
473
  const JSDOMAbortSignal = window.AbortSignal, JSDOMAbortController = window.AbortController, originalAddEventListener = window.EventTarget.prototype.addEventListener;
454
474
  return window.EventTarget.prototype.addEventListener = function addEventListener(type, callback, options) {
@@ -1,5 +1,5 @@
1
1
  import v8 from 'node:v8';
2
- import { i as init } from './init.CfeGZ8J3.js';
2
+ import { i as init } from './init.DUeOfNO9.js';
3
3
 
4
4
  if (!process.send) throw new Error("Expected worker to be run in node:child_process");
5
5
  // Store globals in case tests overwrite them
@@ -1,5 +1,5 @@
1
1
  import { isMainThread, parentPort } from 'node:worker_threads';
2
- import { i as init } from './init.CfeGZ8J3.js';
2
+ import { i as init } from './init.DUeOfNO9.js';
3
3
 
4
4
  if (isMainThread || !parentPort) throw new Error("Expected worker to be run in node:worker_threads");
5
5
  function workerInit(options) {
@@ -5,8 +5,8 @@ import { isBuiltin } from 'node:module';
5
5
  import { pathToFileURL } from 'node:url';
6
6
  import { resolve } from 'pathe';
7
7
  import { ModuleRunner } from 'vite/module-runner';
8
- import { b as VitestTransport } from './startModuleRunner.iF1E9Bt4.js';
9
- import { e as environments } from './index.DON9WL-E.js';
8
+ import { b as VitestTransport } from './startModuleRunner.Di-EZqh0.js';
9
+ import { e as environments } from './index.DV0mQLEO.js';
10
10
  import { s as setupInspect } from './inspector.DLZxSeU3.js';
11
11
  import { V as VitestEvaluatedModules } from './evaluatedModules.Dg1zASAC.js';
12
12
  import { c as createRuntimeRpc, a as rpcDone } from './rpc.Dv1Jt3i2.js';
@@ -2,7 +2,7 @@ import * as _vitest_spy from '@vitest/spy';
2
2
  import vm from 'node:vm';
3
3
  import * as viteModuleRunner from 'vite/module-runner';
4
4
  import { ModuleEvaluator, ModuleRunnerImportMeta, ModuleRunnerContext, EvaluatedModuleNode, FetchFunction, EvaluatedModules } from 'vite/module-runner';
5
- import { R as RuntimeRPC, d as ResolveFunctionResult, W as WorkerGlobalState } from './worker.d.BFk-vvBU.js';
5
+ import { R as RuntimeRPC, d as ResolveFunctionResult, W as WorkerGlobalState } from './worker.d.B4Hthdvt.js';
6
6
  import { MockedModule, MockedModuleType } from '@vitest/mocker';
7
7
  import { P as PendingSuiteMock, b as MockFactory, a as MockOptions } from './mocker.d.BE_2ls6u.js';
8
8
 
@@ -1,4 +1,4 @@
1
- import { V as Vitest, T as TestProject, a as TestProjectConfiguration } from './reporters.d.D-el0219.js';
1
+ import { V as Vitest, T as TestProject, a as TestProjectConfiguration } from './reporters.d.PEs0tXod.js';
2
2
 
3
3
  interface VitestPluginContext {
4
4
  vitest: Vitest;
@@ -1,13 +1,13 @@
1
1
  import { TaskMeta, Suite, File, TestAnnotation, ImportDuration, Test, Task, TaskResultPack, FileSpecification, CancelReason, SequenceSetupFiles, SequenceHooks } from '@vitest/runner';
2
2
  import { TestError, SerializedError, Arrayable, ParsedStack, Awaitable } from '@vitest/utils';
3
- import { A as AfterSuiteRunMeta, U as UserConsoleLog, P as ProvidedContext, C as ContextRPC, L as LabelColor } from './worker.d.BFk-vvBU.js';
3
+ import { A as AfterSuiteRunMeta, U as UserConsoleLog, P as ProvidedContext, C as ContextRPC, L as LabelColor } from './worker.d.B4Hthdvt.js';
4
4
  import { Writable } from 'node:stream';
5
5
  import { TransformResult as TransformResult$1, ViteDevServer, Plugin, UserConfig as UserConfig$1, DepOptimizationConfig, ServerOptions, ConfigEnv, AliasOptions } from 'vite';
6
6
  import { MockedModule } from '@vitest/mocker';
7
7
  import { StackTraceParserOptions } from '@vitest/utils/source-map';
8
8
  import { BrowserCommands } from 'vitest/browser';
9
- import { B as BrowserTraceViewMode, S as SerializedConfig, F as FakeTimerInstallOpts } from './config.d.u2CUDWwS.js';
10
- import { S as SerializedTestSpecification, B as BrowserTesterOptions } from './browser.d.B9iJzZyn.js';
9
+ import { B as BrowserTraceViewMode, S as SerializedConfig, F as FakeTimerInstallOpts } from './config.d.BTfZNUu9.js';
10
+ import { S as SerializedTestSpecification, B as BrowserTesterOptions } from './browser.d.ScGeWTou.js';
11
11
  import { PrettyFormatOptions } from '@vitest/pretty-format';
12
12
  import { SnapshotSummary, SnapshotStateOptions } from '@vitest/snapshot';
13
13
  import { SerializedDiffOptions } from '@vitest/utils/diff';
@@ -3071,7 +3071,7 @@ interface UserConfig extends InlineConfig {
3071
3071
  type OnUnhandledErrorCallback = (error: (TestError | Error) & {
3072
3072
  type: string;
3073
3073
  }) => boolean | void;
3074
- 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"> {
3074
+ 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"> {
3075
3075
  mode: VitestRunMode;
3076
3076
  name: ProjectName["label"];
3077
3077
  color?: ProjectName["color"];
@@ -3153,7 +3153,6 @@ type ProjectConfig = Omit<InlineConfig, NonProjectOptions | "sequencer" | "deps"
3153
3153
  mode?: string;
3154
3154
  sequencer?: Omit<SequenceOptions, "sequencer" | "seed">;
3155
3155
  deps?: Omit<DepsOptions, "moduleDirectories">;
3156
- fileParallelism?: boolean;
3157
3156
  };
3158
3157
  type ResolvedProjectConfig = Omit<ResolvedConfig, Exclude<NonProjectOptions, "coverage" | "watch">>;
3159
3158
  interface UserWorkspaceConfig extends UserConfig$1 {
@@ -1,5 +1,5 @@
1
1
  import fs from 'node:fs';
2
- import nodeModule, { builtinModules, isBuiltin } from 'node:module';
2
+ import nodeModule, { isBuiltin } from 'node:module';
3
3
  import { isBareImport } from '@vitest/utils/helpers';
4
4
  import { pathToFileURL } from 'node:url';
5
5
  import { normalize as normalize$1, join as join$1 } from 'pathe';
@@ -428,7 +428,6 @@ function fixLeadingSlashes(id) {
428
428
  return id.startsWith("//") ? id.replace(multipleSlashRe, "/") : id;
429
429
  }
430
430
 
431
- const nodeBuiltins = builtinModules.filter((id) => !id.includes(":"));
432
431
  class VitestTransport {
433
432
  constructor(options) {
434
433
  this.options = options;
@@ -437,7 +436,10 @@ class VitestTransport {
437
436
  if (event.type !== "custom") return { error: /* @__PURE__ */ new Error(`Vitest Module Runner doesn't support Vite HMR events.`) };
438
437
  if (event.event !== "vite:invoke") return { error: /* @__PURE__ */ new Error(`Vitest Module Runner doesn't support ${event.event} event.`) };
439
438
  const { name, data } = event.data;
440
- if (name === "getBuiltins") return { result: [...nodeBuiltins, /^node:/] };
439
+ if (name === "getBuiltins")
440
+ // we return an empty array here to avoid client-side builtin check,
441
+ // as we need builtins to go through `fetchModule`
442
+ return { result: [] };
441
443
  if (name !== "fetchModule") return { error: /* @__PURE__ */ new Error(`Unknown method: ${name}. Expected "fetchModule".`) };
442
444
  try {
443
445
  return { result: await this.options.fetchModule(...data) };
@@ -493,6 +495,16 @@ class VitestModuleRunner extends viteModuleRunner.ModuleRunner {
493
495
  value: this.mocker
494
496
  });
495
497
  }
498
+ /**
499
+ * Vite checks that the module has exports emulating the Node.js behaviour,
500
+ * but Vitest is more relaxed.
501
+ *
502
+ * We should keep the Vite behavour when there is a `strict` flag.
503
+ * @internal
504
+ */
505
+ processImport(exports) {
506
+ return exports;
507
+ }
496
508
  async import(rawId) {
497
509
  const resolved = await this.vitestOptions.transport.resolveId(rawId);
498
510
  return super.import(resolved ? resolved.url : rawId);
@@ -10,7 +10,7 @@ import { findNearestPackageData } from '@vitest/utils/resolver';
10
10
  import { dirname as dirname$1 } from 'node:path';
11
11
  import { CSS_LANGS_RE, KNOWN_ASSET_RE } from '@vitest/utils/constants';
12
12
  import { getDefaultRequestStubs } from '../module-evaluator.js';
13
- import { s as startVitestModuleRunner, c as createNodeImportMeta, a as VITEST_VM_CONTEXT_SYMBOL } from './startModuleRunner.iF1E9Bt4.js';
13
+ import { s as startVitestModuleRunner, c as createNodeImportMeta, a as VITEST_VM_CONTEXT_SYMBOL } from './startModuleRunner.Di-EZqh0.js';
14
14
  import { p as provideWorkerState } from './utils.CG9h5ccR.js';
15
15
 
16
16
  function interopCommonJsModule(interopDefault, mod) {
@@ -1,6 +1,6 @@
1
1
  import { CancelReason, File, TestAnnotation, TaskResultPack, TaskEventPack, FileSpecification, Task } from '@vitest/runner';
2
2
  import { FetchFunctionOptions, FetchResult, EvaluatedModules } from 'vite/module-runner';
3
- import { S as SerializedConfig } from './config.d.u2CUDWwS.js';
3
+ import { S as SerializedConfig } from './config.d.BTfZNUu9.js';
4
4
  import { E as Environment } from './environment.d.CrsxCzP1.js';
5
5
  import { SnapshotResult } from '@vitest/snapshot';
6
6
 
package/dist/cli.js CHANGED
@@ -1,10 +1,10 @@
1
- import { c as createCLI } from './chunks/cac.39_DDnyx.js';
1
+ import { c as createCLI } from './chunks/cac.BBqWH4nd.js';
2
2
  import '@vitest/utils/helpers';
3
3
  import 'events';
4
4
  import 'pathe';
5
5
  import 'tinyrainbow';
6
6
  import './chunks/constants.D_Q9UYh-.js';
7
- import './chunks/index.CcRZ6fUh.js';
7
+ import './chunks/index.BL8Hg4Uk.js';
8
8
  import 'node:fs';
9
9
  import 'node:fs/promises';
10
10
  import 'node:perf_hooks';
package/dist/config.d.ts CHANGED
@@ -1,12 +1,12 @@
1
1
  import { HookHandler, ConfigEnv, UserConfig } from 'vite';
2
2
  export { ConfigEnv, Plugin, UserConfig as ViteUserConfig, mergeConfig } from 'vite';
3
- import { I as InlineConfig, c as CoverageV8Options, R as ResolvedCoverageOptions, U as UserWorkspaceConfig, d as UserProjectConfigFn, e as UserProjectConfigExport } from './chunks/reporters.d.D-el0219.js';
4
- export { a as TestProjectConfiguration, g as TestProjectInlineConfiguration, f as TestUserConfig, W as WatcherTriggerPattern } from './chunks/reporters.d.D-el0219.js';
5
- import { V as VitestPluginContext } from './chunks/plugin.d.D8LgBgbU.js';
6
- import { F as FakeTimerInstallOpts } from './chunks/config.d.u2CUDWwS.js';
3
+ import { I as InlineConfig, c as CoverageV8Options, R as ResolvedCoverageOptions, U as UserWorkspaceConfig, d as UserProjectConfigFn, e as UserProjectConfigExport } from './chunks/reporters.d.PEs0tXod.js';
4
+ export { a as TestProjectConfiguration, g as TestProjectInlineConfiguration, f as TestUserConfig, W as WatcherTriggerPattern } from './chunks/reporters.d.PEs0tXod.js';
5
+ import { V as VitestPluginContext } from './chunks/plugin.d.lctzD3Wk.js';
6
+ import { F as FakeTimerInstallOpts } from './chunks/config.d.BTfZNUu9.js';
7
7
  import '@vitest/runner';
8
8
  import '@vitest/utils';
9
- import './chunks/worker.d.BFk-vvBU.js';
9
+ import './chunks/worker.d.B4Hthdvt.js';
10
10
  import 'vite/module-runner';
11
11
  import './chunks/environment.d.CrsxCzP1.js';
12
12
  import '@vitest/snapshot';
@@ -14,7 +14,7 @@ import 'node:stream';
14
14
  import '@vitest/mocker';
15
15
  import '@vitest/utils/source-map';
16
16
  import 'vitest/browser';
17
- import './chunks/browser.d.B9iJzZyn.js';
17
+ import './chunks/browser.d.ScGeWTou.js';
18
18
  import '@vitest/pretty-format';
19
19
  import '@vitest/utils/diff';
20
20
  import '@vitest/expect';
@@ -1,17 +1,17 @@
1
- import { R as ResolvedCoverageOptions, V as Vitest, C as CoverageMap, b as ReportContext } from './chunks/reporters.d.D-el0219.js';
1
+ import { R as ResolvedCoverageOptions, V as Vitest, C as CoverageMap, b as ReportContext } from './chunks/reporters.d.PEs0tXod.js';
2
2
  import { TransformResult } from 'vite';
3
- import { A as AfterSuiteRunMeta } from './chunks/worker.d.BFk-vvBU.js';
3
+ import { A as AfterSuiteRunMeta } from './chunks/worker.d.B4Hthdvt.js';
4
4
  import '@vitest/runner';
5
5
  import '@vitest/utils';
6
6
  import 'node:stream';
7
7
  import '@vitest/mocker';
8
8
  import '@vitest/utils/source-map';
9
9
  import 'vitest/browser';
10
- import './chunks/config.d.u2CUDWwS.js';
10
+ import './chunks/config.d.BTfZNUu9.js';
11
11
  import '@vitest/pretty-format';
12
12
  import '@vitest/snapshot';
13
13
  import '@vitest/utils/diff';
14
- import './chunks/browser.d.B9iJzZyn.js';
14
+ import './chunks/browser.d.ScGeWTou.js';
15
15
  import '@vitest/expect';
16
16
  import 'vitest/optional-types.js';
17
17
  import './chunks/benchmark.d.DAaHLpsq.js';
package/dist/coverage.js CHANGED
@@ -1,4 +1,4 @@
1
- export { B as BaseCoverageProvider } from './chunks/coverage.CSfvENE1.js';
1
+ export { B as BaseCoverageProvider } from './chunks/coverage.DuCn_Tmx.js';
2
2
  import 'node:fs';
3
3
  import 'node:path';
4
4
  import '@vitest/utils/helpers';
@@ -1,2 +1,2 @@
1
- export { e as builtinEnvironments, p as populateGlobal } from './chunks/index.DON9WL-E.js';
1
+ export { e as builtinEnvironments, p as populateGlobal } from './chunks/index.DV0mQLEO.js';
2
2
  import 'node:console';
package/dist/index.d.ts CHANGED
@@ -1,18 +1,18 @@
1
- import { S as SerializedTestSpecification } from './chunks/browser.d.B9iJzZyn.js';
2
- export { B as BrowserTesterOptions } from './chunks/browser.d.B9iJzZyn.js';
3
- import './chunks/global.d.BgJSTpgQ.js';
1
+ import { S as SerializedTestSpecification } from './chunks/browser.d.ScGeWTou.js';
2
+ export { B as BrowserTesterOptions } from './chunks/browser.d.ScGeWTou.js';
3
+ import './chunks/global.d.DdOkMiVb.js';
4
4
  import { File, TestAnnotation, TaskResultPack, TaskEventPack, TaskPopulated } from '@vitest/runner';
5
5
  export { CancelReason, ImportDuration, OnTestFailedHandler, OnTestFinishedHandler, RunMode, Task as RunnerTask, TaskBase as RunnerTaskBase, TaskEventPack as RunnerTaskEventPack, TaskResult as RunnerTaskResult, TaskResultPack as RunnerTaskResultPack, Test as RunnerTestCase, File as RunnerTestFile, Suite as RunnerTestSuite, SuiteAPI, SuiteCollector, SuiteFactory, TaskCustomOptions, TaskMeta, TaskState, TestAPI, TestAnnotation, TestContext, TestFunction, TestOptions, afterAll, afterEach, beforeAll, beforeEach, describe, it, onTestFailed, onTestFinished, suite, test } from '@vitest/runner';
6
6
  import { Awaitable } from '@vitest/utils';
7
7
  export { ParsedStack, SerializedError, TestError } from '@vitest/utils';
8
- import { U as UserConsoleLog, L as LabelColor, M as ModuleGraphData, a as BirpcReturn, P as ProvidedContext } from './chunks/worker.d.BFk-vvBU.js';
9
- export { A as AfterSuiteRunMeta, C as ContextRPC, c as ContextTestEnvironment, b as RunnerRPC, R as RuntimeRPC, T as TestExecutionMethod, W as WorkerGlobalState } from './chunks/worker.d.BFk-vvBU.js';
10
- import { S as SerializedConfig, F as FakeTimerInstallOpts, R as RuntimeOptions } from './chunks/config.d.u2CUDWwS.js';
11
- export { b as RuntimeConfig, a as SerializedCoverageConfig } from './chunks/config.d.u2CUDWwS.js';
8
+ import { U as UserConsoleLog, L as LabelColor, M as ModuleGraphData, a as BirpcReturn, P as ProvidedContext } from './chunks/worker.d.B4Hthdvt.js';
9
+ export { A as AfterSuiteRunMeta, C as ContextRPC, c as ContextTestEnvironment, b as RunnerRPC, R as RuntimeRPC, T as TestExecutionMethod, W as WorkerGlobalState } from './chunks/worker.d.B4Hthdvt.js';
10
+ import { S as SerializedConfig, F as FakeTimerInstallOpts, R as RuntimeOptions } from './chunks/config.d.BTfZNUu9.js';
11
+ export { b as RuntimeConfig, a as SerializedCoverageConfig } from './chunks/config.d.BTfZNUu9.js';
12
12
  import { ExpectStatic } from '@vitest/expect';
13
13
  export { Assertion, AsymmetricMatchersContaining, DeeplyAllowMatchers, ExpectPollOptions, ExpectStatic, JestAssertion, Matchers, chai } from '@vitest/expect';
14
14
  import { spyOn, fn, MaybeMockedDeep, MaybeMocked, MaybePartiallyMocked, MaybePartiallyMockedDeep, MockInstance } from '@vitest/spy';
15
- export { Mock, MockContext, MockInstance, Mocked, MockedClass, MockedFunction, MockedObject } from '@vitest/spy';
15
+ export { Mock, MockContext, MockInstance, MockResult, MockResultIncomplete, MockResultReturn, MockResultThrow, MockSettledResult, MockSettledResultFulfilled, MockSettledResultIncomplete, MockSettledResultRejected, Mocked, MockedClass, MockedFunction, MockedObject } from '@vitest/spy';
16
16
  import { M as MockFactoryWithHelper, a as MockOptions } from './chunks/mocker.d.BE_2ls6u.js';
17
17
  export { b as bench } from './chunks/suite.d.BJWk38HB.js';
18
18
  import { EvaluatedModules } from 'vite/module-runner';
@@ -1,10 +1,10 @@
1
1
  import 'vite/module-runner';
2
- export { b as VitestModuleEvaluator, a as VitestModuleEvaluatorOptions, c as createImportMetaEnvProxy, g as getDefaultRequestStubs, i as isPrimitive, u as unwrapId, w as wrapId } from './chunks/moduleRunner.d.YtNsMIoJ.js';
2
+ export { b as VitestModuleEvaluator, a as VitestModuleEvaluatorOptions, c as createImportMetaEnvProxy, g as getDefaultRequestStubs, i as isPrimitive, u as unwrapId, w as wrapId } from './chunks/moduleRunner.d.TP-w6tIQ.js';
3
3
  import 'node:vm';
4
4
  import '@vitest/spy';
5
- import './chunks/worker.d.BFk-vvBU.js';
5
+ import './chunks/worker.d.B4Hthdvt.js';
6
6
  import '@vitest/runner';
7
- import './chunks/config.d.u2CUDWwS.js';
7
+ import './chunks/config.d.BTfZNUu9.js';
8
8
  import '@vitest/pretty-format';
9
9
  import '@vitest/snapshot';
10
10
  import '@vitest/utils/diff';
@@ -1,5 +1,5 @@
1
1
  export { VitestModuleEvaluator } from './module-evaluator.js';
2
- export { a as VITEST_VM_CONTEXT_SYMBOL, V as VitestModuleRunner, s as startVitestModuleRunner } from './chunks/startModuleRunner.iF1E9Bt4.js';
2
+ export { a as VITEST_VM_CONTEXT_SYMBOL, V as VitestModuleRunner, s as startVitestModuleRunner } from './chunks/startModuleRunner.Di-EZqh0.js';
3
3
  export { g as getWorkerState } from './chunks/utils.CG9h5ccR.js';
4
4
  import 'node:module';
5
5
  import 'node:url';
package/dist/node.d.ts CHANGED
@@ -3,23 +3,23 @@ import { InlineConfig, UserConfig as UserConfig$1, Plugin, ResolvedConfig as Res
3
3
  export { vite as Vite };
4
4
  export { esbuildVersion, isCSSRequest, isFileServingAllowed, parseAst, parseAstAsync, rollupVersion, version as viteVersion } from 'vite';
5
5
  import { IncomingMessage } from 'node:http';
6
- import { h as ResolvedConfig, f as UserConfig, i as VitestRunMode, j as VitestOptions, V as Vitest, A as ApiConfig, k as TestSpecification, T as TestProject, P as PoolWorker, l as PoolOptions, m as WorkerRequest, n as TestSequencer, L as Logger } from './chunks/reporters.d.D-el0219.js';
7
- export { at as BaseCoverageOptions, Y as BenchmarkUserOptions, Z as BrowserBuiltinProvider, $ as BrowserCommand, a0 as BrowserCommandContext, a1 as BrowserConfigOptions, a2 as BrowserInstanceOption, a3 as BrowserModuleMocker, a4 as BrowserOrchestrator, a5 as BrowserProvider, a6 as BrowserProviderOption, a7 as BrowserScript, a8 as BrowserServerFactory, a9 as BrowserServerOptions, aa as BrowserServerState, ab as BrowserServerStateSession, ai as BuiltinEnvironment, ac as CDPSession, aj as CSSModuleScopeStrategy, au as CoverageIstanbulOptions, av as CoverageOptions, aw as CoverageProvider, ax as CoverageProviderModule, ay as CoverageReporter, c as CoverageV8Options, az as CustomProviderOptions, ak as DepsOptimizationOptions, al as EnvironmentOptions, H as HTMLOptions, I as InlineConfig, t as JUnitOptions, J as JsonOptions, M as ModuleDiagnostic, O as OnServerRestartHandler, o as OnTestsRerunHandler, ad as ParentProjectBrowser, am as Pool, q as PoolRunnerInitializer, r as PoolTask, ae as ProjectBrowser, an as ProjectConfig, b as ReportContext, aB as ReportedHookContext, aC as Reporter, ap as ResolveSnapshotPathHandler, aq as ResolveSnapshotPathHandlerContext, af as ResolvedBrowserOptions, R as ResolvedCoverageOptions, ao as ResolvedProjectConfig, S as SerializedTestProject, u as TaskOptions, v as TestCase, w as TestCollection, x as TestDiagnostic, y as TestModule, z as TestModuleState, B as TestResult, D as TestResultFailed, E as TestResultPassed, F as TestResultSkipped, aD as TestRunEndReason, aA as TestRunResult, X as TestSequencerConstructor, G as TestState, K as TestSuite, N as TestSuiteState, ag as ToMatchScreenshotComparators, ah as ToMatchScreenshotOptions, ar as TypecheckConfig, U as UserWorkspaceConfig, as as VitestEnvironment, p as VitestPackageInstaller, W as WatcherTriggerPattern, s as WorkerResponse, _ as _BrowserNames, Q as experimental_getRunnerTask } from './chunks/reporters.d.D-el0219.js';
6
+ import { h as ResolvedConfig, f as UserConfig, i as VitestRunMode, j as VitestOptions, V as Vitest, A as ApiConfig, k as TestSpecification, T as TestProject, P as PoolWorker, l as PoolOptions, m as WorkerRequest, n as TestSequencer, L as Logger } from './chunks/reporters.d.PEs0tXod.js';
7
+ export { at as BaseCoverageOptions, Y as BenchmarkUserOptions, Z as BrowserBuiltinProvider, $ as BrowserCommand, a0 as BrowserCommandContext, a1 as BrowserConfigOptions, a2 as BrowserInstanceOption, a3 as BrowserModuleMocker, a4 as BrowserOrchestrator, a5 as BrowserProvider, a6 as BrowserProviderOption, a7 as BrowserScript, a8 as BrowserServerFactory, a9 as BrowserServerOptions, aa as BrowserServerState, ab as BrowserServerStateSession, ai as BuiltinEnvironment, ac as CDPSession, aj as CSSModuleScopeStrategy, au as CoverageIstanbulOptions, av as CoverageOptions, aw as CoverageProvider, ax as CoverageProviderModule, ay as CoverageReporter, c as CoverageV8Options, az as CustomProviderOptions, ak as DepsOptimizationOptions, al as EnvironmentOptions, H as HTMLOptions, I as InlineConfig, t as JUnitOptions, J as JsonOptions, M as ModuleDiagnostic, O as OnServerRestartHandler, o as OnTestsRerunHandler, ad as ParentProjectBrowser, am as Pool, q as PoolRunnerInitializer, r as PoolTask, ae as ProjectBrowser, an as ProjectConfig, b as ReportContext, aB as ReportedHookContext, aC as Reporter, ap as ResolveSnapshotPathHandler, aq as ResolveSnapshotPathHandlerContext, af as ResolvedBrowserOptions, R as ResolvedCoverageOptions, ao as ResolvedProjectConfig, S as SerializedTestProject, u as TaskOptions, v as TestCase, w as TestCollection, x as TestDiagnostic, y as TestModule, z as TestModuleState, B as TestResult, D as TestResultFailed, E as TestResultPassed, F as TestResultSkipped, aD as TestRunEndReason, aA as TestRunResult, X as TestSequencerConstructor, G as TestState, K as TestSuite, N as TestSuiteState, ag as ToMatchScreenshotComparators, ah as ToMatchScreenshotOptions, ar as TypecheckConfig, U as UserWorkspaceConfig, as as VitestEnvironment, p as VitestPackageInstaller, W as WatcherTriggerPattern, s as WorkerResponse, _ as _BrowserNames, Q as experimental_getRunnerTask } from './chunks/reporters.d.PEs0tXod.js';
8
8
  import { Awaitable } from '@vitest/utils';
9
9
  export { SerializedError } from '@vitest/utils';
10
- import { R as RuntimeRPC, C as ContextRPC } from './chunks/worker.d.BFk-vvBU.js';
11
- export { T as TestExecutionType } from './chunks/worker.d.BFk-vvBU.js';
10
+ import { R as RuntimeRPC, C as ContextRPC } from './chunks/worker.d.B4Hthdvt.js';
11
+ export { T as TestExecutionType } from './chunks/worker.d.B4Hthdvt.js';
12
12
  import { Writable } from 'node:stream';
13
- export { V as VitestPluginContext } from './chunks/plugin.d.D8LgBgbU.js';
13
+ export { V as VitestPluginContext } from './chunks/plugin.d.lctzD3Wk.js';
14
14
  import { Debugger } from 'debug';
15
- import './chunks/global.d.BgJSTpgQ.js';
15
+ import './chunks/global.d.DdOkMiVb.js';
16
16
  export { Task as RunnerTask, TaskResult as RunnerTaskResult, TaskResultPack as RunnerTaskResultPack, Test as RunnerTestCase, File as RunnerTestFile, Suite as RunnerTestSuite, SequenceHooks, SequenceSetupFiles } from '@vitest/runner';
17
- export { b as RuntimeConfig } from './chunks/config.d.u2CUDWwS.js';
17
+ export { b as RuntimeConfig } from './chunks/config.d.BTfZNUu9.js';
18
18
  export { generateFileHash } from '@vitest/runner/utils';
19
19
  import '@vitest/mocker';
20
20
  import '@vitest/utils/source-map';
21
21
  import 'vitest/browser';
22
- import './chunks/browser.d.B9iJzZyn.js';
22
+ import './chunks/browser.d.ScGeWTou.js';
23
23
  import '@vitest/pretty-format';
24
24
  import '@vitest/snapshot';
25
25
  import '@vitest/utils/diff';
@@ -237,4 +237,4 @@ declare const createViteServer: typeof vite.createServer;
237
237
  declare const rolldownVersion: string | undefined;
238
238
 
239
239
  export { ApiConfig, BaseSequencer, ForksPoolWorker, GitNotFoundError, PoolOptions, PoolWorker, ResolvedConfig, TestProject, TestSequencer, TestSpecification, UserConfig as TestUserConfig, FilesNotFoundError as TestsNotFoundError, ThreadsPoolWorker, TypecheckPoolWorker, Vitest, VitestOptions, VitestPlugin, VitestRunMode, VmForksPoolWorker, VmThreadsPoolWorker, WorkerRequest, createDebugger, createMethodsRPC, createViteLogger, createViteServer, createVitest, distDir, escapeTestName, getFilePoolName, isValidApiRequest, parseCLI, registerConsoleShortcuts, resolveApiServerConfig, resolveConfig, resolveFsAllow, rolldownVersion, rootDir, startVitest, version };
240
- export type { CliParseOptions, ProcessPool, CollectLineNumbers as TypeCheckCollectLineNumbers, CollectLines as TypeCheckCollectLines, Context as TypeCheckContext, TscErrorInfo as TypeCheckErrorInfo, RawErrsMap as TypeCheckRawErrorsMap, RootAndTarget as TypeCheckRootAndTarget, WorkerContext };
240
+ export type { CliOptions, CliParseOptions, ProcessPool, CollectLineNumbers as TypeCheckCollectLineNumbers, CollectLines as TypeCheckCollectLines, Context as TypeCheckContext, TscErrorInfo as TypeCheckErrorInfo, RawErrsMap as TypeCheckRawErrorsMap, RootAndTarget as TypeCheckRootAndTarget, WorkerContext };
package/dist/node.js CHANGED
@@ -1,11 +1,11 @@
1
1
  import * as vite from 'vite';
2
2
  import { resolveConfig as resolveConfig$1, mergeConfig } from 'vite';
3
3
  export { esbuildVersion, isCSSRequest, isFileServingAllowed, parseAst, parseAstAsync, rollupVersion, version as viteVersion } from 'vite';
4
- import { V as Vitest, a as VitestPlugin } from './chunks/cli-api.BxbUFDR6.js';
5
- export { f as ForksPoolWorker, G as GitNotFoundError, F as TestsNotFoundError, T as ThreadsPoolWorker, h as TypecheckPoolWorker, b as VitestPackageInstaller, j as VmForksPoolWorker, k as VmThreadsPoolWorker, o as createDebugger, d as createMethodsRPC, n as createViteLogger, c as createVitest, e as escapeTestName, l as experimental_getRunnerTask, g as getFilePoolName, i as isValidApiRequest, m as registerConsoleShortcuts, r as resolveFsAllow, s as startVitest } from './chunks/cli-api.BxbUFDR6.js';
6
- export { p as parseCLI } from './chunks/cac.39_DDnyx.js';
7
- import { r as resolveConfig$2 } from './chunks/coverage.CSfvENE1.js';
8
- export { b as BaseSequencer, a as resolveApiServerConfig } from './chunks/coverage.CSfvENE1.js';
4
+ import { V as Vitest, a as VitestPlugin } from './chunks/cli-api.UL3SwFUb.js';
5
+ export { f as ForksPoolWorker, G as GitNotFoundError, F as TestsNotFoundError, T as ThreadsPoolWorker, h as TypecheckPoolWorker, b as VitestPackageInstaller, j as VmForksPoolWorker, k as VmThreadsPoolWorker, o as createDebugger, d as createMethodsRPC, n as createViteLogger, c as createVitest, e as escapeTestName, l as experimental_getRunnerTask, g as getFilePoolName, i as isValidApiRequest, m as registerConsoleShortcuts, r as resolveFsAllow, s as startVitest } from './chunks/cli-api.UL3SwFUb.js';
6
+ export { p as parseCLI } from './chunks/cac.BBqWH4nd.js';
7
+ import { r as resolveConfig$2 } from './chunks/coverage.DuCn_Tmx.js';
8
+ export { b as BaseSequencer, a as resolveApiServerConfig } from './chunks/coverage.DuCn_Tmx.js';
9
9
  import { slash, deepClone } from '@vitest/utils/helpers';
10
10
  import { a as any } from './chunks/index.Dc3xnDvT.js';
11
11
  import { resolve } from 'pathe';
@@ -18,7 +18,7 @@ import 'node:path';
18
18
  import 'node:os';
19
19
  import '@vitest/snapshot/manager';
20
20
  import './chunks/index.Bgo3tNWt.js';
21
- import './chunks/index.CcRZ6fUh.js';
21
+ import './chunks/index.BL8Hg4Uk.js';
22
22
  import 'node:fs/promises';
23
23
  import 'node:perf_hooks';
24
24
  import '@vitest/utils/source-map';
@@ -62,7 +62,7 @@ import './chunks/defaults.BOqNVLsY.js';
62
62
  import '@vitest/utils/constants';
63
63
  import '@vitest/utils/resolver';
64
64
  import 'es-module-lexer';
65
- import './chunks/index.BdSLhLDZ.js';
65
+ import './chunks/index.CpdwpN7L.js';
66
66
  import 'node:assert';
67
67
  import '@vitest/utils/serialize';
68
68
  import 'node:readline';
@@ -1,9 +1,9 @@
1
- export { aR as BaseReporter, aS as BenchmarkBuiltinReporters, aE as BenchmarkReporter, aF as BenchmarkReportsMap, aT as BuiltinReporterOptions, aU as BuiltinReporters, aG as DefaultReporter, aH as DotReporter, aI as GithubActionsReporter, aJ as HangingProcessReporter, aL as JUnitReporter, aV as JsonAssertionResult, aK as JsonReporter, aW as JsonTestResult, aX as JsonTestResults, aB as ReportedHookContext, aC as Reporter, aM as ReportersMap, aN as TapFlatReporter, aO as TapReporter, aD as TestRunEndReason, aP as VerboseBenchmarkReporter, aQ as VerboseReporter } from './chunks/reporters.d.D-el0219.js';
1
+ export { aR as BaseReporter, aS as BenchmarkBuiltinReporters, aE as BenchmarkReporter, aF as BenchmarkReportsMap, aT as BuiltinReporterOptions, aU as BuiltinReporters, aG as DefaultReporter, aH as DotReporter, aI as GithubActionsReporter, aJ as HangingProcessReporter, aL as JUnitReporter, aV as JsonAssertionResult, aK as JsonReporter, aW as JsonTestResult, aX as JsonTestResults, aB as ReportedHookContext, aC as Reporter, aM as ReportersMap, aN as TapFlatReporter, aO as TapReporter, aD as TestRunEndReason, aP as VerboseBenchmarkReporter, aQ as VerboseReporter } from './chunks/reporters.d.PEs0tXod.js';
2
2
  import '@vitest/runner';
3
3
  import '@vitest/utils';
4
- import './chunks/worker.d.BFk-vvBU.js';
4
+ import './chunks/worker.d.B4Hthdvt.js';
5
5
  import 'vite/module-runner';
6
- import './chunks/config.d.u2CUDWwS.js';
6
+ import './chunks/config.d.BTfZNUu9.js';
7
7
  import '@vitest/pretty-format';
8
8
  import '@vitest/snapshot';
9
9
  import '@vitest/utils/diff';
@@ -13,7 +13,7 @@ import 'vite';
13
13
  import '@vitest/mocker';
14
14
  import '@vitest/utils/source-map';
15
15
  import 'vitest/browser';
16
- import './chunks/browser.d.B9iJzZyn.js';
16
+ import './chunks/browser.d.ScGeWTou.js';
17
17
  import '@vitest/expect';
18
18
  import 'vitest/optional-types.js';
19
19
  import './chunks/benchmark.d.DAaHLpsq.js';
package/dist/reporters.js CHANGED
@@ -1,5 +1,5 @@
1
- export { D as DefaultReporter, a as DotReporter, G as GithubActionsReporter, H as HangingProcessReporter, b as JUnitReporter, J as JsonReporter, R as ReportersMap, T as TapFlatReporter, c as TapReporter, V as VerboseReporter } from './chunks/index.CcRZ6fUh.js';
2
- export { B as BenchmarkReporter, a as BenchmarkReportsMap, V as VerboseBenchmarkReporter } from './chunks/index.BdSLhLDZ.js';
1
+ export { D as DefaultReporter, a as DotReporter, G as GithubActionsReporter, H as HangingProcessReporter, b as JUnitReporter, J as JsonReporter, R as ReportersMap, T as TapFlatReporter, c as TapReporter, V as VerboseReporter } from './chunks/index.BL8Hg4Uk.js';
2
+ export { B as BenchmarkReporter, a as BenchmarkReportsMap, V as VerboseBenchmarkReporter } from './chunks/index.CpdwpN7L.js';
3
3
  import 'node:fs';
4
4
  import 'node:fs/promises';
5
5
  import 'pathe';
package/dist/runners.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import * as tinybench from 'tinybench';
2
2
  import { VitestRunner, VitestRunnerImportSource, Suite, File, Task, CancelReason, Test, TestContext, ImportDuration } from '@vitest/runner';
3
3
  export { VitestRunner } from '@vitest/runner';
4
- import { S as SerializedConfig } from './chunks/config.d.u2CUDWwS.js';
4
+ import { S as SerializedConfig } from './chunks/config.d.BTfZNUu9.js';
5
5
  import '@vitest/pretty-format';
6
6
  import '@vitest/snapshot';
7
7
  import '@vitest/utils/diff';
package/dist/worker.d.ts CHANGED
@@ -1,8 +1,8 @@
1
- import { W as WorkerGlobalState, B as BirpcOptions, R as RuntimeRPC } from './chunks/worker.d.BFk-vvBU.js';
1
+ import { W as WorkerGlobalState, B as BirpcOptions, R as RuntimeRPC } from './chunks/worker.d.B4Hthdvt.js';
2
2
  import { Awaitable } from '@vitest/utils';
3
3
  import '@vitest/runner';
4
4
  import 'vite/module-runner';
5
- import './chunks/config.d.u2CUDWwS.js';
5
+ import './chunks/config.d.BTfZNUu9.js';
6
6
  import '@vitest/pretty-format';
7
7
  import '@vitest/snapshot';
8
8
  import '@vitest/utils/diff';
package/dist/worker.js CHANGED
@@ -1,11 +1,11 @@
1
- export { r as runBaseTests } from './chunks/base.B04-CjXH.js';
2
- export { i as init } from './chunks/init.CfeGZ8J3.js';
1
+ export { r as runBaseTests } from './chunks/base.BAf_bYeI.js';
2
+ export { i as init } from './chunks/init.DUeOfNO9.js';
3
3
  import 'node:vm';
4
4
  import '@vitest/spy';
5
5
  import './chunks/evaluatedModules.Dg1zASAC.js';
6
6
  import 'pathe';
7
7
  import 'vite/module-runner';
8
- import './chunks/startModuleRunner.iF1E9Bt4.js';
8
+ import './chunks/startModuleRunner.Di-EZqh0.js';
9
9
  import 'node:fs';
10
10
  import 'node:module';
11
11
  import '@vitest/utils/helpers';
@@ -42,5 +42,5 @@ import 'node:util';
42
42
  import '@vitest/utils/constants';
43
43
  import './chunks/index.RwjEGCQ0.js';
44
44
  import 'expect-type';
45
- import './chunks/index.DON9WL-E.js';
45
+ import './chunks/index.DV0mQLEO.js';
46
46
  import 'node:console';
@@ -1,11 +1,11 @@
1
- import { r as runBaseTests } from '../chunks/base.B04-CjXH.js';
2
- import { w as workerInit } from '../chunks/init-forks.D3tMfiuX.js';
1
+ import { r as runBaseTests } from '../chunks/base.BAf_bYeI.js';
2
+ import { w as workerInit } from '../chunks/init-forks.CSGFj9zN.js';
3
3
  import 'node:vm';
4
4
  import '@vitest/spy';
5
5
  import '../chunks/evaluatedModules.Dg1zASAC.js';
6
6
  import 'pathe';
7
7
  import 'vite/module-runner';
8
- import '../chunks/startModuleRunner.iF1E9Bt4.js';
8
+ import '../chunks/startModuleRunner.Di-EZqh0.js';
9
9
  import 'node:fs';
10
10
  import 'node:module';
11
11
  import '@vitest/utils/helpers';
@@ -43,8 +43,8 @@ import '@vitest/utils/constants';
43
43
  import '../chunks/index.RwjEGCQ0.js';
44
44
  import 'expect-type';
45
45
  import 'node:v8';
46
- import '../chunks/init.CfeGZ8J3.js';
47
- import '../chunks/index.DON9WL-E.js';
46
+ import '../chunks/init.DUeOfNO9.js';
47
+ import '../chunks/index.DV0mQLEO.js';
48
48
  import 'node:console';
49
49
 
50
50
  workerInit({ runTests: runBaseTests });
@@ -1,11 +1,11 @@
1
- import { r as runBaseTests } from '../chunks/base.B04-CjXH.js';
2
- import { w as workerInit } from '../chunks/init-threads.yLRZD8Id.js';
1
+ import { r as runBaseTests } from '../chunks/base.BAf_bYeI.js';
2
+ import { w as workerInit } from '../chunks/init-threads.CIJLeFO8.js';
3
3
  import 'node:vm';
4
4
  import '@vitest/spy';
5
5
  import '../chunks/evaluatedModules.Dg1zASAC.js';
6
6
  import 'pathe';
7
7
  import 'vite/module-runner';
8
- import '../chunks/startModuleRunner.iF1E9Bt4.js';
8
+ import '../chunks/startModuleRunner.Di-EZqh0.js';
9
9
  import 'node:fs';
10
10
  import 'node:module';
11
11
  import '@vitest/utils/helpers';
@@ -43,8 +43,8 @@ import '@vitest/utils/constants';
43
43
  import '../chunks/index.RwjEGCQ0.js';
44
44
  import 'expect-type';
45
45
  import 'node:worker_threads';
46
- import '../chunks/init.CfeGZ8J3.js';
47
- import '../chunks/index.DON9WL-E.js';
46
+ import '../chunks/init.DUeOfNO9.js';
47
+ import '../chunks/index.DV0mQLEO.js';
48
48
  import 'node:console';
49
49
 
50
50
  workerInit({ runTests: runBaseTests });
@@ -1,7 +1,7 @@
1
- import { w as workerInit } from '../chunks/init-forks.D3tMfiuX.js';
2
- import { r as runVmTests } from '../chunks/vm.CuMWYx_F.js';
1
+ import { w as workerInit } from '../chunks/init-forks.CSGFj9zN.js';
2
+ import { r as runVmTests } from '../chunks/vm.Co_lR2NL.js';
3
3
  import 'node:v8';
4
- import '../chunks/init.CfeGZ8J3.js';
4
+ import '../chunks/init.DUeOfNO9.js';
5
5
  import '@vitest/utils/error';
6
6
  import '@vitest/utils/source-map';
7
7
  import 'node:fs';
@@ -9,7 +9,7 @@ import 'node:module';
9
9
  import 'node:url';
10
10
  import 'pathe';
11
11
  import 'vite/module-runner';
12
- import '../chunks/startModuleRunner.iF1E9Bt4.js';
12
+ import '../chunks/startModuleRunner.Di-EZqh0.js';
13
13
  import '@vitest/utils/helpers';
14
14
  import '../path.js';
15
15
  import 'node:path';
@@ -17,7 +17,7 @@ import '@vitest/utils/serialize';
17
17
  import '../module-evaluator.js';
18
18
  import 'node:vm';
19
19
  import '@vitest/mocker';
20
- import '../chunks/index.DON9WL-E.js';
20
+ import '../chunks/index.DV0mQLEO.js';
21
21
  import 'node:console';
22
22
  import '../chunks/inspector.DLZxSeU3.js';
23
23
  import '../chunks/evaluatedModules.Dg1zASAC.js';
@@ -1,7 +1,7 @@
1
- import { w as workerInit } from '../chunks/init-threads.yLRZD8Id.js';
2
- import { r as runVmTests } from '../chunks/vm.CuMWYx_F.js';
1
+ import { w as workerInit } from '../chunks/init-threads.CIJLeFO8.js';
2
+ import { r as runVmTests } from '../chunks/vm.Co_lR2NL.js';
3
3
  import 'node:worker_threads';
4
- import '../chunks/init.CfeGZ8J3.js';
4
+ import '../chunks/init.DUeOfNO9.js';
5
5
  import '@vitest/utils/error';
6
6
  import '@vitest/utils/source-map';
7
7
  import 'node:fs';
@@ -9,7 +9,7 @@ import 'node:module';
9
9
  import 'node:url';
10
10
  import 'pathe';
11
11
  import 'vite/module-runner';
12
- import '../chunks/startModuleRunner.iF1E9Bt4.js';
12
+ import '../chunks/startModuleRunner.Di-EZqh0.js';
13
13
  import '@vitest/utils/helpers';
14
14
  import '../path.js';
15
15
  import 'node:path';
@@ -17,7 +17,7 @@ import '@vitest/utils/serialize';
17
17
  import '../module-evaluator.js';
18
18
  import 'node:vm';
19
19
  import '@vitest/mocker';
20
- import '../chunks/index.DON9WL-E.js';
20
+ import '../chunks/index.DV0mQLEO.js';
21
21
  import 'node:console';
22
22
  import '../chunks/inspector.DLZxSeU3.js';
23
23
  import '../chunks/evaluatedModules.Dg1zASAC.js';
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "vitest",
3
3
  "type": "module",
4
- "version": "4.0.4",
4
+ "version": "4.0.6",
5
5
  "description": "Next generation testing framework powered by Vite",
6
6
  "author": "Anthony Fu <anthonyfu117@hotmail.com>",
7
7
  "license": "MIT",
@@ -134,10 +134,10 @@
134
134
  "@types/node": "^20.0.0 || ^22.0.0 || >=24.0.0",
135
135
  "happy-dom": "*",
136
136
  "jsdom": "*",
137
- "@vitest/browser-playwright": "4.0.4",
138
- "@vitest/browser-webdriverio": "4.0.4",
139
- "@vitest/ui": "4.0.4",
140
- "@vitest/browser-preview": "4.0.4"
137
+ "@vitest/browser-playwright": "4.0.6",
138
+ "@vitest/browser-webdriverio": "4.0.6",
139
+ "@vitest/ui": "4.0.6",
140
+ "@vitest/browser-preview": "4.0.6"
141
141
  },
142
142
  "peerDependenciesMeta": {
143
143
  "@edge-runtime/vm": {
@@ -182,13 +182,13 @@
182
182
  "tinyrainbow": "^3.0.3",
183
183
  "vite": "^6.0.0 || ^7.0.0",
184
184
  "why-is-node-running": "^2.3.0",
185
- "@vitest/mocker": "4.0.4",
186
- "@vitest/expect": "4.0.4",
187
- "@vitest/runner": "4.0.4",
188
- "@vitest/pretty-format": "4.0.4",
189
- "@vitest/snapshot": "4.0.4",
190
- "@vitest/spy": "4.0.4",
191
- "@vitest/utils": "4.0.4"
185
+ "@vitest/expect": "4.0.6",
186
+ "@vitest/pretty-format": "4.0.6",
187
+ "@vitest/runner": "4.0.6",
188
+ "@vitest/mocker": "4.0.6",
189
+ "@vitest/utils": "4.0.6",
190
+ "@vitest/spy": "4.0.6",
191
+ "@vitest/snapshot": "4.0.6"
192
192
  },
193
193
  "devDependencies": {
194
194
  "@antfu/install-pkg": "^1.1.0",