vitest 5.0.0-rc.3 → 5.0.0-rc.4

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.
package/dist/browser.js CHANGED
@@ -1,6 +1,6 @@
1
1
  export { s as startCoverageInsideWorker, a as stopCoverageInsideWorker, t as takeCoverageInsideWorker } from './chunks/coverage.BtDxDqSU.js';
2
- export { p as collectTests, a as processError, s as startTests } from './chunks/run.DyRH7m0-.js';
3
- export { l as loadDiffConfig, a as loadSnapshotSerializers, s as setupCommonEnv, b as setupEnv } from './chunks/setup-common.p8NqUXPi.js';
2
+ export { p as collectTests, a as processError, s as startTests } from './chunks/run.CQOUYP-x.js';
3
+ export { l as loadDiffConfig, a as loadSnapshotSerializers, s as setupCommonEnv, b as setupEnv } from './chunks/setup-common.QoaKiKGk.js';
4
4
  export { s as SpyModule } from './chunks/spy.DPpyuUIA.js';
5
5
  export { f as format, i as inspect, s as stringify } from './chunks/display.pkpxlVcY.js';
6
6
  export { g as getType } from './chunks/pathe.M-eThtNZ.Clq7AXhv.js';
@@ -1,21 +1,21 @@
1
1
  import { runInThisContext } from 'node:vm';
2
2
  import { s as spyModule } from './spy.DPpyuUIA.js';
3
- import { r as resolveTestRunner, a as resolveSnapshotEnvironment, d as detectAsyncLeaks, s as setupChaiConfig } from './index.okypXZ97.js';
3
+ import { r as resolveTestRunner, a as resolveSnapshotEnvironment, d as detectAsyncLeaks, s as setupChaiConfig } from './index.DKvCqCMl.js';
4
4
  import { l as loadEnvironment, e as emitModuleRunner, a as listenForErrors } from './init.DJ2lKyjE.js';
5
5
  import { Traces } from '../traces.js';
6
6
  import { V as VitestEvaluatedModules } from './rpc.DWKX1ZbI.js';
7
7
  import { s as startVitestModuleRunner, c as createNodeImportMeta } from './index.DQO7054M.js';
8
8
  import { performance as performance$1 } from 'node:perf_hooks';
9
9
  import { s as startCoverageInsideWorker, a as stopCoverageInsideWorker } from './coverage.BtDxDqSU.js';
10
- import { i as index, g as globalExpect, v as vi } from './index.CSoBZWW_.js';
10
+ import { i as index, g as globalExpect, v as vi } from './index.CD2j-4_2.js';
11
11
  import { c as closeInspector } from './inspector.CvyFGlXm.js';
12
- import { s as startTests, p as publicCollect } from './run.DyRH7m0-.js';
12
+ import { s as startTests, p as publicCollect } from './run.CQOUYP-x.js';
13
13
  import { createRequire } from 'node:module';
14
14
  import timers from 'node:timers';
15
15
  import timersPromises from 'node:timers/promises';
16
16
  import util from 'node:util';
17
17
  import { K as KNOWN_ASSET_TYPES } from './pathe.M-eThtNZ.Clq7AXhv.js';
18
- import { s as setupCommonEnv, b as setupEnv } from './setup-common.p8NqUXPi.js';
18
+ import { s as setupCommonEnv, b as setupEnv } from './setup-common.QoaKiKGk.js';
19
19
  import { g as getWorkerState, r as resetModules, p as provideWorkerState, a as getSafeWorkerState } from './utils.DYj33du9.js';
20
20
 
21
21
  // this should only be used in Node
