vitest 4.0.3 → 4.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.
@@ -1,10 +1,10 @@
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.BqQUfEjB.js';
5
5
  import { performance } from 'node:perf_hooks';
6
6
  import { startTests, collectTests } from '@vitest/runner';
7
- import { a as resolveSnapshotEnvironment, s as setupChaiConfig, r as resolveTestRunner } from './resolveSnapshotEnvironment.yzXri_YN.js';
7
+ import { a as resolveSnapshotEnvironment, s as setupChaiConfig, r as resolveTestRunner } from './resolveSnapshotEnvironment.BZzLjzkh.js';
8
8
  import { c as setupCommonEnv, s as startCoverageInsideWorker, a as stopCoverageInsideWorker } from './setup-common.DR1sucx6.js';
9
9
  import { g as globalExpect, v as vi } from './vi.BZvkKVkM.js';
10
10
  import { c as closeInspector } from './inspector.DLZxSeU3.js';
@@ -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.3";
622
+ var version = "4.0.5";
623
623
 
624
624
  const apiConfig = (port) => ({
625
625
  port: {
@@ -1294,7 +1294,7 @@ function normalizeCliOptions(cliFilters, argv) {
1294
1294
  }
1295
1295
  async function start(mode, cliFilters, options) {
1296
1296
  try {
1297
- const { startVitest } = await import('./cli-api.D24RdiHp.js').then(function (n) { return n.p; }), ctx = await startVitest(mode, cliFilters.map(normalize), normalizeCliOptions(cliFilters, options));
1297
+ const { startVitest } = await import('./cli-api.6GYRwzrM.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
1300
  const { errorBanner } = await import('./index.CcRZ6fUh.js').then(function (n) { return n.u; });
@@ -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.D24RdiHp.js').then(function (n) { return n.p; }), ctx = await prepareVitest(mode, {
1312
+ const { prepareVitest, processCollected, outputFileList } = await import('./cli-api.6GYRwzrM.js').then(function (n) { return n.p; }), ctx = await prepareVitest(mode, {
1313
1313
  ...normalizeCliOptions(cliFilters, options),
1314
1314
  watch: false,
1315
1315
  run: true
@@ -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.DT47gDHj.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,7 +12,7 @@ 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.D3tBgDur.js';
15
+ import { v as version$1 } from './cac.Be29vze6.js';
15
16
  import { c as createBirpc } from './index.Bgo3tNWt.js';
16
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.CcRZ6fUh.js';
17
18
  import require$$0$3 from 'events';
@@ -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.BJHGXm3x.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';
@@ -5054,10 +5054,9 @@ function clearId(id) {
5054
5054
  function cloneByOwnProperties(value) {
5055
5055
  // Clones the value's properties into a new Object. The simpler approach of
5056
5056
  // Object.assign() won't work in the case that properties are not enumerable.
5057
- return Object.getOwnPropertyNames(value).reduce((clone, prop) => ({
5058
- ...clone,
5059
- [prop]: value[prop]
5060
- }), {});
5057
+ return Object.getOwnPropertyNames(value).reduce((clone, prop) => {
5058
+ return clone[prop] = value[prop], clone;
5059
+ }, {});
5061
5060
  }
5062
5061
  /**
5063
5062
  * Replacer function for serialization methods such as JS.stringify() or
@@ -5818,7 +5817,6 @@ function normalizeResolvedIdToUrl(environment, resolvedId) {
5818
5817
  return url;
5819
5818
  }
5820
5819
 
5821
- const nodeBuiltins = builtinModules.filter((id) => !id.includes(":"));
5822
5820
  class ServerModuleRunner extends ModuleRunner {
5823
5821
  constructor(environment, fetcher, config) {
5824
5822
  super({
@@ -5826,7 +5824,7 @@ class ServerModuleRunner extends ModuleRunner {
5826
5824
  transport: { async invoke(event) {
5827
5825
  if (event.type !== "custom") throw new Error(`Vitest Module Runner doesn't support Vite HMR events.`);
5828
5826
  const { name, data } = event.data;
5829
- if (name === "getBuiltins") return { result: [...nodeBuiltins, /^node:/] };
5827
+ if (name === "getBuiltins") return await environment.hot.handleInvoke(event);
5830
5828
  if (name !== "fetchModule") return { error: /* @__PURE__ */ new Error(`Unknown method: ${name}. Expected "fetchModule".`) };
5831
5829
  try {
5832
5830
  return { result: await fetcher(data[0], data[1], environment, false, data[2]) };
@@ -6344,11 +6342,17 @@ function createMethodsRPC(project, options = {}) {
6344
6342
  const environment = project.vite.environments[environmentName];
6345
6343
  if (!environment) throw new Error(`The environment ${environmentName} was not defined in the Vite config.`);
6346
6344
  const resolved = await environment.pluginContainer.resolveId(id, importer);
6347
- return resolved ? {
6345
+ if (!resolved) return null;
6346
+ const file = cleanUrl(resolved.id);
6347
+ return resolved.external ? {
6348
+ file,
6349
+ url: !resolved.id.startsWith("node:") && isBuiltin(resolved.id) ? `node:${resolved.id}` : resolved.id,
6350
+ id: resolved.id
6351
+ } : {
6348
6352
  file: cleanUrl(resolved.id),
6349
6353
  url: normalizeResolvedIdToUrl(environment, resolved.id),
6350
6354
  id: resolved.id
6351
- } : null;
6355
+ };
6352
6356
  },
6353
6357
  snapshotSaved(snapshot) {
6354
6358
  vitest.snapshot.add(snapshot);
@@ -6538,9 +6542,11 @@ class ForksPoolWorker {
6538
6542
  execArgv;
6539
6543
  env;
6540
6544
  _fork;
6545
+ stdout;
6546
+ stderr;
6541
6547
  constructor(options) {
6542
6548
  /** Loads {@link file://./../../../runtime/workers/forks.ts} */
6543
- this.execArgv = options.execArgv, this.env = options.env, this.entrypoint = resolve$1(options.distPath, "workers/forks.js");
6549
+ this.execArgv = options.execArgv, this.env = options.env, this.stdout = options.project.vitest.logger.outputStream, this.stderr = options.project.vitest.logger.errorStream, this.entrypoint = resolve$1(options.distPath, "workers/forks.js");
6544
6550
  }
6545
6551
  on(event, callback) {
6546
6552
  this.fork.on(event, callback);
@@ -6559,17 +6565,21 @@ class ForksPoolWorker {
6559
6565
  this.fork.send(v8.serialize(message));
6560
6566
  }
6561
6567
  async start() {
6562
- this._fork ||= fork(this.entrypoint, [], {
6568
+ if (this._fork ||= fork(this.entrypoint, [], {
6563
6569
  env: this.env,
6564
- execArgv: this.execArgv
6565
- });
6570
+ execArgv: this.execArgv,
6571
+ stdio: "pipe"
6572
+ }), this._fork.stdout) this.stdout.setMaxListeners(1 + this.stdout.getMaxListeners()), this._fork.stdout.pipe(this.stdout);
6573
+ if (this._fork.stderr) this.stderr.setMaxListeners(1 + this.stderr.getMaxListeners()), this._fork.stderr.pipe(this.stderr);
6566
6574
  }
6567
6575
  async stop() {
6568
6576
  const fork = this.fork, waitForExit = new Promise((resolve) => {
6569
6577
  if (fork.exitCode != null) resolve();
6570
6578
  else fork.once("exit", resolve);
6571
6579
  }), sigkillTimeout = setTimeout(() => fork.kill("SIGKILL"), SIGKILL_TIMEOUT);
6572
- fork.kill(), await waitForExit, clearTimeout(sigkillTimeout), this._fork = void 0;
6580
+ if (fork.kill(), await waitForExit, clearTimeout(sigkillTimeout), fork.stdout) fork.stdout?.unpipe(this.stdout), this.stdout.setMaxListeners(this.stdout.getMaxListeners() - 1);
6581
+ if (fork.stderr) fork.stderr?.unpipe(this.stderr), this.stderr.setMaxListeners(this.stderr.getMaxListeners() - 1);
6582
+ this._fork = void 0;
6573
6583
  }
6574
6584
  deserialize(data) {
6575
6585
  try {
@@ -6614,9 +6624,11 @@ class ThreadsPoolWorker {
6614
6624
  execArgv;
6615
6625
  env;
6616
6626
  _thread;
6627
+ stdout;
6628
+ stderr;
6617
6629
  constructor(options) {
6618
6630
  /** Loads {@link file://./../../../runtime/workers/threads.ts} */
6619
- this.execArgv = options.execArgv, this.env = options.env, this.entrypoint = resolve$1(options.distPath, "workers/threads.js");
6631
+ this.execArgv = options.execArgv, this.env = options.env, this.stdout = options.project.vitest.logger.outputStream, this.stderr = options.project.vitest.logger.errorStream, this.entrypoint = resolve$1(options.distPath, "workers/threads.js");
6620
6632
  }
6621
6633
  on(event, callback) {
6622
6634
  this.thread.on(event, callback);
@@ -6628,16 +6640,15 @@ class ThreadsPoolWorker {
6628
6640
  this.thread.postMessage(message);
6629
6641
  }
6630
6642
  async start() {
6631
- // This can be called multiple times if the runtime is shared.
6632
6643
  this._thread ||= new Worker(this.entrypoint, {
6633
6644
  env: this.env,
6634
- execArgv: this.execArgv
6635
- });
6645
+ execArgv: this.execArgv,
6646
+ stdout: true,
6647
+ stderr: true
6648
+ }), this.stdout.setMaxListeners(1 + this.stdout.getMaxListeners()), this._thread.stdout.pipe(this.stdout), this.stderr.setMaxListeners(1 + this.stderr.getMaxListeners()), this._thread.stderr.pipe(this.stderr);
6636
6649
  }
6637
6650
  async stop() {
6638
- await this.thread.terminate().then(() => {
6639
- this._thread = void 0;
6640
- });
6651
+ await this.thread.terminate(), this._thread?.stdout?.unpipe(this.stdout), this.stdout.setMaxListeners(this.stdout.getMaxListeners() - 1), this._thread?.stderr?.unpipe(this.stderr), this.stderr.setMaxListeners(this.stderr.getMaxListeners() - 1), this._thread = void 0;
6641
6652
  }
6642
6653
  deserialize(data) {
6643
6654
  return data;
@@ -6838,9 +6849,7 @@ class Pool {
6838
6849
  method,
6839
6850
  cancelTask
6840
6851
  };
6841
- this.activeTasks.push(activeTask), runner.on("error", (error) => {
6842
- resolver.reject(new Error(`[vitest-pool]: Worker ${task.worker} emitted error.`, { cause: error }));
6843
- });
6852
+ this.activeTasks.push(activeTask);
6844
6853
  async function cancelTask() {
6845
6854
  await runner.stop(), resolver.reject(/* @__PURE__ */ new Error("Cancelled"));
6846
6855
  }
@@ -6852,6 +6861,9 @@ class Pool {
6852
6861
  }
6853
6862
  };
6854
6863
  if (runner.on("message", onFinished), !runner.isStarted) {
6864
+ runner.on("error", (error) => {
6865
+ resolver.reject(new Error(`[vitest-pool]: Worker ${task.worker} emitted error.`, { cause: error }));
6866
+ });
6855
6867
  const id = setTimeout(() => resolver.reject(/* @__PURE__ */ new Error(`[vitest-pool]: Timeout starting ${task.worker} runner.`)), WORKER_START_TIMEOUT);
6856
6868
  await runner.start().finally(() => clearTimeout(id));
6857
6869
  }
@@ -6967,7 +6979,7 @@ function createPool(ctx) {
6967
6979
  }
6968
6980
  const taskGroups = [];
6969
6981
  let workerId = 0;
6970
- 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();
6971
6983
  for (const group of groups) {
6972
6984
  if (!group) continue;
6973
6985
  const taskGroup = [], browserSpecs = [];
@@ -7091,27 +7103,42 @@ function getMemoryLimit(config, pool) {
7091
7103
  // just ignore "memoryLimit" value because we cannot detect memory limit
7092
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;
7093
7105
  }
7094
- function groupSpecs(specs) {
7106
+ function groupSpecs(specs, environments) {
7095
7107
  const groups = [], sequential = {
7096
7108
  specs: [],
7097
7109
  maxWorkers: 1
7098
- }, 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
+ }
7099
7121
  specs.forEach((spec) => {
7100
7122
  if (spec.pool === "typescript") {
7101
7123
  typechecks[spec.project.name] ||= [], typechecks[spec.project.name].push(spec);
7102
7124
  return;
7103
7125
  }
7104
7126
  const order = spec.project.config.sequence.groupOrder;
7105
- // Files that have disabled parallelism and default groupId are set into their own group
7127
+ // Files that have disabled parallelism and default groupOrder are set into their own group
7106
7128
  if (order === 0 && spec.project.config.fileParallelism === false) return sequential.specs.push([spec]);
7107
- const maxWorkers = resolveMaxWorkers(spec.project);
7108
- // Multiple projects with different maxWorkers but same groupId
7129
+ const maxWorkers = resolveMaxWorkers(spec.project), isolate = spec.project.config.isolate;
7130
+ // Multiple projects with different maxWorkers but same groupOrder
7109
7131
  if (groups[order] ||= {
7110
7132
  specs: [],
7111
7133
  maxWorkers
7112
7134
  }, groups[order].maxWorkers !== maxWorkers) {
7113
7135
  const last = groups[order].specs.at(-1)?.at(-1)?.project.name;
7114
- 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);
7115
7142
  }
7116
7143
  groups[order].specs.push([spec]);
7117
7144
  });
@@ -8045,6 +8072,15 @@ function ModuleRunnerTransform() {
8045
8072
  names.add("client"), names.add("ssr");
8046
8073
  const pool = config.test?.pool;
8047
8074
  if (pool === "vmForks" || pool === "vmThreads") names.add("__vitest_vm__");
8075
+ let moduleDirectories = testConfig.deps?.moduleDirectories || [];
8076
+ const envModuleDirectories = process.env.VITEST_MODULE_DIRECTORIES || process.env.npm_config_VITEST_MODULE_DIRECTORIES;
8077
+ if (envModuleDirectories) moduleDirectories.push(...envModuleDirectories.split(","));
8078
+ if (moduleDirectories = moduleDirectories.map((dir) => {
8079
+ if (dir[0] !== "/") dir = `/${dir}`;
8080
+ if (!dir.endsWith("/")) dir += "/";
8081
+ return normalize(dir);
8082
+ }), !moduleDirectories.includes("/node_modules/")) moduleDirectories.push("/node_modules/");
8083
+ testConfig.deps ??= {}, testConfig.deps.moduleDirectories = moduleDirectories;
8048
8084
  const external = [], noExternal = [];
8049
8085
  let noExternalAll;
8050
8086
  for (const name of names) {
@@ -8057,11 +8093,20 @@ function ModuleRunnerTransform() {
8057
8093
  const resolveExternal = name === "client" ? config.resolve?.external : [], resolveNoExternal = name === "client" ? config.resolve?.noExternal : [], topLevelResolveOptions = {};
8058
8094
  if (resolveExternal != null) topLevelResolveOptions.external = resolveExternal;
8059
8095
  if (resolveNoExternal != null) topLevelResolveOptions.noExternal = resolveNoExternal;
8060
- const currentResolveOptions = mergeConfig(topLevelResolveOptions, environment.resolve || {}), envNoExternal = resolveViteResolveOptions("noExternal", currentResolveOptions);
8096
+ const currentResolveOptions = mergeConfig(topLevelResolveOptions, environment.resolve || {}), envNoExternal = resolveViteResolveOptions("noExternal", currentResolveOptions, moduleDirectories);
8061
8097
  if (envNoExternal === true) noExternalAll = true;
8062
- else noExternal.push(...envNoExternal);
8063
- const envExternal = resolveViteResolveOptions("external", currentResolveOptions);
8064
- if (envExternal !== true) external.push(...envExternal);
8098
+ else if (envNoExternal.length) noExternal.push(...envNoExternal);
8099
+ else if (name === "client" || name === "ssr") {
8100
+ const deprecatedNoExternal = resolveDeprecatedOptions(name === "client" ? config.resolve?.noExternal : config.ssr?.noExternal, moduleDirectories);
8101
+ if (deprecatedNoExternal === true) noExternalAll = true;
8102
+ else noExternal.push(...deprecatedNoExternal);
8103
+ }
8104
+ const envExternal = resolveViteResolveOptions("external", currentResolveOptions, moduleDirectories);
8105
+ if (envExternal !== true && envExternal.length) external.push(...envExternal);
8106
+ else if (name === "client" || name === "ssr") {
8107
+ const deprecatedExternal = resolveDeprecatedOptions(name === "client" ? config.resolve?.external : config.ssr?.external, moduleDirectories);
8108
+ if (deprecatedExternal !== true) external.push(...deprecatedExternal);
8109
+ }
8065
8110
  if (environment.resolve ??= {}, environment.resolve.external = [...builtinModules, ...builtinModules.map((m) => `node:${m}`)], environment.resolve.noExternal = true, name === "__vitest_vm__" || name === "__vitest__") continue;
8066
8111
  const currentOptimizeDeps = environment.optimizeDeps || (name === "client" ? config.optimizeDeps : name === "ssr" ? config.ssr?.optimizeDeps : void 0), optimizeDeps = resolveOptimizerConfig(testConfig.deps?.optimizer?.[name], currentOptimizeDeps);
8067
8112
  // Vite respects the root level optimize deps, so we override it instead
@@ -8078,8 +8123,19 @@ function ModuleRunnerTransform() {
8078
8123
  }
8079
8124
  };
8080
8125
  }
8081
- function resolveViteResolveOptions(key, options) {
8082
- return Array.isArray(options[key]) ? options[key] : typeof options[key] === "string" || options[key] instanceof RegExp ? [options[key]] : typeof options[key] === "boolean" ? true : [];
8126
+ function resolveViteResolveOptions(key, options, moduleDirectories) {
8127
+ 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 : [];
8128
+ }
8129
+ function resolveDeprecatedOptions(options, moduleDirectories) {
8130
+ return options === true ? true : Array.isArray(options) ? options.map((dep) => processWildcard(dep, moduleDirectories)) : options == null ? [] : [processWildcard(options, moduleDirectories)];
8131
+ }
8132
+ function processWildcard(dep, moduleDirectories) {
8133
+ if (typeof dep !== "string") return dep;
8134
+ if (typeof dep === "string" && dep.includes("*")) {
8135
+ const directories = (moduleDirectories || ["/node_modules/"]).map((r) => escapeRegExp(r));
8136
+ return /* @__PURE__ */ new RegExp(`(${directories.join("|")})${dep.replace(/\*/g, "[\\w/]+")}`);
8137
+ }
8138
+ return dep;
8083
8139
  }
8084
8140
 
8085
8141
  function VitestProjectResolver(ctx) {
@@ -8311,14 +8367,14 @@ async function _shouldExternalize(id, options) {
8311
8367
  // also externalize network imports since nodejs allows it when --experimental-network-imports
8312
8368
  if (isBuiltin(id) || id.startsWith("data:") || /^(?:https?:)?\/\//.test(id)) return id;
8313
8369
  const moduleDirectories = options?.moduleDirectories || ["/node_modules/"];
8314
- if (matchExternalizePattern(id, moduleDirectories, options?.inline) || options?.inlineFiles && options?.inlineFiles.includes(id)) return false;
8370
+ if (matchPattern(id, moduleDirectories, options?.inline) || options?.inlineFiles && options?.inlineFiles.includes(id)) return false;
8315
8371
  // Unless the user explicitly opted to inline them, externalize Vite deps.
8316
8372
  // They are too big to inline by default.
8317
- if (matchExternalizePattern(id, moduleDirectories, options?.external) || options?.cacheDir && id.includes(options.cacheDir)) return id;
8373
+ if (matchPattern(id, moduleDirectories, options?.external) || options?.cacheDir && id.includes(options.cacheDir)) return id;
8318
8374
  const isLibraryModule = moduleDirectories.some((dir) => id.includes(dir));
8319
- return id = isLibraryModule && options?.fallbackCJS ? guessCJSversion(id) || id : id, matchExternalizePattern(id, moduleDirectories, defaultInline) ? false : matchExternalizePattern(id, moduleDirectories, depsExternal) || isLibraryModule && await isValidNodeImport(id) ? id : false;
8375
+ return id = isLibraryModule && options?.fallbackCJS ? guessCJSversion(id) || id : id, matchPattern(id, moduleDirectories, defaultInline) ? false : matchPattern(id, moduleDirectories, depsExternal) || isLibraryModule && await isValidNodeImport(id) ? id : false;
8320
8376
  }
8321
- function matchExternalizePattern(id, moduleDirectories, patterns) {
8377
+ function matchPattern(id, moduleDirectories, patterns) {
8322
8378
  if (patterns == null) return false;
8323
8379
  if (patterns === true) return true;
8324
8380
  for (const ex of patterns) if (typeof ex === "string") {
@@ -11151,7 +11207,7 @@ function removeUndefinedValues(obj) {
11151
11207
  }
11152
11208
 
11153
11209
  async function createVitest(mode, options, viteOverrides = {}, vitestOptions = {}) {
11154
- 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 });
11210
+ 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 });
11155
11211
  options.config = configPath;
11156
11212
  const { browser: _removeBrowser,...restOptions } = options, config = {
11157
11213
  configFile: configPath,
@@ -2447,7 +2447,7 @@ function resolveConfig$1(vitest, options, viteConfig) {
2447
2447
  mode
2448
2448
  };
2449
2449
  if (options.pool && typeof options.pool !== "string") resolved.pool = options.pool.name, resolved.poolRunner = options.pool;
2450
- if (resolved.pool ??= "forks", resolved.project = toArray(resolved.project), resolved.provide ??= {}, resolved.name = typeof options.name === "string" ? options.name : options.name?.label || "", resolved.color = typeof options.name !== "string" ? options.name?.color : void 0, resolved.environment === "browser") throw new Error(`Looks like you set "test.environment" to "browser". To enabled Browser Mode, use "test.browser.enabled" instead.`);
2450
+ if (resolved.pool ??= "forks", resolved.project = toArray(resolved.project), resolved.provide ??= {}, resolved.name = typeof options.name === "string" ? options.name : options.name?.label || "", resolved.color = typeof options.name !== "string" ? options.name?.color : void 0, resolved.environment === "browser") throw new Error(`Looks like you set "test.environment" to "browser". To enable Browser Mode, use "test.browser.enabled" instead.`);
2451
2451
  const inspector = resolved.inspect || resolved.inspectBrk;
2452
2452
  if (resolved.inspector = {
2453
2453
  ...resolved.inspector,
@@ -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,
@@ -3113,4 +3105,4 @@ function resolveMergeConfig(mod) {
3113
3105
  }
3114
3106
  }
3115
3107
 
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 };
3108
+ 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 };
@@ -1,5 +1,5 @@
1
1
  import v8 from 'node:v8';
2
- import { i as init } from './init.DvvF4rpe.js';
2
+ import { i as init } from './init.CpZMjXJJ.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.DvvF4rpe.js';
2
+ import { i as init } from './init.CpZMjXJJ.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,11 +5,11 @@ 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';
8
+ import { b as VitestTransport } from './startModuleRunner.BqQUfEjB.js';
9
9
  import { e as environments } from './index.DON9WL-E.js';
10
10
  import { s as setupInspect } from './inspector.DLZxSeU3.js';
11
11
  import { V as VitestEvaluatedModules } from './evaluatedModules.Dg1zASAC.js';
12
- import { c as createRuntimeRpc, a as rpcDone } from './rpc.cD77ENhU.js';
12
+ import { c as createRuntimeRpc, a as rpcDone } from './rpc.Dv1Jt3i2.js';
13
13
 
14
14
  function isBuiltinEnvironment(env) {
15
15
  return env in environments;
@@ -1,8 +1,8 @@
1
1
  import { chai } from '@vitest/expect';
2
2
  import { l as loadDiffConfig, b as loadSnapshotSerializers, t as takeCoverageInsideWorker } from './setup-common.DR1sucx6.js';
3
- import { r as rpc } from './rpc.cD77ENhU.js';
3
+ import { r as rpc } from './rpc.Dv1Jt3i2.js';
4
4
  import { g as getWorkerState } from './utils.CG9h5ccR.js';
5
- import { V as VitestTestRunner, N as NodeBenchmarkRunner } from './test.CR2PBYe2.js';
5
+ import { V as VitestTestRunner, N as NodeBenchmarkRunner } from './test.CnspO-X4.js';
6
6
 
7
7
  function setupChaiConfig(config) {
8
8
  Object.assign(chai.config, config);
@@ -22,21 +22,23 @@ async function rpcDone() {
22
22
  const awaitable = Array.from(promises);
23
23
  return Promise.all(awaitable);
24
24
  }
25
+ let previousRpc;
25
26
  function createRuntimeRpc(options) {
27
+ if (previousRpc) previousRpc.$close(), previousRpc = void 0;
26
28
  let setCancel = (_reason) => {};
27
29
  const onCancel = new Promise((resolve) => {
28
30
  setCancel = resolve;
29
- });
30
- return {
31
- rpc: createSafeRpc(createBirpc({ onCancel: setCancel }, {
32
- eventNames: [
33
- "onUserConsoleLog",
34
- "onCollected",
35
- "onCancel"
36
- ],
37
- timeout: -1,
38
- ...options
39
- })),
31
+ }), rpc = createSafeRpc(createBirpc({ onCancel: setCancel }, {
32
+ eventNames: [
33
+ "onUserConsoleLog",
34
+ "onCollected",
35
+ "onCancel"
36
+ ],
37
+ timeout: -1,
38
+ ...options
39
+ }));
40
+ return previousRpc = rpc, {
41
+ rpc,
40
42
  onCancel
41
43
  };
42
44
  }
@@ -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) };
@@ -8,7 +8,7 @@ import { getTests, getNames, getTestName } from '@vitest/runner/utils';
8
8
  import { processError } from '@vitest/utils/error';
9
9
  import { normalize } from 'pathe';
10
10
  import { a as getSnapshotClient, i as inject, c as createExpect, v as vi } from './vi.BZvkKVkM.js';
11
- import { r as rpc } from './rpc.cD77ENhU.js';
11
+ import { r as rpc } from './rpc.Dv1Jt3i2.js';
12
12
 
13
13
  function createBenchmarkResult(name) {
14
14
  return {
@@ -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.BqQUfEjB.js';
14
14
  import { p as provideWorkerState } from './utils.CG9h5ccR.js';
15
15
 
16
16
  function interopCommonJsModule(interopDefault, mod) {
package/dist/cli.js CHANGED
@@ -1,4 +1,4 @@
1
- import { c as createCLI } from './chunks/cac.D3tBgDur.js';
1
+ import { c as createCLI } from './chunks/cac.Be29vze6.js';
2
2
  import '@vitest/utils/helpers';
3
3
  import 'events';
4
4
  import 'pathe';
package/dist/coverage.js CHANGED
@@ -1,4 +1,4 @@
1
- export { B as BaseCoverageProvider } from './chunks/coverage.BJHGXm3x.js';
1
+ export { B as BaseCoverageProvider } from './chunks/coverage.DT47gDHj.js';
2
2
  import 'node:fs';
3
3
  import 'node:path';
4
4
  import '@vitest/utils/helpers';
@@ -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.BqQUfEjB.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
@@ -149,6 +149,8 @@ declare class ForksPoolWorker implements PoolWorker {
149
149
  protected execArgv: string[];
150
150
  protected env: Partial<NodeJS.ProcessEnv>;
151
151
  private _fork?;
152
+ private stdout;
153
+ private stderr;
152
154
  constructor(options: PoolOptions);
153
155
  on(event: string, callback: (arg: any) => void): void;
154
156
  off(event: string, callback: (arg: any) => void): void;
@@ -166,6 +168,8 @@ declare class ThreadsPoolWorker implements PoolWorker {
166
168
  protected execArgv: string[];
167
169
  protected env: Partial<NodeJS.ProcessEnv>;
168
170
  private _thread?;
171
+ private stdout;
172
+ private stderr;
169
173
  constructor(options: PoolOptions);
170
174
  on(event: string, callback: (arg: any) => void): void;
171
175
  off(event: string, callback: (arg: any) => void): void;
@@ -233,4 +237,4 @@ declare const createViteServer: typeof vite.createServer;
233
237
  declare const rolldownVersion: string | undefined;
234
238
 
235
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 };
236
- 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.D24RdiHp.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.D24RdiHp.js';
6
- export { p as parseCLI } from './chunks/cac.D3tBgDur.js';
7
- import { r as resolveConfig$2 } from './chunks/coverage.BJHGXm3x.js';
8
- export { b as BaseSequencer, a as resolveApiServerConfig } from './chunks/coverage.BJHGXm3x.js';
4
+ import { V as Vitest, a as VitestPlugin } from './chunks/cli-api.6GYRwzrM.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.6GYRwzrM.js';
6
+ export { p as parseCLI } from './chunks/cac.Be29vze6.js';
7
+ import { r as resolveConfig$2 } from './chunks/coverage.DT47gDHj.js';
8
+ export { b as BaseSequencer, a as resolveApiServerConfig } from './chunks/coverage.DT47gDHj.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';
package/dist/runners.js CHANGED
@@ -1,4 +1,4 @@
1
- export { N as NodeBenchmarkRunner, V as VitestTestRunner } from './chunks/test.CR2PBYe2.js';
1
+ export { N as NodeBenchmarkRunner, V as VitestTestRunner } from './chunks/test.CnspO-X4.js';
2
2
  import '@vitest/runner';
3
3
  import '@vitest/utils/helpers';
4
4
  import '@vitest/utils/timers';
@@ -15,5 +15,5 @@ import '@vitest/utils/offset';
15
15
  import '@vitest/utils/source-map';
16
16
  import './chunks/_commonjsHelpers.BFTU3MAI.js';
17
17
  import './chunks/date.-jtEtIeV.js';
18
- import './chunks/rpc.cD77ENhU.js';
18
+ import './chunks/rpc.Dv1Jt3i2.js';
19
19
  import './chunks/index.Bgo3tNWt.js';
package/dist/worker.js CHANGED
@@ -1,11 +1,11 @@
1
- export { r as runBaseTests } from './chunks/base.CVAgx931.js';
2
- export { i as init } from './chunks/init.DvvF4rpe.js';
1
+ export { r as runBaseTests } from './chunks/base.RFExFinv.js';
2
+ export { i as init } from './chunks/init.CpZMjXJJ.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.BqQUfEjB.js';
9
9
  import 'node:fs';
10
10
  import 'node:module';
11
11
  import '@vitest/utils/helpers';
@@ -17,16 +17,16 @@ import './module-evaluator.js';
17
17
  import '@vitest/mocker';
18
18
  import 'node:perf_hooks';
19
19
  import '@vitest/runner';
20
- import './chunks/resolveSnapshotEnvironment.yzXri_YN.js';
20
+ import './chunks/resolveSnapshotEnvironment.BZzLjzkh.js';
21
21
  import '@vitest/expect';
22
22
  import './chunks/setup-common.DR1sucx6.js';
23
23
  import './chunks/coverage.D_JHT54q.js';
24
24
  import '@vitest/snapshot';
25
25
  import '@vitest/utils/timers';
26
26
  import './chunks/utils.CG9h5ccR.js';
27
- import './chunks/rpc.cD77ENhU.js';
27
+ import './chunks/rpc.Dv1Jt3i2.js';
28
28
  import './chunks/index.Bgo3tNWt.js';
29
- import './chunks/test.CR2PBYe2.js';
29
+ import './chunks/test.CnspO-X4.js';
30
30
  import './chunks/benchmark.DHKMYAts.js';
31
31
  import '@vitest/runner/utils';
32
32
  import '@vitest/utils/error';
@@ -1,11 +1,11 @@
1
- import { r as runBaseTests } from '../chunks/base.CVAgx931.js';
2
- import { w as workerInit } from '../chunks/init-forks.BtwT3q9G.js';
1
+ import { r as runBaseTests } from '../chunks/base.RFExFinv.js';
2
+ import { w as workerInit } from '../chunks/init-forks.WSf5dRNP.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.BqQUfEjB.js';
9
9
  import 'node:fs';
10
10
  import 'node:module';
11
11
  import '@vitest/utils/helpers';
@@ -17,16 +17,16 @@ import '../module-evaluator.js';
17
17
  import '@vitest/mocker';
18
18
  import 'node:perf_hooks';
19
19
  import '@vitest/runner';
20
- import '../chunks/resolveSnapshotEnvironment.yzXri_YN.js';
20
+ import '../chunks/resolveSnapshotEnvironment.BZzLjzkh.js';
21
21
  import '@vitest/expect';
22
22
  import '../chunks/setup-common.DR1sucx6.js';
23
23
  import '../chunks/coverage.D_JHT54q.js';
24
24
  import '@vitest/snapshot';
25
25
  import '@vitest/utils/timers';
26
26
  import '../chunks/utils.CG9h5ccR.js';
27
- import '../chunks/rpc.cD77ENhU.js';
27
+ import '../chunks/rpc.Dv1Jt3i2.js';
28
28
  import '../chunks/index.Bgo3tNWt.js';
29
- import '../chunks/test.CR2PBYe2.js';
29
+ import '../chunks/test.CnspO-X4.js';
30
30
  import '../chunks/benchmark.DHKMYAts.js';
31
31
  import '@vitest/runner/utils';
32
32
  import '@vitest/utils/error';
@@ -43,7 +43,7 @@ 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.DvvF4rpe.js';
46
+ import '../chunks/init.CpZMjXJJ.js';
47
47
  import '../chunks/index.DON9WL-E.js';
48
48
  import 'node:console';
49
49
 
@@ -5,17 +5,17 @@ import timersPromises from 'node:timers/promises';
5
5
  import util from 'node:util';
6
6
  import { startTests, collectTests } from '@vitest/runner';
7
7
  import { KNOWN_ASSET_TYPES } from '@vitest/utils/constants';
8
- import { s as setupChaiConfig, r as resolveTestRunner, a as resolveSnapshotEnvironment } from '../chunks/resolveSnapshotEnvironment.yzXri_YN.js';
8
+ import { s as setupChaiConfig, r as resolveTestRunner, a as resolveSnapshotEnvironment } from '../chunks/resolveSnapshotEnvironment.BZzLjzkh.js';
9
9
  import { c as setupCommonEnv, s as startCoverageInsideWorker, a as stopCoverageInsideWorker } from '../chunks/setup-common.DR1sucx6.js';
10
10
  import { i as index } from '../chunks/index.RwjEGCQ0.js';
11
11
  import { c as closeInspector } from '../chunks/inspector.DLZxSeU3.js';
12
12
  import { g as getWorkerState } from '../chunks/utils.CG9h5ccR.js';
13
13
  import { g as globalExpect } from '../chunks/vi.BZvkKVkM.js';
14
14
  import '@vitest/expect';
15
- import '../chunks/rpc.cD77ENhU.js';
15
+ import '../chunks/rpc.Dv1Jt3i2.js';
16
16
  import '@vitest/utils/timers';
17
17
  import '../chunks/index.Bgo3tNWt.js';
18
- import '../chunks/test.CR2PBYe2.js';
18
+ import '../chunks/test.CnspO-X4.js';
19
19
  import '@vitest/utils/helpers';
20
20
  import '../chunks/benchmark.DHKMYAts.js';
21
21
  import '@vitest/runner/utils';
@@ -1,11 +1,11 @@
1
- import { r as runBaseTests } from '../chunks/base.CVAgx931.js';
2
- import { w as workerInit } from '../chunks/init-threads.BEmFEaEY.js';
1
+ import { r as runBaseTests } from '../chunks/base.RFExFinv.js';
2
+ import { w as workerInit } from '../chunks/init-threads.CgZguQvI.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.BqQUfEjB.js';
9
9
  import 'node:fs';
10
10
  import 'node:module';
11
11
  import '@vitest/utils/helpers';
@@ -17,16 +17,16 @@ import '../module-evaluator.js';
17
17
  import '@vitest/mocker';
18
18
  import 'node:perf_hooks';
19
19
  import '@vitest/runner';
20
- import '../chunks/resolveSnapshotEnvironment.yzXri_YN.js';
20
+ import '../chunks/resolveSnapshotEnvironment.BZzLjzkh.js';
21
21
  import '@vitest/expect';
22
22
  import '../chunks/setup-common.DR1sucx6.js';
23
23
  import '../chunks/coverage.D_JHT54q.js';
24
24
  import '@vitest/snapshot';
25
25
  import '@vitest/utils/timers';
26
26
  import '../chunks/utils.CG9h5ccR.js';
27
- import '../chunks/rpc.cD77ENhU.js';
27
+ import '../chunks/rpc.Dv1Jt3i2.js';
28
28
  import '../chunks/index.Bgo3tNWt.js';
29
- import '../chunks/test.CR2PBYe2.js';
29
+ import '../chunks/test.CnspO-X4.js';
30
30
  import '../chunks/benchmark.DHKMYAts.js';
31
31
  import '@vitest/runner/utils';
32
32
  import '@vitest/utils/error';
@@ -43,7 +43,7 @@ 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.DvvF4rpe.js';
46
+ import '../chunks/init.CpZMjXJJ.js';
47
47
  import '../chunks/index.DON9WL-E.js';
48
48
  import 'node:console';
49
49
 
@@ -1,7 +1,7 @@
1
- import { w as workerInit } from '../chunks/init-forks.BtwT3q9G.js';
2
- import { r as runVmTests } from '../chunks/vm.CuMWYx_F.js';
1
+ import { w as workerInit } from '../chunks/init-forks.WSf5dRNP.js';
2
+ import { r as runVmTests } from '../chunks/vm.CqZQkf-M.js';
3
3
  import 'node:v8';
4
- import '../chunks/init.DvvF4rpe.js';
4
+ import '../chunks/init.CpZMjXJJ.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.BqQUfEjB.js';
13
13
  import '@vitest/utils/helpers';
14
14
  import '../path.js';
15
15
  import 'node:path';
@@ -21,7 +21,7 @@ import '../chunks/index.DON9WL-E.js';
21
21
  import 'node:console';
22
22
  import '../chunks/inspector.DLZxSeU3.js';
23
23
  import '../chunks/evaluatedModules.Dg1zASAC.js';
24
- import '../chunks/rpc.cD77ENhU.js';
24
+ import '../chunks/rpc.Dv1Jt3i2.js';
25
25
  import '@vitest/utils/timers';
26
26
  import '../chunks/index.Bgo3tNWt.js';
27
27
  import '../chunks/utils.CG9h5ccR.js';
@@ -1,7 +1,7 @@
1
- import { w as workerInit } from '../chunks/init-threads.BEmFEaEY.js';
2
- import { r as runVmTests } from '../chunks/vm.CuMWYx_F.js';
1
+ import { w as workerInit } from '../chunks/init-threads.CgZguQvI.js';
2
+ import { r as runVmTests } from '../chunks/vm.CqZQkf-M.js';
3
3
  import 'node:worker_threads';
4
- import '../chunks/init.DvvF4rpe.js';
4
+ import '../chunks/init.CpZMjXJJ.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.BqQUfEjB.js';
13
13
  import '@vitest/utils/helpers';
14
14
  import '../path.js';
15
15
  import 'node:path';
@@ -21,7 +21,7 @@ import '../chunks/index.DON9WL-E.js';
21
21
  import 'node:console';
22
22
  import '../chunks/inspector.DLZxSeU3.js';
23
23
  import '../chunks/evaluatedModules.Dg1zASAC.js';
24
- import '../chunks/rpc.cD77ENhU.js';
24
+ import '../chunks/rpc.Dv1Jt3i2.js';
25
25
  import '@vitest/utils/timers';
26
26
  import '../chunks/index.Bgo3tNWt.js';
27
27
  import '../chunks/utils.CG9h5ccR.js';
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "vitest",
3
3
  "type": "module",
4
- "version": "4.0.3",
4
+ "version": "4.0.5",
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.3",
138
- "@vitest/browser-preview": "4.0.3",
139
- "@vitest/browser-webdriverio": "4.0.3",
140
- "@vitest/ui": "4.0.3"
137
+ "@vitest/browser-preview": "4.0.5",
138
+ "@vitest/browser-webdriverio": "4.0.5",
139
+ "@vitest/browser-playwright": "4.0.5",
140
+ "@vitest/ui": "4.0.5"
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/expect": "4.0.3",
186
- "@vitest/mocker": "4.0.3",
187
- "@vitest/pretty-format": "4.0.3",
188
- "@vitest/runner": "4.0.3",
189
- "@vitest/spy": "4.0.3",
190
- "@vitest/utils": "4.0.3",
191
- "@vitest/snapshot": "4.0.3"
185
+ "@vitest/expect": "4.0.5",
186
+ "@vitest/runner": "4.0.5",
187
+ "@vitest/spy": "4.0.5",
188
+ "@vitest/utils": "4.0.5",
189
+ "@vitest/snapshot": "4.0.5",
190
+ "@vitest/mocker": "4.0.5",
191
+ "@vitest/pretty-format": "4.0.5"
192
192
  },
193
193
  "devDependencies": {
194
194
  "@antfu/install-pkg": "^1.1.0",