vitest 4.0.5 → 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.RFExFinv.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.Be29vze6.js → cac.BBqWH4nd.js} +6 -6
  5. package/dist/chunks/{cli-api.6GYRwzrM.js → cli-api.UL3SwFUb.js} +7 -8
  6. package/dist/chunks/{config.d.u2CUDWwS.d.ts → config.d.BTfZNUu9.d.ts} +0 -1
  7. package/dist/chunks/{coverage.DT47gDHj.js → coverage.DuCn_Tmx.js} +8 -13
  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.WSf5dRNP.js → init-forks.CSGFj9zN.js} +1 -1
  13. package/dist/chunks/{init-threads.CgZguQvI.js → init-threads.CIJLeFO8.js} +1 -1
  14. package/dist/chunks/{init.CpZMjXJJ.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.BqQUfEjB.js → startModuleRunner.Di-EZqh0.js} +10 -0
  19. package/dist/chunks/{vm.CqZQkf-M.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 +8 -8
  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.BqQUfEjB.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.5";
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.6GYRwzrM.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.6GYRwzrM.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,7 +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
+ 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';
8
8
  import * as vite from 'vite';
9
9
  import { parseAst, fetchModule, version, searchForWorkspaceRoot, mergeConfig, createServer } from 'vite';
10
10
  import { A as API_PATH, c as configFiles, d as defaultBrowserPort, a as defaultPort } from './constants.D_Q9UYh-.js';
@@ -12,9 +12,9 @@ import * as nodeos from 'node:os';
12
12
  import nodeos__default, { tmpdir } from 'node:os';
13
13
  import { generateHash as generateHash$1, calculateSuiteHash, someTasksAreOnly, interpretTaskModes, hasFailed, generateFileHash, limitConcurrency, createFileTask as createFileTask$1, getTasks, isTestCase } from '@vitest/runner/utils';
14
14
  import { SnapshotManager } from '@vitest/snapshot/manager';
15
- import { v as version$1 } from './cac.Be29vze6.js';
15
+ import { v as version$1 } from './cac.BBqWH4nd.js';
16
16
  import { c as createBirpc } from './index.Bgo3tNWt.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.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';
18
18
  import require$$0$3 from 'events';
19
19
  import require$$1$1 from 'https';
20
20
  import require$$2 from 'http';
@@ -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';
@@ -7123,10 +7123,10 @@ function groupSpecs(specs, environments) {
7123
7123
  typechecks[spec.project.name] ||= [], typechecks[spec.project.name].push(spec);
7124
7124
  return;
7125
7125
  }
7126
- const order = spec.project.config.sequence.groupOrder;
7126
+ const order = spec.project.config.sequence.groupOrder, isolate = spec.project.config.isolate;
7127
7127
  // Files that have disabled parallelism and default groupOrder are set into their own group
7128
- if (order === 0 && spec.project.config.fileParallelism === false) return sequential.specs.push([spec]);
7129
- const maxWorkers = resolveMaxWorkers(spec.project), isolate = spec.project.config.isolate;
7128
+ if (isolate === true && order === 0 && spec.project.config.maxWorkers === 1) return sequential.specs.push([spec]);
7129
+ const maxWorkers = resolveMaxWorkers(spec.project);
7130
7130
  // Multiple projects with different maxWorkers but same groupOrder
7131
7131
  if (groups[order] ||= {
7132
7132
  specs: [],
@@ -7162,7 +7162,6 @@ function serializeConfig(project) {
7162
7162
  environmentOptions: config.environmentOptions,
7163
7163
  mode: config.mode,
7164
7164
  isolate: config.isolate,
7165
- fileParallelism: config.fileParallelism,
7166
7165
  maxWorkers: config.maxWorkers,
7167
7166
  base: config.base,
7168
7167
  logHeapUsage: config.logHeapUsage,
@@ -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
  }
@@ -2763,17 +2763,12 @@ Update your dependencies and make sure the versions match.`));
2763
2763
  // File outside project root with default allowExternal
2764
2764
  if (this.options.allowExternal === false && roots.every((root) => !filename.startsWith(root))) return this.globCache.set(filename, false), false;
2765
2765
  // By default `coverage.include` matches all files, except "coverage.exclude"
2766
- const glob = this.options.include || "**";
2767
- let included = roots.some((root) => {
2768
- const options = {
2769
- contains: true,
2770
- dot: true,
2771
- cwd: root,
2772
- ignore: this.options.exclude
2773
- };
2774
- 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
2775
2770
  });
2776
- return included &&= existsSync(cleanUrl(filename)), this.globCache.set(filename, included), included;
2771
+ return this.globCache.set(filename, included), included;
2777
2772
  }
2778
2773
  async getUntestedFilesByRoot(testedFiles, include, root) {
2779
2774
  let includedFiles = await glob(include, {
@@ -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.CpZMjXJJ.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.CpZMjXJJ.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.BqQUfEjB.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 {
@@ -495,6 +495,16 @@ class VitestModuleRunner extends viteModuleRunner.ModuleRunner {
495
495
  value: this.mocker
496
496
  });
497
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
+ }
498
508
  async import(rawId) {
499
509
  const resolved = await this.vitestOptions.transport.resolveId(rawId);
500
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.BqQUfEjB.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.Be29vze6.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.DT47gDHj.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.BqQUfEjB.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';
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.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';
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.RFExFinv.js';
2
- export { i as init } from './chunks/init.CpZMjXJJ.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.BqQUfEjB.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.RFExFinv.js';
2
- import { w as workerInit } from '../chunks/init-forks.WSf5dRNP.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.BqQUfEjB.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.CpZMjXJJ.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.RFExFinv.js';
2
- import { w as workerInit } from '../chunks/init-threads.CgZguQvI.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.BqQUfEjB.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.CpZMjXJJ.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.WSf5dRNP.js';
2
- import { r as runVmTests } from '../chunks/vm.CqZQkf-M.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.CpZMjXJJ.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.BqQUfEjB.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.CgZguQvI.js';
2
- import { r as runVmTests } from '../chunks/vm.CqZQkf-M.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.CpZMjXJJ.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.BqQUfEjB.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.5",
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-preview": "4.0.5",
138
- "@vitest/browser-webdriverio": "4.0.5",
139
- "@vitest/browser-playwright": "4.0.5",
140
- "@vitest/ui": "4.0.5"
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/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"
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",