@@ -620,7 +620,7 @@ class CAC extends EventEmitter {
620
620
 
621
621
  const cac = (name = "") => new CAC(name);
622
622
 
623
- var version = "5.0.0-rc.3";
623
+ var version = "5.0.0-rc.4";
624
624
 
625
625
  const apiConfig = (port) => ({
626
626
  port: {
@@ -1337,7 +1337,10 @@ const collectCliOptionsConfig = {
1337
1337
  argument: "[true/path]"
1338
1338
  },
1339
1339
  filesOnly: { description: "Print only test files with out the test cases" },
1340
- staticParse: { description: "Parse files statically instead of running them to collect tests (default: false)" },
1340
+ staticParse: {
1341
+ description: "Parse files statically instead of running them to collect tests (default: true)",
1342
+ default: true
1343
+ },
1341
1344
  staticParseConcurrency: {
1342
1345
  description: "How many tests to process at the same time (default: os.availableParallelism())",
1343
1346
  argument: "<limit>"
@@ -2363,7 +2366,7 @@ function normalizeCliOptions(cliFilters, argv) {
2363
2366
  }
2364
2367
  async function start(cliFilters, options) {
2365
2368
  try {
2366
- const { startVitest } = await import('./cli-api.BsG_KUyt.js').then(function (n) { return n.a; });
2369
+ const { startVitest } = await import('./cli-api.rZIctZe8.js').then(function (n) { return n.a; });
2367
2370
  const ctx = await startVitest(cliFilters.map(normalize), normalizeCliOptions(cliFilters, options));
2368
2371
  if (!ctx.shouldKeepServer()) await ctx.exit();
2369
2372
  } catch (e) {
@@ -2377,7 +2380,7 @@ async function start(cliFilters, options) {
2377
2380
  }
2378
2381
  async function doctorCommand(cliFilters, options) {
2379
2382
  try {
2380
- const { doctor } = await import('./doctor.CzJ1dA-i.js');
2383
+ const { doctor } = await import('./doctor.heFfAozl.js');
2381
2384
  await doctor(cliFilters.map(normalize), normalizeCliOptions(cliFilters, options));
2382
2385
  process.exit();
2383
2386
  } catch (e) {
@@ -2394,12 +2397,12 @@ async function init(project) {
2394
2397
  console.error(/* @__PURE__ */ new Error("Only the \"browser\" project is supported. Use \"vitest init browser\" to create a new project."));
2395
2398
  process.exit(1);
2396
2399
  }
2397
- const { create } = await import('./creator.CYvpourF.js');
2400
+ const { create } = await import('./creator.BNqrBW1W.js');
2398
2401
  await create();
2399
2402
  }
2400
2403
  async function collect(cliFilters, options) {
2401
2404
  try {
2402
- const { prepareVitest, processCollected, outputFileList } = await import('./cli-api.BsG_KUyt.js').then(function (n) { return n.a; });
2405
+ const { prepareVitest, processCollected, outputFileList } = await import('./cli-api.rZIctZe8.js').then(function (n) { return n.a; });
2403
2406
  const ctx = await prepareVitest({
2404
2407
  ...normalizeCliOptions(cliFilters, options),
2405
2408
  watch: false,
@@ -1,6 +1,6 @@
1
1
  import { mkdirSync, writeFileSync } from 'node:fs';
2
2
  import { C as CoverageProviderMap } from './coverage.BcXK1DsQ.js';
3
- import { L as Logger, k as VitestPackageInstaller, P as PluginHarness, w as resolveConfig, V as Vitest, A as stdout, y as prompt, g as FilesNotFoundError, G as GitNotFoundError, I as IncludeTaskLocationDisabledError, C as RangeLocationFilterProvidedError, E as LocationFilterFileNotFoundError } from './index.CVFiuVPx.js';
3
+ import { L as Logger, k as VitestPackageInstaller, P as PluginHarness, w as resolveConfig, V as Vitest, A as stdout, y as prompt, g as FilesNotFoundError, G as GitNotFoundError, I as IncludeTaskLocationDisabledError, C as RangeLocationFilterProvidedError, E as LocationFilterFileNotFoundError } from './index.Cd7SnpwO.js';
4
4
  import readline from 'node:readline';
5
5
  import { y } from './tinyrainbow.Ht9iggcq.js';
6
6
  import { i as isWindows } from './env.DzFJjrmK.js';
@@ -363,7 +363,7 @@ async function startVitest(modeOrCliFilters, cliFiltersOrOptions, optionsOrViteO
363
363
  });
364
364
  try {
365
365
  if (ctx.config.listTags) await ctx.listTags();
366
- else if (ctx.config.clearCache) await ctx.experimental_clearCache();
366
+ else if (ctx.config.clearCache) await ctx.clearCache();
367
367
  else if (ctx.config.mergeReports) await ctx.mergeReports();
368
368
  else if (ctx.config.standalone) await ctx.standalone();
369
369
  else await ctx.start(cliFilters);
@@ -2,14 +2,14 @@ import { existsSync, writeFileSync, readFileSync } from 'node:fs';
2
2
  import { mkdir, writeFile } from 'node:fs/promises';
3
3
  import { resolve, dirname, relative } from 'node:path';
4
4
  import { detectPackageManager, installPackage } from './index.DXQx-kDM.js';
5
- import { y as prompt, z as findConfigFile } from './index.CVFiuVPx.js';
5
+ import { y as prompt, z as findConfigFile } from './index.Cd7SnpwO.js';
6
6
  import { x } from 'tinyexec';
7
7
  import { y } from './tinyrainbow.Ht9iggcq.js';
8
8
  import 'node:process';
9
9
  import 'node:os';
10
10
  import './pathe.M-eThtNZ.Clq7AXhv.js';
11
11
  import './source-map.Dx3YPjIe.js';
12
- import './cac.AVSgLgX0.js';
12
+ import './cac.Bf8-pv1O.js';
13
13
  import 'events';
14
14
  import './env.DzFJjrmK.js';
15
15
  import 'std-env';
@@ -31,7 +31,7 @@ import 'vite';
31
31
  import 'node:crypto';
32
32
  import '../path.js';
33
33
  import 'node:url';
34
- import './run.DyRH7m0-.js';
34
+ import './run.CQOUYP-x.js';
35
35
  import './index.M2dsQ_UQ.js';
36
36
  import './display.pkpxlVcY.js';
37
37
  import '../task-utils.js';
@@ -99,7 +99,7 @@ function log(...args) {
99
99
  console.log(...args);
100
100
  }
101
101
  async function doctor(cliFilters, options) {
102
- const { prepareVitest } = await import('./cli-api.BsG_KUyt.js').then(function (n) { return n.a; });
102
+ const { prepareVitest } = await import('./cli-api.rZIctZe8.js').then(function (n) { return n.a; });
103
103
  log();
104
104
  log(y.inverse(y.bold(y.blue(" DOCTOR "))), "resolving the current configuration...");
105
105
  const ctx = await prepareVitest({
@@ -1,6 +1,6 @@
1
1
  import { g as globalApis } from './constants.-juJ8b_4.js';
2
- import { i as index } from './index.CSoBZWW_.js';
3
- import './run.DyRH7m0-.js';
2
+ import { i as index } from './index.CD2j-4_2.js';
3
+ import './run.CQOUYP-x.js';
4
4
  import './index.M2dsQ_UQ.js';
5
5
  import './tinyrainbow.Ht9iggcq.js';
6
6
  import './display.pkpxlVcY.js';
@@ -1,4 +1,4 @@
1
- import { b as printDiffOrStringify, d as diff, a as processError, T as TestSyntaxError, g as getCurrentTest, c as createTaskCollector, e as getCurrentSuite, f as createChainable, h as getHooks, i as getFn, m as matchesTags, j as afterAll, k as afterEach, l as aroundAll, n as aroundEach, o as beforeAll, q as beforeEach, r as describe, t as it, u as onTestFailed, v as onTestFinished, w as recordArtifact, x as suite, y as test } from './run.DyRH7m0-.js';
1
+ import { b as printDiffOrStringify, d as diff, a as processError, T as TestSyntaxError, g as getCurrentTest, c as createTaskCollector, e as getCurrentSuite, f as createChainable, h as getHooks, i as getFn, m as matchesTags, j as afterAll, k as afterEach, l as aroundAll, n as aroundEach, o as beforeAll, q as beforeEach, r as describe, t as it, u as onTestFailed, v as onTestFinished, w as recordArtifact, x as suite, y as test } from './run.CQOUYP-x.js';
2
2
  import { i as isChildProcess, r as resetModules, g as getWorkerState } from './utils.DYj33du9.js';
3
3
  import { e as getDefaultExportFromCjs, f as parseErrorStacktrace, h as commonjsGlobal, a as getSafeTimers, i as parseSingleStack, j as delay } from './source-map.Dx3YPjIe.js';
4
4
  import { i as isMockFunction, f as fn, a as spyOn, r as restoreAllMocks, b as resetAllMocks, c as clearAllMocks } from './spy.DPpyuUIA.js';
@@ -2213,13 +2213,15 @@ const JestChaiExpect = (chai, utils) => {
2213
2213
  const spyName = spy.getMockName();
2214
2214
  const pass = spy.mock.calls.some((callArg) => equalsArgumentArray(callArg, args));
2215
2215
  const isNot = utils.flag(this, "negate");
2216
- const msg = utils.getMessage(this, [
2217
- pass,
2218
- `expected "${spyName}" to be called with arguments: #{exp}`,
2219
- `expected "${spyName}" to not be called with arguments: #{exp}`,
2220
- args
2221
- ]);
2222
- if (pass && isNot || !pass && !isNot) throw new AssertionError(formatCalls(spy, msg, args));
2216
+ if (pass && isNot || !pass && !isNot) {
2217
+ const msg = utils.getMessage(this, [
2218
+ pass,
2219
+ `expected "${spyName}" to be called with arguments: #{exp}`,
2220
+ `expected "${spyName}" to not be called with arguments: #{exp}`,
2221
+ args
2222
+ ]);
2223
+ throw new AssertionError(formatCalls(spy, msg, args));
2224
+ }
2223
2225
  });
2224
2226
  def("toHaveBeenCalledExactlyOnceWith", function(...args) {
2225
2227
  const spy = getSpy(this);
@@ -2227,13 +2229,15 @@ const JestChaiExpect = (chai, utils) => {
2227
2229
  const callCount = spy.mock.calls.length;
2228
2230
  const pass = spy.mock.calls.some((callArg) => equalsArgumentArray(callArg, args)) && callCount === 1;
2229
2231
  const isNot = utils.flag(this, "negate");
2230
- const msg = utils.getMessage(this, [
2231
- pass,
2232
- `expected "${spyName}" to be called once with arguments: #{exp}`,
2233
- `expected "${spyName}" to not be called once with arguments: #{exp}`,
2234
- args
2235
- ]);
2236
- if (pass && isNot || !pass && !isNot) throw new AssertionError(formatCalls(spy, msg, args));
2232
+ if (pass && isNot || !pass && !isNot) {
2233
+ const msg = utils.getMessage(this, [
2234
+ pass,
2235
+ `expected "${spyName}" to be called once with arguments: #{exp}`,
2236
+ `expected "${spyName}" to not be called once with arguments: #{exp}`,
2237
+ args
2238
+ ]);
2239
+ throw new AssertionError(formatCalls(spy, msg, args));
2240
+ }
2237
2241
  });
2238
2242
  def("toHaveBeenNthCalledWith", function(times, ...args) {
2239
2243
  const spy = getSpy(this);
@@ -7615,20 +7619,23 @@ function createExpectPoll(expect) {
7615
7619
  }
7616
7620
  });
7617
7621
  let resultPromise;
7622
+ // lets `expect.element` register the poll with the task deadline
7623
+ const wrap = chai.util.flag(assertion, "_poll.wrap");
7624
+ const start = () => resultPromise ||= wrap ? wrap(promise(), STACK_TRACE_ERROR) : promise();
7618
7625
  // only .then is enough to check awaited, but we type this as `Promise<void>` in global types
7619
7626
  // so let's follow it
7620
7627
  return {
7621
7628
  then(onFulfilled, onRejected) {
7622
7629
  awaited = true;
7623
- return (resultPromise ||= promise()).then(onFulfilled, onRejected);
7630
+ return start().then(onFulfilled, onRejected);
7624
7631
  },
7625
7632
  catch(onRejected) {
7626
7633
  awaited = true;
7627
- return (resultPromise ||= promise()).catch(onRejected);
7634
+ return start().catch(onRejected);
7628
7635
  },
7629
7636
  finally(onFinally) {
7630
7637
  awaited = true;
7631
- return (resultPromise ||= promise()).finally(onFinally);
7638
+ return start().finally(onFinally);
7632
7639
  },
7633
7640
  [Symbol.toStringTag]: "Promise"
7634
7641
  };
@@ -2,7 +2,7 @@ import * as os from 'node:os';
2
2
  import os__default, { homedir, tmpdir, availableParallelism, hostname } from 'node:os';
3
3
  import { j as join, b as basename, d as dirname, i as isAbsolute, r as resolve, c as cleanUrl, D as noop$1, a as relative, z as unique, e as createDefer, s as slash, t as toArray, m as isPrimitive, n as normalize, F as withTrailingSlash, G as wrapId, H as deepMerge, f as extname, h as KNOWN_ASSET_RE, I as isExternalUrl, J as unwrapId, p as deepClone, L as sanitizeFilePath } from './pathe.M-eThtNZ.Clq7AXhv.js';
4
4
  import { e as getDefaultExportFromCjs, T as TraceMap, o as originalPositionFor, k as generatedPositionFor, l as eachMapping, m as stackIgnorePatterns, f as parseErrorStacktrace, p as parseStacktrace, b as serializeValue } from './source-map.Dx3YPjIe.js';
5
- import { v as version$1 } from './cac.AVSgLgX0.js';
5
+ import { v as version$1 } from './cac.Bf8-pv1O.js';
6
6
  import * as fs from 'node:fs';
7
7
  import fs__default, { promises, existsSync, mkdirSync, readFileSync, writeFileSync, chmodSync, statfsSync, realpathSync, statSync, readdirSync } from 'node:fs';
8
8
  import { performance as performance$1 } from 'node:perf_hooks';
@@ -23,7 +23,7 @@ import * as vite from 'vite';
23
23
  import { createServer, isFileLoadingAllowed, normalizePath, parseAst, searchForWorkspaceRoot, version, isRunnableDevEnvironment, mergeConfig, fetchModule, resolveConfig as resolveConfig$2 } from 'vite';
24
24
  import crypto, { createHash } from 'node:crypto';
25
25
  import { rootDir, distDir } from '../path.js';
26
- import { z as validateTags, A as limitConcurrency, B as shuffle, C as createTagsFilter } from './run.DyRH7m0-.js';
26
+ import { z as validateTags, A as limitConcurrency, B as shuffle, C as createTagsFilter } from './run.CQOUYP-x.js';
27
27
  import { N as NativeModuleRunner, i as isPackageExists, r as resolveModule } from './nativeModuleRunner.BOvBCgI_.js';
28
28
  import { createFileTask as createFileTask$1, createTaskName, calculateSuiteHash, convertTasksToEvents, hasFailed, generateFileHash, getTestName, hasFailedSnapshot, getTests, getSuites, getTasks, getFullName, interpretTaskModes } from '../task-utils.js';
29
29
  import { Traces } from '../traces.js';
@@ -7404,20 +7404,19 @@ function ViteConfigPlugin(harness) {
7404
7404
  resolve: resolveOptions
7405
7405
  }
7406
7406
  };
7407
- if ("rolldownVersion" in vite)
7408
- // eslint-disable-next-line ts/ban-ts-comment
7409
- // @ts-ignore rolldown-vite only
7410
- config.oxc = viteConfig.oxc === false ? false : {
7411
- // eslint-disable-next-line ts/ban-ts-comment
7412
- // @ts-ignore rolldown-vite only
7413
- target: viteConfig.oxc?.target || "node18" };
7414
- else config.esbuild = viteConfig.esbuild === false ? false : {
7415
- // Lowest target Vitest supports is Node18
7416
- target: viteConfig.esbuild?.target || "node18",
7417
- sourcemap: "external",
7407
+ if (viteConfig.oxc !== false) {
7408
+ viteConfig.oxc ??= {};
7409
+ // Lowest target Vitest supports is Node22
7410
+ viteConfig.oxc.target ??= "node22";
7411
+ }
7412
+ if (!("rolldownVersion" in vite) && viteConfig.esbuild !== false) {
7413
+ viteConfig.esbuild ??= {};
7414
+ // Lowest target Vitest supports is Node22
7415
+ viteConfig.esbuild.target ??= "node22";
7416
+ viteConfig.esbuild.sourcemap = "external";
7418
7417
  // Enables using ignore hint for coverage providers with @preserve keyword
7419
- legalComments: "inline"
7420
- };
7418
+ viteConfig.esbuild.legalComments = "inline";
7419
+ }
7421
7420
  const classNameStrategy = typeof testConfig.css !== "boolean" && testConfig.css?.modules?.classNameStrategy || "stable";
7422
7421
  if (!browserEnabled && classNameStrategy !== "scoped") {
7423
7422
  config.css ??= {};
@@ -12386,6 +12385,7 @@ const PROJECT_CLI_OVERRIDES = [
12386
12385
  "inspect",
12387
12386
  "inspectBrk",
12388
12387
  "fileParallelism",
12388
+ "maxWorkers",
12389
12389
  "tagsFilter",
12390
12390
  "browser",
12391
12391
  "experimental",
@@ -20748,10 +20748,16 @@ class Vitest {
20748
20748
  return this._coverageProvider;
20749
20749
  }
20750
20750
  /**
20751
+ * @deprecated Use `clearCache` instead.
20752
+ */
20753
+ experimental_clearCache() {
20754
+ this.logger.deprecate(`The "experimental_clearCache" method is deprecated. Use "clearCache" instead.`);
20755
+ return this.clearCache();
20756
+ }
20757
+ /**
20751
20758
  * Deletes all Vitest caches, including the `fsModuleCache`.
20752
- * @experimental
20753
20759
  */
20754
- async experimental_clearCache() {
20760
+ async clearCache() {
20755
20761
  await this.cache.results.clearCache();
20756
20762
  await this._fsCache.clearCache();
20757
20763
  }
@@ -20816,7 +20822,7 @@ class Vitest {
20816
20822
  this.state.catchError(serializeValue(error), "Unhandled Reporter Error");
20817
20823
  });
20818
20824
  }
20819
- async collect(filters, options) {
20825
+ async collect(filters, options = {}) {
20820
20826
  return this._traces.$("vitest.collect", async (collectSpan) => {
20821
20827
  const filenamePattern = filters && filters?.length > 0 ? filters : [];
20822
20828
  collectSpan.setAttribute("vitest.collect.filters", filenamePattern);
@@ -20834,7 +20840,7 @@ class Vitest {
20834
20840
  testModules: [],
20835
20841
  unhandledErrors: []
20836
20842
  };
20837
- if (options?.staticParse) return {
20843
+ if (options.staticParse !== false) return {
20838
20844
  testModules: await this.parseSpecifications(files, { concurrency: options.staticParseConcurrency }),
20839
20845
  unhandledErrors: []
20840
20846
  };
@@ -2,9 +2,9 @@ import * as chai from 'chai';
2
2
  import { createHook } from 'node:async_hooks';
3
3
  import { t as takeCoverageInsideWorker } from './coverage.BtDxDqSU.js';
4
4
  import { r as rpc } from './rpc.DWKX1ZbI.js';
5
- import { l as loadDiffConfig, a as loadSnapshotSerializers } from './setup-common.p8NqUXPi.js';
5
+ import { l as loadDiffConfig, a as loadSnapshotSerializers } from './setup-common.QoaKiKGk.js';
6
6
  import { g as getWorkerState } from './utils.DYj33du9.js';
7
- import { T as TestRunner } from './index.CSoBZWW_.js';
7
+ import { T as TestRunner } from './index.CD2j-4_2.js';
8
8
 
9
9
  function setupChaiConfig(config) {
10
10
  Object.assign(chai.config, config);
@@ -2430,11 +2430,14 @@ declare class Vitest {
2430
2430
  globTestSpecifications(filters?: string[]): Promise<TestSpecification[]>;
2431
2431
  private initCoverageProvider;
2432
2432
  /**
2433
- * Deletes all Vitest caches, including the `fsModuleCache`.
2434
- * @experimental
2433
+ * @deprecated Use `clearCache` instead.
2435
2434
  */
2436
2435
  experimental_clearCache(): Promise<void>;
2437
2436
  /**
2437
+ * Deletes all Vitest caches, including the `fsModuleCache`.
2438
+ */
2439
+ clearCache(): Promise<void>;
2440
+ /**
2438
2441
  * Merge reports from multiple runs located in the specified directory (value from `--merge-reports` if not specified).
2439
2442
  */
2440
2443
  mergeReports(directory?: string): Promise<TestRunResult>;
@@ -2640,12 +2643,12 @@ interface CliOptions extends UserConfig {
2640
2643
  filesOnly?: boolean;
2641
2644
  /**
2642
2645
  * Parse files statically instead of running them to collect tests
2643
- * @experimental
2646
+ * @default true
2644
2647
  */
2645
2648
  staticParse?: boolean;
2646
2649
  /**
2647
2650
  * How many tests to process at the same time
2648
- * @experimental
2651
+ * @default os.availableParallelism()
2649
2652
  */
2650
2653
  staticParseConcurrency?: number;
2651
2654
  /**
@@ -3173,6 +3173,68 @@ function manageArtifactAttachment(attachment) {
3173
3173
  }
3174
3174
 
3175
3175
  const now$2 = globalThis.performance ? globalThis.performance.now.bind(globalThis.performance) : Date.now;
3176
+ // makes an operation deadline derived from the task fire before the task timer
3177
+ const DERIVED_BUFFER = 100;
3178
+ // how long the task timer waits for a tracked operation past that operation's own deadline
3179
+ const SETTLE_GRACE = 500;
3180
+ class TaskDeadline {
3181
+ startTime = now$2();
3182
+ endTime;
3183
+ timer;
3184
+ operations = /* @__PURE__ */ new Set();
3185
+ constructor(timeout, onTimeout) {
3186
+ this.endTime = this.startTime + timeout;
3187
+ const { setTimeout } = getSafeTimers();
3188
+ this.timer = setTimeout(onTimeout, timeout);
3189
+ // `unref` might not exist in browser
3190
+ this.timer.unref?.();
3191
+ }
3192
+ remaining() {
3193
+ return this.endTime - now$2();
3194
+ }
3195
+ exceeded() {
3196
+ return now$2() >= this.endTime;
3197
+ }
3198
+ clear() {
3199
+ const { clearTimeout } = getSafeTimers();
3200
+ clearTimeout(this.timer);
3201
+ }
3202
+ /** timeout for an operation that must fail before the task does */
3203
+ derive() {
3204
+ return Math.max(Math.floor(this.remaining()) - DERIVED_BUFFER, 1);
3205
+ }
3206
+ /** Registers an operation with its own timeout; see `settle`. */
3207
+ track(name, promise, timeout, source) {
3208
+ const operation = {
3209
+ name,
3210
+ source,
3211
+ promise,
3212
+ endTime: now$2() + timeout
3213
+ };
3214
+ this.operations.add(operation);
3215
+ promise.finally(() => this.operations.delete(operation)).catch(() => {});
3216
+ return promise;
3217
+ }
3218
+ /**
3219
+ * Waits for the operations that were due before the task, if possible.
3220
+ */
3221
+ settle() {
3222
+ if (!this.operations.size) return;
3223
+ const operations = [...this.operations];
3224
+ const pending = () => operations.filter((operation) => this.operations.has(operation));
3225
+ const due = operations.filter((operation) => operation.endTime <= this.endTime);
3226
+ if (!due.length)
3227
+ // return operations whose timeout is larger than task for a better stack trace
3228
+ return Promise.resolve(operations);
3229
+ const { setTimeout } = getSafeTimers();
3230
+ const waitUntil = Math.max(...due.map((operation) => operation.endTime)) + SETTLE_GRACE;
3231
+ return Promise.race([Promise.all(due.map((operation) => operation.promise)).then(pending), new Promise((resolve) => setTimeout(() => {
3232
+ resolve(pending());
3233
+ // the grace may already be in the past
3234
+ }, Math.max(waitUntil - now$2(), 0)))]);
3235
+ }
3236
+ }
3237
+
3176
3238
  const collectorContext = {
3177
3239
  tasks: [],
3178
3240
  currentSuite: null
@@ -3188,42 +3250,48 @@ async function runWithSuite(suite, fn) {
3188
3250
  }
3189
3251
  function withTimeout(fn, timeout, isHook = false, stackTraceError, onTimeout) {
3190
3252
  if (timeout <= 0 || timeout === Number.POSITIVE_INFINITY) return fn;
3191
- const { setTimeout, clearTimeout } = getSafeTimers();
3192
3253
  // this function name is used to filter error in test/e2e/test/fails.test.ts
3193
3254
  return (function runWithTimeout(...args) {
3194
- const startTime = now$2();
3195
3255
  const runner = getRunner();
3196
- runner._currentTaskStartTime = startTime;
3197
- runner._currentTaskTimeout = timeout;
3256
+ const previousDeadline = runner._deadline;
3198
3257
  return new Promise((resolve_, reject_) => {
3199
- const timer = setTimeout(() => {
3200
- clearTimeout(timer);
3258
+ let settled = false;
3259
+ const deadline = new TaskDeadline(timeout, () => {
3260
+ // an operation derived a shorter deadline from this one,
3261
+ // so its error describes the failure better than a generic timeout
3262
+ const pending = deadline.settle();
3263
+ if (pending) {
3264
+ pending.then(rejectTimeoutError, reject);
3265
+ return;
3266
+ }
3201
3267
  rejectTimeoutError();
3202
- }, timeout);
3203
- // `unref` might not exist in browser
3204
- timer.unref?.();
3205
- function rejectTimeoutError() {
3206
- const error = makeTimeoutError(isHook, timeout, stackTraceError);
3268
+ });
3269
+ runner._deadline = deadline;
3270
+ function rejectTimeoutError(pending) {
3271
+ if (settled) return;
3272
+ settled = true;
3273
+ const error = makeTimeoutError(isHook, timeout, stackTraceError, pending);
3207
3274
  onTimeout?.(args, error);
3208
3275
  reject_(error);
3209
3276
  }
3210
3277
  function resolve(result) {
3211
- runner._currentTaskStartTime = void 0;
3212
- runner._currentTaskTimeout = void 0;
3213
- clearTimeout(timer);
3278
+ runner._deadline = previousDeadline;
3279
+ deadline.clear();
3214
3280
  // if test/hook took too long in microtask, setTimeout won't be triggered,
3215
3281
  // but we still need to fail the test, see
3216
3282
  // https://github.com/vitest-dev/vitest/issues/2920
3217
- if (now$2() - startTime >= timeout) {
3283
+ if (deadline.exceeded()) {
3218
3284
  rejectTimeoutError();
3219
3285
  return;
3220
3286
  }
3287
+ settled = true;
3221
3288
  resolve_(result);
3222
3289
  }
3223
3290
  function reject(error) {
3224
- runner._currentTaskStartTime = void 0;
3225
- runner._currentTaskTimeout = void 0;
3226
- clearTimeout(timer);
3291
+ if (settled) return;
3292
+ settled = true;
3293
+ runner._deadline = previousDeadline;
3294
+ deadline.clear();
3227
3295
  reject_(error);
3228
3296
  }
3229
3297
  // sync test/hook will be caught by try/catch
@@ -3325,8 +3393,12 @@ function createTestContext(test, runner) {
3325
3393
  };
3326
3394
  return runner.extendTaskContext?.(context) || context;
3327
3395
  }
3328
- function makeTimeoutError(isHook, timeout, stackTraceError) {
3329
- const message = `${isHook ? "Hook" : "Test"} timed out in ${timeout}ms.\nIf this is a long-running ${isHook ? "hook" : "test"}, pass a timeout value as the last argument or configure it globally with "${isHook ? "hookTimeout" : "testTimeout"}".`;
3396
+ function makeTimeoutError(isHook, timeout, stackTraceError, pending) {
3397
+ const waiting = pending?.length ? ` while waiting for ${pending.map((operation) => operation.name).join(", ")}` : "";
3398
+ // point at the action the task is stuck on rather than at the task itself
3399
+ const lastOperationSource = pending?.at(-1)?.source;
3400
+ if (lastOperationSource) stackTraceError = lastOperationSource;
3401
+ const message = `${isHook ? "Hook" : "Test"} timed out in ${timeout}ms${waiting}.\nIf this is a long-running ${isHook ? "hook" : "test"}, pass a timeout value as the last argument or configure it globally with "${isHook ? "hookTimeout" : "testTimeout"}".`;
3330
3402
  const error = new Error(message);
3331
3403
  if (stackTraceError?.stack) error.stack = stackTraceError.stack.replace(stackTraceError.message, error.message);
3332
3404
  return error;
@@ -7,7 +7,7 @@ async function setupCommonEnv(config) {
7
7
  if (globalSetup) return;
8
8
  globalSetup = true;
9
9
  setSafeTimers();
10
- if (config.globals) (await import('./globals.B4gJ9mZH.js')).registerApiGlobally();
10
+ if (config.globals) (await import('./globals.xG0BzeWF.js')).registerApiGlobally();
11
11
  }
12
12
  function setupDefines(config) {
13
13
  for (const key in config.defines) globalThis[key] = config.defines[key];
@@ -12,7 +12,7 @@ import { initSync, parse } from 'es-module-lexer';
12
12
  import { dirname as dirname$1 } from 'node:path';
13
13
  import { V as VITEST_VM_CONTEXT_SYMBOL, s as startVitestModuleRunner, c as createNodeImportMeta } from './index.DQO7054M.js';
14
14
  import { getDefaultRequestStubs } from '../module-evaluator.js';
15
- import { b as setupEnv } from './setup-common.p8NqUXPi.js';
15
+ import { b as setupEnv } from './setup-common.QoaKiKGk.js';
16
16
  import { p as provideWorkerState } from './utils.DYj33du9.js';
17
17
 
18
18
  /**
@@ -618,6 +618,7 @@ class EsmExecutor {
618
618
  executor;
619
619
  moduleCache = /* @__PURE__ */ new Map();
620
620
  esmLinkMap = /* @__PURE__ */ new WeakMap();
621
+ linkQueue = Promise.resolve();
621
622
  context;
622
623
  #httpIp = IPnumber("127.0.0.0");
623
624
  constructor(executor, options) {
@@ -628,11 +629,26 @@ class EsmExecutor {
628
629
  // a module that failed to evaluate keeps living in the cache — rethrow
629
630
  // its error instead of silently returning an unusable namespace
630
631
  if (m.status === "errored") throw m.error;
631
- if (m.status === "unlinked") this.esmLinkMap.set(m, m.link((identifier, referencer) => this.executor.resolveModule(identifier, referencer.identifier)));
632
- await this.esmLinkMap.get(m);
632
+ await this.linkModule(m);
633
633
  if (m.status === "linked") await m.evaluate();
634
634
  return m;
635
635
  }
636
+ // Roots are linked one at a time: Node's link() does not wait for a
637
+ // dependency that another root is still linking, and instantiate() then
638
+ // fails on it. Sharing the queue with all roots keeps cycle handling to
639
+ // Node's own single-root linker, which never has to wait.
640
+ linkModule(m) {
641
+ const pending = this.esmLinkMap.get(m);
642
+ if (pending) return pending;
643
+ if (m.status !== "unlinked" && m.status !== "linking") return Promise.resolve();
644
+ const linking = this.linkQueue.then(() => {
645
+ if (m.status === "unlinked") return m.link(this.linker);
646
+ });
647
+ this.esmLinkMap.set(m, linking);
648
+ this.linkQueue = linking.catch(() => {});
649
+ return linking;
650
+ }
651
+ linker = (identifier, referencer) => this.executor.resolveModule(identifier, referencer.identifier);
636
652
  async createEsModule(fileURL, getCode) {
637
653
  const cached = this.moduleCache.get(fileURL);
638
654
  if (cached) return cached;
package/dist/cli.js CHANGED
@@ -1,4 +1,4 @@
1
- import { c as createCLI } from './chunks/cac.AVSgLgX0.js';
1
+ import { c as createCLI } from './chunks/cac.Bf8-pv1O.js';
2
2
  import './chunks/pathe.M-eThtNZ.Clq7AXhv.js';
3
3
  import 'events';
4
4
  import './chunks/tinyrainbow.Ht9iggcq.js';
package/dist/config.d.ts CHANGED
@@ -1,8 +1,8 @@
1
1
  import { HookHandler, UserConfig, ConfigEnv } from 'vite';
2
2
  export { ConfigEnv, Plugin, UserConfig as ViteUserConfig, mergeConfig } from 'vite';
3
- import { F as FieldsWithDefaultValues, U as UserWorkspaceConfig, a as UserProjectConfigFn, b as UserProjectConfigExport } from './chunks/plugin.d.DAuMAWfb.js';
3
+ import { F as FieldsWithDefaultValues, U as UserWorkspaceConfig, a as UserProjectConfigFn, b as UserProjectConfigExport } from './chunks/plugin.d.BbcoZhuj.js';
4
4
  import { InlineConfig, ResolvedConfig, VitestPluginContext, CoverageOptions } from './node.js';
5
- export { T as TestProjectConfiguration, c as TestProjectInlineConfiguration, d as TestUserConfig, W as WatcherTriggerPattern } from './chunks/plugin.d.DAuMAWfb.js';
5
+ export { T as TestProjectConfiguration, c as TestProjectInlineConfiguration, d as TestUserConfig, W as WatcherTriggerPattern } from './chunks/plugin.d.BbcoZhuj.js';
6
6
  import { C as Config } from './chunks/config.d.CU_b-wJj.js';
7
7
  export { e as TestTagDefinition } from './chunks/config.d.CU_b-wJj.js';
8
8
  import 'node:stream';
package/dist/index.js CHANGED
@@ -1,6 +1,6 @@
1
- export { S as Snapshots, T as TestRunner, a as assert, b as assertType, c as createExpect, g as expect, d as inject, s as should, v as vi, e as vitest } from './chunks/index.CSoBZWW_.js';
1
+ export { S as Snapshots, T as TestRunner, a as assert, b as assertType, c as createExpect, g as expect, d as inject, s as should, v as vi, e as vitest } from './chunks/index.CD2j-4_2.js';
2
2
  export { V as EvaluatedModules } from './chunks/rpc.DWKX1ZbI.js';
3
- export { j as afterAll, k as afterEach, l as aroundAll, n as aroundEach, o as beforeAll, q as beforeEach, r as describe, t as it, u as onTestFailed, v as onTestFinished, w as recordArtifact, x as suite, y as test } from './chunks/run.DyRH7m0-.js';
3
+ export { j as afterAll, k as afterEach, l as aroundAll, n as aroundEach, o as beforeAll, q as beforeEach, r as describe, t as it, u as onTestFailed, v as onTestFinished, w as recordArtifact, x as suite, y as test } from './chunks/run.CQOUYP-x.js';
4
4
  export { expectTypeOf } from 'expect-type';
5
5
  import * as chai from 'chai';
6
6
  export { chai };
package/dist/node.d.ts CHANGED
@@ -3,8 +3,8 @@ import { UserConfig as UserConfig$1, ResolvedConfig as ResolvedConfig$1, Transfo
3
3
  export { vite as Vite };
4
4
  export { esbuildVersion, isCSSRequest, isFileLoadingAllowed, parseAst, parseAstAsync, rollupVersion, version as viteVersion } from 'vite';
5
5
  import { IncomingMessage } from 'node:http';
6
- import { R as ResolvedConfig, e as CliOptions, d as UserConfig, L as Logger, A as ApiConfig, P as PluginHarness, f as Vitest, g as ResolvedCoverageOptions, h as CoverageMap, i as ReportContext, j as TestProject, k as VitestOptions, l as VitestRunMode, m as TestSpecification, n as PoolWorker, o as PoolOptions, p as WorkerRequest, q as TestSequencer } from './chunks/plugin.d.DAuMAWfb.js';
7
- export { M as AgentReporter, B as BaseCoverageOptions, r as BaseReporter, s as BenchmarkUserOptions, t as BrowserBuiltinProvider, u as BrowserCommand, v as BrowserCommandContext, w as BrowserConfigOptions, x as BrowserInstanceOption, y as BrowserModuleMocker, z as BrowserOrchestrator, D as BrowserProvider, E as BrowserProviderOption, G as BrowserScript, H as BrowserServerContribution, J as BrowserServerFactory, K as BrowserServerState, N as BrowserServerStateSession, O as BrowserTraceViewOptions, Q as BuiltinEnvironment, S as BuiltinReporterOptions, X as BuiltinReporters, Y as CSSModuleScopeStrategy, Z as CacheKeyIdGenerator, _ as CacheKeyIdGeneratorContext, $ as CoverageInstrumenter, a0 as CoverageIstanbulOptions, C as CoverageOptions, a1 as CoverageProvider, a2 as CoverageProviderModule, a3 as CoverageReporter, a4 as CoverageV8Options, a5 as CustomProviderOptions, a6 as DefaultReporter, a7 as DepsOptimizationOptions, a8 as DotReporter, a9 as EnvironmentOptions, aa as GithubActionsReporter, ab as HTMLOptions, ac as HangingProcessReporter, I as InlineConfig, ad as InstrumenterOptions, ae as JUnitOptions, af as JUnitReporter, ag as JsonAssertionResult, ah as JsonOptions, ai as JsonReporter, aj as JsonTestResult, ak as JsonTestResults, M as MinimalReporter, al as ModuleDiagnostic, am as OnServerRestartHandler, an as OnTestsRerunHandler, ao as ParentProjectBrowser, ap as Pool, aq as PoolRunnerInitializer, ar as PoolTask, as as ProjectBrowser, at as ProjectConfig, au as Report, av as ReportedHookContext, aw as Reporter, ax as ReportersMap, ay as ResolveSnapshotPathHandler, az as ResolveSnapshotPathHandlerContext, aA as ResolvedBrowserOptions, aB as ResolvedProjectConfig, aC as SerializedTestProject, aD as SuiteNameTemplateVariables, aE as TapFlatReporter, aF as TapReporter, aG as TaskOptions, aH as TestCase, aI as TestCollection, aJ as TestDiagnostic, aK as TestModule, aL as TestModuleState, aM as TestResult, aN as TestResultFailed, aO as TestResultPassed, aP as TestResultPending, aQ as TestResultSkipped, aR as TestRunEndReason, aS as TestRunResult, aT as TestSequencerConstructor, aU as TestSpecificationOptions, aV as TestState, aW as TestSuite, aX as TestSuiteState, aY as ToMatchScreenshotComparators, aZ as ToMatchScreenshotOptions, a_ as TypecheckConfig, U as UserWorkspaceConfig, a$ as VerboseReporter, b0 as VitestEnvironment, b1 as VitestPackageInstaller, V as VitestPluginContext, W as WatcherTriggerPattern, b2 as WorkerResponse, b3 as _BrowserNames, b4 as experimental_getRunnerTask, b5 as startVitest } from './chunks/plugin.d.DAuMAWfb.js';
6
+ import { R as ResolvedConfig, e as CliOptions, d as UserConfig, L as Logger, A as ApiConfig, P as PluginHarness, f as Vitest, g as ResolvedCoverageOptions, h as CoverageMap, i as ReportContext, j as TestProject, k as VitestOptions, l as VitestRunMode, m as TestSpecification, n as PoolWorker, o as PoolOptions, p as WorkerRequest, q as TestSequencer } from './chunks/plugin.d.BbcoZhuj.js';
7
+ export { M as AgentReporter, B as BaseCoverageOptions, r as BaseReporter, s as BenchmarkUserOptions, t as BrowserBuiltinProvider, u as BrowserCommand, v as BrowserCommandContext, w as BrowserConfigOptions, x as BrowserInstanceOption, y as BrowserModuleMocker, z as BrowserOrchestrator, D as BrowserProvider, E as BrowserProviderOption, G as BrowserScript, H as BrowserServerContribution, J as BrowserServerFactory, K as BrowserServerState, N as BrowserServerStateSession, O as BrowserTraceViewOptions, Q as BuiltinEnvironment, S as BuiltinReporterOptions, X as BuiltinReporters, Y as CSSModuleScopeStrategy, Z as CacheKeyIdGenerator, _ as CacheKeyIdGeneratorContext, $ as CoverageInstrumenter, a0 as CoverageIstanbulOptions, C as CoverageOptions, a1 as CoverageProvider, a2 as CoverageProviderModule, a3 as CoverageReporter, a4 as CoverageV8Options, a5 as CustomProviderOptions, a6 as DefaultReporter, a7 as DepsOptimizationOptions, a8 as DotReporter, a9 as EnvironmentOptions, aa as GithubActionsReporter, ab as HTMLOptions, ac as HangingProcessReporter, I as InlineConfig, ad as InstrumenterOptions, ae as JUnitOptions, af as JUnitReporter, ag as JsonAssertionResult, ah as JsonOptions, ai as JsonReporter, aj as JsonTestResult, ak as JsonTestResults, M as MinimalReporter, al as ModuleDiagnostic, am as OnServerRestartHandler, an as OnTestsRerunHandler, ao as ParentProjectBrowser, ap as Pool, aq as PoolRunnerInitializer, ar as PoolTask, as as ProjectBrowser, at as ProjectConfig, au as Report, av as ReportedHookContext, aw as Reporter, ax as ReportersMap, ay as ResolveSnapshotPathHandler, az as ResolveSnapshotPathHandlerContext, aA as ResolvedBrowserOptions, aB as ResolvedProjectConfig, aC as SerializedTestProject, aD as SuiteNameTemplateVariables, aE as TapFlatReporter, aF as TapReporter, aG as TaskOptions, aH as TestCase, aI as TestCollection, aJ as TestDiagnostic, aK as TestModule, aL as TestModuleState, aM as TestResult, aN as TestResultFailed, aO as TestResultPassed, aP as TestResultPending, aQ as TestResultSkipped, aR as TestRunEndReason, aS as TestRunResult, aT as TestSequencerConstructor, aU as TestSpecificationOptions, aV as TestState, aW as TestSuite, aX as TestSuiteState, aY as ToMatchScreenshotComparators, aZ as ToMatchScreenshotOptions, a_ as TypecheckConfig, U as UserWorkspaceConfig, a$ as VerboseReporter, b0 as VitestEnvironment, b1 as VitestPackageInstaller, V as VitestPluginContext, W as WatcherTriggerPattern, b2 as WorkerResponse, b3 as _BrowserNames, b4 as experimental_getRunnerTask, b5 as startVitest } from './chunks/plugin.d.BbcoZhuj.js';
8
8
  import { EventEmitter } from 'events';
9
9
  import { A as Awaitable } from './chunks/config.d.CU_b-wJj.js';
10
10
  import { AfterSuiteRunMeta } from './index.js';
package/dist/node.js CHANGED
@@ -1,9 +1,9 @@
1
1
  import * as vite from 'vite';
2
2
  export { esbuildVersion, isCSSRequest, isFileLoadingAllowed, parseAst, parseAstAsync, rollupVersion, version as viteVersion } from 'vite';
3
- import { V as Vitest } from './chunks/index.CVFiuVPx.js';
4
- export { M as AgentReporter, B as BaseCoverageProvider, a as BaseSequencer, b as BrowserConnectionError, D as DefaultReporter, c as DotReporter, F as ForksPoolWorker, G as GitNotFoundError, d as GithubActionsReporter, H as HangingProcessReporter, J as JUnitReporter, e as JsonReporter, L as Logger, M as MinimalReporter, P as PluginHarness, R as ReportersMap, T as TapFlatReporter, f as TapReporter, g as TestsNotFoundError, h as ThreadsPoolWorker, i as TypecheckPoolWorker, j as VerboseReporter, k as VitestPackageInstaller, l as VmForksPoolWorker, m as VmThreadsPoolWorker, n as createDebugger, o as createMethodsRPC, p as createViteLogger, q as escapeTestName, r as experimental_getRunnerTask, s as getFilePoolName, t as isFileServingAllowed, u as isValidApiRequest, v as resolveApiServerConfig, w as resolveConfig, x as resolveFsAllow } from './chunks/index.CVFiuVPx.js';
5
- export { c as createCLI, p as parseCLI } from './chunks/cac.AVSgLgX0.js';
6
- export { c as createVitest, r as registerConsoleShortcuts, s as startVitest } from './chunks/cli-api.BsG_KUyt.js';
3
+ import { V as Vitest } from './chunks/index.Cd7SnpwO.js';
4
+ export { M as AgentReporter, B as BaseCoverageProvider, a as BaseSequencer, b as BrowserConnectionError, D as DefaultReporter, c as DotReporter, F as ForksPoolWorker, G as GitNotFoundError, d as GithubActionsReporter, H as HangingProcessReporter, J as JUnitReporter, e as JsonReporter, L as Logger, M as MinimalReporter, P as PluginHarness, R as ReportersMap, T as TapFlatReporter, f as TapReporter, g as TestsNotFoundError, h as ThreadsPoolWorker, i as TypecheckPoolWorker, j as VerboseReporter, k as VitestPackageInstaller, l as VmForksPoolWorker, m as VmThreadsPoolWorker, n as createDebugger, o as createMethodsRPC, p as createViteLogger, q as escapeTestName, r as experimental_getRunnerTask, s as getFilePoolName, t as isFileServingAllowed, u as isValidApiRequest, v as resolveApiServerConfig, w as resolveConfig, x as resolveFsAllow } from './chunks/index.Cd7SnpwO.js';
5
+ export { c as createCLI, p as parseCLI } from './chunks/cac.Bf8-pv1O.js';
6
+ export { c as createVitest, r as registerConsoleShortcuts, s as startVitest } from './chunks/cli-api.rZIctZe8.js';
7
7
  export { distDir, rootDir } from './path.js';
8
8
  export { generateFileHash } from './task-utils.js';
9
9
  export { m as disableDefaultColors } from './chunks/tinyrainbow.Ht9iggcq.js';
@@ -26,7 +26,7 @@ import 'buffer';
26
26
  import 'util';
27
27
  import './chunks/constants.-juJ8b_4.js';
28
28
  import 'node:crypto';
29
- import './chunks/run.DyRH7m0-.js';
29
+ import './chunks/run.CQOUYP-x.js';
30
30
  import './chunks/index.M2dsQ_UQ.js';
31
31
  import './chunks/display.pkpxlVcY.js';
32
32
  import './chunks/nativeModuleRunner.BOvBCgI_.js';
package/dist/worker.js CHANGED
@@ -1,8 +1,8 @@
1
- export { r as runBaseTests, s as setupEnvironment } from './chunks/base.CZYgpg5z.js';
1
+ export { r as runBaseTests, s as setupEnvironment } from './chunks/base.DE9oA_9r.js';
2
2
  export { i as init } from './chunks/init.DJ2lKyjE.js';
3
3
  import 'node:vm';
4
4
  import './chunks/spy.DPpyuUIA.js';
5
- import './chunks/index.okypXZ97.js';
5
+ import './chunks/index.DKvCqCMl.js';
6
6
  import 'chai';
7
7
  import 'node:async_hooks';
8
8
  import './chunks/coverage.BtDxDqSU.js';
@@ -13,12 +13,12 @@ import 'vite/module-runner';
13
13
  import './chunks/source-map.Dx3YPjIe.js';
14
14
  import './chunks/index.DmDMHCg8.js';
15
15
  import './chunks/utils.DYj33du9.js';
16
- import './chunks/setup-common.p8NqUXPi.js';
16
+ import './chunks/setup-common.QoaKiKGk.js';
17
17
  import './chunks/plugins.Cigb0uSy.js';
18
18
  import './chunks/index.M2dsQ_UQ.js';
19
19
  import './chunks/tinyrainbow.Ht9iggcq.js';
20
- import './chunks/index.CSoBZWW_.js';
21
- import './chunks/run.DyRH7m0-.js';
20
+ import './chunks/index.CD2j-4_2.js';
21
+ import './chunks/run.CQOUYP-x.js';
22
22
  import './chunks/display.pkpxlVcY.js';
23
23
  import './task-utils.js';
24
24
  import './chunks/offset.Dy-5Fdfn.js';
@@ -1,8 +1,8 @@
1
- import { r as runBaseTests, s as setupBaseEnvironment } from '../chunks/base.CZYgpg5z.js';
1
+ import { r as runBaseTests, s as setupBaseEnvironment } from '../chunks/base.DE9oA_9r.js';
2
2
  import { w as workerInit } from '../chunks/init-forks.BqnYxpzU.js';
3
3
  import 'node:vm';
4
4
  import '../chunks/spy.DPpyuUIA.js';
5
- import '../chunks/index.okypXZ97.js';
5
+ import '../chunks/index.DKvCqCMl.js';
6
6
  import 'chai';
7
7
  import 'node:async_hooks';
8
8
  import '../chunks/coverage.BtDxDqSU.js';
@@ -13,12 +13,12 @@ import 'vite/module-runner';
13
13
  import '../chunks/source-map.Dx3YPjIe.js';
14
14
  import '../chunks/index.DmDMHCg8.js';
15
15
  import '../chunks/utils.DYj33du9.js';
16
- import '../chunks/setup-common.p8NqUXPi.js';
16
+ import '../chunks/setup-common.QoaKiKGk.js';
17
17
  import '../chunks/plugins.Cigb0uSy.js';
18
18
  import '../chunks/index.M2dsQ_UQ.js';
19
19
  import '../chunks/tinyrainbow.Ht9iggcq.js';
20
- import '../chunks/index.CSoBZWW_.js';
21
- import '../chunks/run.DyRH7m0-.js';
20
+ import '../chunks/index.CD2j-4_2.js';
21
+ import '../chunks/run.CQOUYP-x.js';
22
22
  import '../chunks/display.pkpxlVcY.js';
23
23
  import '../task-utils.js';
24
24
  import '../chunks/offset.Dy-5Fdfn.js';
@@ -4,12 +4,12 @@ import timers from 'node:timers';
4
4
  import timersPromises from 'node:timers/promises';
5
5
  import util from 'node:util';
6
6
  import { K as KNOWN_ASSET_TYPES } from '../chunks/pathe.M-eThtNZ.Clq7AXhv.js';
7
- import { s as setupChaiConfig, r as resolveTestRunner, a as resolveSnapshotEnvironment, d as detectAsyncLeaks } from '../chunks/index.okypXZ97.js';
7
+ import { s as setupChaiConfig, r as resolveTestRunner, a as resolveSnapshotEnvironment, d as detectAsyncLeaks } from '../chunks/index.DKvCqCMl.js';
8
8
  import { s as startCoverageInsideWorker, a as stopCoverageInsideWorker } from '../chunks/coverage.BtDxDqSU.js';
9
- import { i as index, g as globalExpect } from '../chunks/index.CSoBZWW_.js';
9
+ import { i as index, g as globalExpect } from '../chunks/index.CD2j-4_2.js';
10
10
  import { c as closeInspector } from '../chunks/inspector.CvyFGlXm.js';
11
- import { s as startTests, p as publicCollect } from '../chunks/run.DyRH7m0-.js';
12
- import { s as setupCommonEnv } from '../chunks/setup-common.p8NqUXPi.js';
11
+ import { s as startTests, p as publicCollect } from '../chunks/run.CQOUYP-x.js';
12
+ import { s as setupCommonEnv } from '../chunks/setup-common.QoaKiKGk.js';
13
13
  import { g as getWorkerState } from '../chunks/utils.DYj33du9.js';
14
14
  import 'chai';
15
15
  import 'node:async_hooks';
@@ -1,8 +1,8 @@
1
- import { s as setupBaseEnvironment, r as runBaseTests } from '../chunks/base.CZYgpg5z.js';
1
+ import { s as setupBaseEnvironment, r as runBaseTests } from '../chunks/base.DE9oA_9r.js';
2
2
  import { w as workerInit } from '../chunks/init-threads.CL4Y0HC6.js';
3
3
  import 'node:vm';
4
4
  import '../chunks/spy.DPpyuUIA.js';
5
- import '../chunks/index.okypXZ97.js';
5
+ import '../chunks/index.DKvCqCMl.js';
6
6
  import 'chai';
7
7
  import 'node:async_hooks';
8
8
  import '../chunks/coverage.BtDxDqSU.js';
@@ -13,12 +13,12 @@ import 'vite/module-runner';
13
13
  import '../chunks/source-map.Dx3YPjIe.js';
14
14
  import '../chunks/index.DmDMHCg8.js';
15
15
  import '../chunks/utils.DYj33du9.js';
16
- import '../chunks/setup-common.p8NqUXPi.js';
16
+ import '../chunks/setup-common.QoaKiKGk.js';
17
17
  import '../chunks/plugins.Cigb0uSy.js';
18
18
  import '../chunks/index.M2dsQ_UQ.js';
19
19
  import '../chunks/tinyrainbow.Ht9iggcq.js';
20
- import '../chunks/index.CSoBZWW_.js';
21
- import '../chunks/run.DyRH7m0-.js';
20
+ import '../chunks/index.CD2j-4_2.js';
21
+ import '../chunks/run.CQOUYP-x.js';
22
22
  import '../chunks/display.pkpxlVcY.js';
23
23
  import '../task-utils.js';
24
24
  import '../chunks/offset.Dy-5Fdfn.js';
@@ -1,5 +1,5 @@
1
1
  import { w as workerInit } from '../chunks/init-forks.BqnYxpzU.js';
2
- import { r as runVmTests, s as setupVmWorker } from '../chunks/vm.gGBei5ET.js';
2
+ import { r as runVmTests, s as setupVmWorker } from '../chunks/vm.DhWYFrLG.js';
3
3
  import '../chunks/init.DJ2lKyjE.js';
4
4
  import 'node:fs';
5
5
  import 'node:module';
@@ -28,7 +28,7 @@ import '../chunks/console.CHi0lDgQ.js';
28
28
  import 'node:stream';
29
29
  import '../chunks/resolver.CBCHRZ7j.js';
30
30
  import 'es-module-lexer';
31
- import '../chunks/setup-common.p8NqUXPi.js';
31
+ import '../chunks/setup-common.QoaKiKGk.js';
32
32
  import '../chunks/plugins.Cigb0uSy.js';
33
33
 
34
34
  workerInit({
@@ -1,5 +1,5 @@
1
1
  import { w as workerInit } from '../chunks/init-threads.CL4Y0HC6.js';
2
- import { s as setupVmWorker, r as runVmTests } from '../chunks/vm.gGBei5ET.js';
2
+ import { s as setupVmWorker, r as runVmTests } from '../chunks/vm.DhWYFrLG.js';
3
3
  import 'node:worker_threads';
4
4
  import '../chunks/init.DJ2lKyjE.js';
5
5
  import 'node:fs';
@@ -29,7 +29,7 @@ import '../chunks/console.CHi0lDgQ.js';
29
29
  import 'node:stream';
30
30
  import '../chunks/resolver.CBCHRZ7j.js';
31
31
  import 'es-module-lexer';
32
- import '../chunks/setup-common.p8NqUXPi.js';
32
+ import '../chunks/setup-common.QoaKiKGk.js';
33
33
  import '../chunks/plugins.Cigb0uSy.js';
34
34
 
35
35
  workerInit({
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "vitest",
3
3
  "type": "module",
4
- "version": "5.0.0-rc.3",
4
+ "version": "5.0.0-rc.4",
5
5
  "description": "Next generation testing framework powered by Vite",
6
6
  "author": "Anthony Fu <anthonyfu117@hotmail.com>",
7
7
  "license": "MIT",
@@ -113,12 +113,12 @@
113
113
  "@edge-runtime/vm": "*",
114
114
  "@opentelemetry/api": "^1.9.0",
115
115
  "@types/node": "^22.0.0 || >=24.0.0",
116
- "@vitest/browser-playwright": "5.0.0-rc.3",
117
- "@vitest/browser-preview": "5.0.0-rc.3",
116
+ "@vitest/browser-playwright": "5.0.0-rc.4",
117
+ "@vitest/browser-preview": "5.0.0-rc.4",
118
118
  "@vitest/browser-webdriverio": "^5.0.0-beta.5 || >=5.0.0",
119
- "@vitest/coverage-istanbul": "5.0.0-rc.3",
120
- "@vitest/coverage-v8": "5.0.0-rc.3",
121
- "@vitest/ui": "5.0.0-rc.3",
119
+ "@vitest/coverage-istanbul": "5.0.0-rc.4",
120
+ "@vitest/coverage-v8": "5.0.0-rc.4",
121
+ "@vitest/ui": "5.0.0-rc.4",
122
122
  "happy-dom": "*",
123
123
  "jsdom": "*",
124
124
  "vite": "^6.4.0 || ^7.0.0 || ^8.0.0"
@@ -163,15 +163,15 @@
163
163
  },
164
164
  "dependencies": {
165
165
  "@types/chai": "^5.2.2",
166
- "@vitest/mocker": "5.0.0-rc.3",
166
+ "@vitest/mocker": "5.0.0-rc.4",
167
167
  "chai": "^6.2.2",
168
168
  "es-module-lexer": "^2.3.2",
169
169
  "expect-type": "^1.4.0",
170
- "magic-string": "^1.2.2",
170
+ "magic-string": "^1.2.3",
171
171
  "obug": "^2.1.4",
172
172
  "picomatch": "^4.0.7",
173
173
  "std-env": "^4.2.0",
174
- "tinybench": "6.1.3",
174
+ "tinybench": "6.1.4",
175
175
  "tinyexec": "1.3.0",
176
176
  "tinyglobby": "^0.2.17",
177
177
  "why-is-node-running": "^2.3.0"
@@ -187,19 +187,19 @@
187
187
  "@types/node": "^24.13.3",
188
188
  "@types/picomatch": "^4.0.3",
189
189
  "@types/prompts": "^2.4.9",
190
- "@vitest/expect": "5.0.0-rc.3",
190
+ "@vitest/expect": "5.0.0-rc.4",
191
191
  "@vitest/istanbul-lib-coverage": "^1.0.0",
192
192
  "@vitest/istanbul-lib-report": "^1.0.0",
193
- "@vitest/pretty-format": "5.0.0-rc.3",
194
- "@vitest/snapshot": "5.0.0-rc.3",
195
- "@vitest/spy": "5.0.0-rc.3",
196
- "@vitest/utils": "5.0.0-rc.3",
193
+ "@vitest/pretty-format": "5.0.0-rc.4",
194
+ "@vitest/snapshot": "5.0.0-rc.4",
195
+ "@vitest/spy": "5.0.0-rc.4",
196
+ "@vitest/utils": "5.0.0-rc.4",
197
197
  "acorn": "8.11.3",
198
198
  "acorn-walk": "^8.3.5",
199
199
  "birpc": "^4.2.0",
200
200
  "cac": "^6.7.14",
201
201
  "flatted": "^3.4.4",
202
- "happy-dom": "^20.11.6",
202
+ "happy-dom": "^20.12.0",
203
203
  "jsdom": "^29.1.1",
204
204
  "local-pkg": "^1.2.1",
205
205
  "mime": "^4.1.0",