vitest 3.0.7 → 3.0.8

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 (43) hide show
  1. package/dist/browser.d.ts +6 -24
  2. package/dist/browser.js +3 -3
  3. package/dist/chunks/{base.BgUWWWYp.js → base.XvKTsMeK.js} +2 -2
  4. package/dist/chunks/{cac.87F_onld.js → cac.VN5q-TPC.js} +28 -4
  5. package/dist/chunks/{cli-api.BZbq1zTX.js → cli-api.Dis64jtY.js} +11 -18
  6. package/dist/chunks/{config.BRtC-JeT.d.ts → config.BCv-fVdT.d.ts} +1 -1
  7. package/dist/chunks/{execute.Bhwls1-Z.js → execute.eDH0aFFd.js} +4 -4
  8. package/dist/chunks/{globals.BCtI_nQG.js → globals.CydvVTgC.js} +3 -3
  9. package/dist/chunks/{index.C1f-_gvH.js → index.B7vJpkTD.js} +2 -2
  10. package/dist/chunks/{index.BmFFzXX_.js → index.BmFgJtkv.js} +1 -1
  11. package/dist/chunks/{index.B8haHJlQ.js → index.CNRemkXW.js} +1 -1
  12. package/dist/chunks/{reporters.QZ837uWx.d.ts → reporters.66aFHiyX.d.ts} +1 -1
  13. package/dist/chunks/{resolveConfig.BbcK25zb.js → resolveConfig.L1_HR0_0.js} +6 -6
  14. package/dist/chunks/{runBaseTests.9XCQcSZC.js → runBaseTests.DnaAUBKD.js} +5 -5
  15. package/dist/chunks/{setup-common.wObu9a36.js → setup-common.Uaw6Zgv9.js} +1 -1
  16. package/dist/chunks/{vite.vM3UZq1q.d.ts → vite.BCQa3xFG.d.ts} +1 -1
  17. package/dist/chunks/{vm.6kNys9FN.js → vm.jEFQDlX_.js} +1 -1
  18. package/dist/chunks/{worker.B2JXutr8.d.ts → worker.BT4v-DKx.d.ts} +1 -1
  19. package/dist/chunks/{worker.DaAIyCKm.d.ts → worker.BmVno_ab.d.ts} +1 -1
  20. package/dist/cli.js +1 -1
  21. package/dist/config.d.ts +4 -4
  22. package/dist/coverage.d.ts +2 -2
  23. package/dist/coverage.js +1 -1
  24. package/dist/execute.d.ts +2 -2
  25. package/dist/execute.js +1 -1
  26. package/dist/index.d.ts +7 -7
  27. package/dist/index.js +3 -3
  28. package/dist/node.d.ts +6 -6
  29. package/dist/node.js +6 -6
  30. package/dist/reporters.d.ts +2 -2
  31. package/dist/reporters.js +1 -1
  32. package/dist/runners.d.ts +1 -1
  33. package/dist/runners.js +2 -2
  34. package/dist/workers/forks.js +2 -2
  35. package/dist/workers/runVmTests.js +5 -5
  36. package/dist/workers/threads.js +2 -2
  37. package/dist/workers/vmForks.js +2 -2
  38. package/dist/workers/vmThreads.js +2 -2
  39. package/dist/workers.d.ts +3 -3
  40. package/dist/workers.js +3 -3
  41. package/package.json +12 -12
  42. package/dist/chunks/spy.Cf_4R5Oe.js +0 -22
  43. package/dist/chunks/{vi.DT3m61kS.js → vi.B5EKKJdE.js} +1 -1
package/dist/browser.d.ts CHANGED
@@ -1,9 +1,10 @@
1
- import { b as CoverageModuleLoader, c as CoverageProvider } from './chunks/reporters.QZ837uWx.js';
2
- import { a as SerializedCoverageConfig, S as SerializedConfig } from './chunks/config.BRtC-JeT.js';
3
- import * as spy$1 from '@vitest/spy';
1
+ import { b as CoverageModuleLoader, c as CoverageProvider } from './chunks/reporters.66aFHiyX.js';
2
+ import { S as SerializedCoverageConfig, a as SerializedConfig } from './chunks/config.BCv-fVdT.js';
4
3
  import { SerializedDiffOptions } from '@vitest/utils/diff';
5
4
  import { VitestExecutor } from './execute.js';
6
5
  export { collectTests, processError, startTests } from '@vitest/runner';
6
+ import * as spy from '@vitest/spy';
7
+ export { spy as SpyModule };
7
8
  import './chunks/environment.d8YfPkTm.js';
8
9
  import '@vitest/utils';
9
10
  import 'node:stream';
@@ -20,30 +21,11 @@ import '@vitest/snapshot/manager';
20
21
  import 'node:fs';
21
22
  import '@vitest/snapshot/environment';
22
23
  import 'vite-node/client';
23
- import './chunks/worker.DaAIyCKm.js';
24
+ import './chunks/worker.BmVno_ab.js';
24
25
  import 'node:vm';
25
26
  import '@vitest/mocker';
26
27
  import './chunks/mocker.cRtM890J.js';
27
28
 
28
- function _mergeNamespaces(n, m) {
29
- m.forEach(function (e) {
30
- e && typeof e !== 'string' && !Array.isArray(e) && Object.keys(e).forEach(function (k) {
31
- if (k !== 'default' && !(k in n)) {
32
- var d = Object.getOwnPropertyDescriptor(e, k);
33
- Object.defineProperty(n, k, d.get ? d : {
34
- enumerable: true,
35
- get: function () { return e[k]; }
36
- });
37
- }
38
- });
39
- });
40
- return Object.freeze(n);
41
- }
42
-
43
- var spy = /*#__PURE__*/_mergeNamespaces({
44
- __proto__: null
45
- }, [spy$1]);
46
-
47
29
  declare function getCoverageProvider(options: SerializedCoverageConfig | undefined, loader: CoverageModuleLoader): Promise<CoverageProvider | null>;
48
30
  declare function startCoverageInsideWorker(options: SerializedCoverageConfig | undefined, loader: CoverageModuleLoader, runtimeOptions: {
49
31
  isolate: boolean;
@@ -57,4 +39,4 @@ declare function setupCommonEnv(config: SerializedConfig): Promise<void>;
57
39
  declare function loadDiffConfig(config: SerializedConfig, executor: VitestExecutor): Promise<SerializedDiffOptions | undefined>;
58
40
  declare function loadSnapshotSerializers(config: SerializedConfig, executor: VitestExecutor): Promise<void>;
59
41
 
60
- export { spy as SpyModule, getCoverageProvider, loadDiffConfig, loadSnapshotSerializers, setupCommonEnv, startCoverageInsideWorker, stopCoverageInsideWorker, takeCoverageInsideWorker };
42
+ export { getCoverageProvider, loadDiffConfig, loadSnapshotSerializers, setupCommonEnv, startCoverageInsideWorker, stopCoverageInsideWorker, takeCoverageInsideWorker };
package/dist/browser.js CHANGED
@@ -1,8 +1,8 @@
1
1
  export { g as getCoverageProvider, s as startCoverageInsideWorker, a as stopCoverageInsideWorker, t as takeCoverageInsideWorker } from './chunks/coverage.DnNIv-kJ.js';
2
- export { s as SpyModule } from './chunks/spy.Cf_4R5Oe.js';
3
- export { l as loadDiffConfig, a as loadSnapshotSerializers, s as setupCommonEnv } from './chunks/setup-common.wObu9a36.js';
2
+ export { l as loadDiffConfig, a as loadSnapshotSerializers, s as setupCommonEnv } from './chunks/setup-common.Uaw6Zgv9.js';
4
3
  export { collectTests, processError, startTests } from '@vitest/runner';
5
- import '@vitest/spy';
4
+ import * as spy from '@vitest/spy';
5
+ export { spy as SpyModule };
6
6
  import '@vitest/snapshot';
7
7
  import '@vitest/utils';
8
8
  import './chunks/run-once.2ogXb3JV.js';
@@ -1,5 +1,5 @@
1
1
  import { ModuleCacheMap } from 'vite-node/client';
2
- import { g as getDefaultRequestStubs, s as startVitestExecutor } from './execute.Bhwls1-Z.js';
2
+ import { g as getDefaultRequestStubs, s as startVitestExecutor } from './execute.eDH0aFFd.js';
3
3
  import { p as provideWorkerState } from './utils.C8RiOc4B.js';
4
4
 
5
5
  let _viteNode;
@@ -28,7 +28,7 @@ async function runBaseTests(method, state) {
28
28
  ));
29
29
  const [executor, { run }] = await Promise.all([
30
30
  startViteNode({ state, requestStubs: getDefaultRequestStubs() }),
31
- import('./runBaseTests.9XCQcSZC.js')
31
+ import('./runBaseTests.DnaAUBKD.js')
32
32
  ]);
33
33
  const fileSpecs = ctx.files.map(
34
34
  (f) => typeof f === "string" ? { filepath: f, testLocations: void 0 } : f
@@ -618,7 +618,7 @@ class CAC extends EventEmitter {
618
618
 
619
619
  const cac = (name = "") => new CAC(name);
620
620
 
621
- var version = "3.0.7";
621
+ var version = "3.0.8";
622
622
 
623
623
  const apiConfig = (port) => ({
624
624
  port: {
@@ -1398,6 +1398,7 @@ function addCommand(cli, name, option) {
1398
1398
  `Expected a single value for option "${command}", received [${received}]`
1399
1399
  );
1400
1400
  }
1401
+ value = removeQuotes(value);
1401
1402
  if (option.transform) {
1402
1403
  return option.transform(value);
1403
1404
  }
@@ -1502,8 +1503,31 @@ function createCLI(options = {}) {
1502
1503
  cli.command("[...filters]", void 0, options).action((filters, options2) => start("test", filters, options2));
1503
1504
  return cli;
1504
1505
  }
1506
+ function removeQuotes(str) {
1507
+ if (typeof str !== "string") {
1508
+ if (Array.isArray(str)) {
1509
+ return str.map(removeQuotes);
1510
+ }
1511
+ return str;
1512
+ }
1513
+ if (str.startsWith('"') && str.endsWith('"')) {
1514
+ return str.slice(1, -1);
1515
+ }
1516
+ if (str.startsWith(`'`) && str.endsWith(`'`)) {
1517
+ return str.slice(1, -1);
1518
+ }
1519
+ return str;
1520
+ }
1521
+ function splitArgv(argv) {
1522
+ const reg = /(['"])(?:(?!\1).)+\1/g;
1523
+ argv = argv.replace(reg, (match) => match.replace(/\s/g, "\0"));
1524
+ return argv.split(" ").map((arg) => {
1525
+ arg = arg.replace(/\0/g, " ");
1526
+ return removeQuotes(arg);
1527
+ });
1528
+ }
1505
1529
  function parseCLI(argv, config = {}) {
1506
- const arrayArgs = typeof argv === "string" ? argv.split(" ") : argv;
1530
+ const arrayArgs = typeof argv === "string" ? splitArgv(argv) : argv;
1507
1531
  if (arrayArgs[0] !== "vitest") {
1508
1532
  throw new Error(`Expected "vitest" as the first argument, received "${arrayArgs[0]}"`);
1509
1533
  }
@@ -1567,7 +1591,7 @@ async function start(mode, cliFilters, options) {
1567
1591
  } catch {
1568
1592
  }
1569
1593
  try {
1570
- const { startVitest } = await import('./cli-api.BZbq1zTX.js').then(function (n) { return n.f; });
1594
+ const { startVitest } = await import('./cli-api.Dis64jtY.js').then(function (n) { return n.f; });
1571
1595
  const ctx = await startVitest(mode, cliFilters.map(normalize), normalizeCliOptions(cliFilters, options));
1572
1596
  if (!ctx.shouldKeepServer()) {
1573
1597
  await ctx.exit();
@@ -1598,7 +1622,7 @@ async function collect(mode, cliFilters, options) {
1598
1622
  } catch {
1599
1623
  }
1600
1624
  try {
1601
- const { prepareVitest, processCollected, outputFileList } = await import('./cli-api.BZbq1zTX.js').then(function (n) { return n.f; });
1625
+ const { prepareVitest, processCollected, outputFileList } = await import('./cli-api.Dis64jtY.js').then(function (n) { return n.f; });
1602
1626
  const ctx = await prepareVitest(mode, {
1603
1627
  ...normalizeCliOptions(cliFilters, options),
1604
1628
  watch: false,
@@ -11,9 +11,9 @@ import { generateFileHash, createFileTask, limitConcurrency, hasFailed, getTasks
11
11
  import { SnapshotManager } from '@vitest/snapshot/manager';
12
12
  import { ViteNodeRunner } from 'vite-node/client';
13
13
  import { ViteNodeServer } from 'vite-node/server';
14
- import { v as version$1 } from './cac.87F_onld.js';
14
+ import { v as version$1 } from './cac.VN5q-TPC.js';
15
15
  import { c as createBirpc } from './index.68735LiX.js';
16
- import { p as parse, s as stringify, g as printError, h as generateCodeFrame, b as BenchmarkReportsMap, R as ReportersMap, i as BlobReporter, r as readBlobs, H as HangingProcessReporter } from './index.C1f-_gvH.js';
16
+ import { p as parse, s as stringify, g as printError, h as generateCodeFrame, b as BenchmarkReportsMap, R as ReportersMap, i as BlobReporter, r as readBlobs, H as HangingProcessReporter } from './index.B7vJpkTD.js';
17
17
  import require$$0$3 from 'events';
18
18
  import require$$1$1 from 'https';
19
19
  import require$$2 from 'http';
@@ -28,7 +28,7 @@ import { g as getDefaultExportFromCjs } from './_commonjsHelpers.BFTU3MAI.js';
28
28
  import { parseErrorStacktrace } from '@vitest/utils/source-map';
29
29
  import crypto from 'node:crypto';
30
30
  import { distDir, rootDir } from '../path.js';
31
- import { R as RandomSequencer, i as isPackageExists, h as hash, V as VitestCache, e as configDefaults, g as getFilePoolName, f as isBrowserEnabled, m as mm, a as resolveConfig, j as groupBy, w as wildcardPatternToRegExp, k as createPool, b as resolveApiServerConfig, s as stdout } from './resolveConfig.BbcK25zb.js';
31
+ import { R as RandomSequencer, i as isPackageExists, h as hash, V as VitestCache, e as configDefaults, g as getFilePoolName, f as isBrowserEnabled, m as mm, a as resolveConfig, j as groupBy, w as wildcardPatternToRegExp, k as createPool, b as resolveApiServerConfig, s as stdout } from './resolveConfig.L1_HR0_0.js';
32
32
  import { i as isTTY, b as isWindows, c as convertTasksToEvents } from './typechecker.cZ0LjdSi.js';
33
33
  import { Console } from 'node:console';
34
34
  import c from 'tinyrainbow';
@@ -9954,17 +9954,6 @@ function deleteDefineConfig(viteConfig) {
9954
9954
  }
9955
9955
  return defines;
9956
9956
  }
9957
- function hijackVitePluginInject(viteConfig) {
9958
- const processEnvPlugin = viteConfig.plugins.find(
9959
- (p) => p.name === "vite:client-inject"
9960
- );
9961
- if (processEnvPlugin) {
9962
- const originalTransform = processEnvPlugin.transform;
9963
- processEnvPlugin.transform = function transform(code, id, options) {
9964
- return originalTransform.call(this, code, id, { ...options, ssr: true });
9965
- };
9966
- }
9967
- }
9968
9957
  function resolveFsAllow(projectRoot, rootConfigFile) {
9969
9958
  if (!rootConfigFile) {
9970
9959
  return [searchForWorkspaceRoot(projectRoot), rootDir];
@@ -10136,6 +10125,10 @@ function WorkspaceVitestPlugin(project, options) {
10136
10125
  const resolveOptions = getDefaultResolveOptions();
10137
10126
  const config = {
10138
10127
  root,
10128
+ define: {
10129
+ // disable replacing `process.env.NODE_ENV` with static string by vite:client-inject
10130
+ "process.env.NODE_ENV": "process.env.NODE_ENV"
10131
+ },
10139
10132
  resolve: {
10140
10133
  ...resolveOptions,
10141
10134
  alias: testConfig.alias
@@ -10200,9 +10193,6 @@ function WorkspaceVitestPlugin(project, options) {
10200
10193
  config.customLogger = silenceImportViteIgnoreWarning(config.customLogger);
10201
10194
  return config;
10202
10195
  },
10203
- configResolved(viteConfig) {
10204
- hijackVitePluginInject(viteConfig);
10205
- },
10206
10196
  async configureServer(server) {
10207
10197
  const options2 = deepMerge({}, configDefaults, server.config.test || {});
10208
10198
  await project._configureServer(options2, server);
@@ -13348,6 +13338,10 @@ async function VitestPlugin(options = {}, ctx = new Vitest("test")) {
13348
13338
  const resolveOptions = getDefaultResolveOptions();
13349
13339
  const config = {
13350
13340
  root: viteConfig.test?.root || options.root,
13341
+ define: {
13342
+ // disable replacing `process.env.NODE_ENV` with static string by vite:client-inject
13343
+ "process.env.NODE_ENV": "process.env.NODE_ENV"
13344
+ },
13351
13345
  esbuild: viteConfig.esbuild === false ? false : {
13352
13346
  // Lowest target Vitest supports is Node18
13353
13347
  target: viteConfig.esbuild?.target || "node18",
@@ -13465,7 +13459,6 @@ async function VitestPlugin(options = {}, ctx = new Vitest("test")) {
13465
13459
  if (!options.watch) {
13466
13460
  viteConfig.server.watch = null;
13467
13461
  }
13468
- hijackVitePluginInject(viteConfig);
13469
13462
  Object.defineProperty(viteConfig, "_vitest", {
13470
13463
  value: options,
13471
13464
  enumerable: false,
@@ -212,4 +212,4 @@ type RuntimeConfig = Pick<SerializedConfig, 'allowOnly' | 'testTimeout' | 'hookT
212
212
  };
213
213
  type RuntimeOptions = Partial<RuntimeConfig>;
214
214
 
215
- export type { FakeTimerInstallOpts as F, RuntimeOptions as R, SerializedConfig as S, SerializedCoverageConfig as a, RuntimeConfig as b };
215
+ export type { FakeTimerInstallOpts as F, RuntimeOptions as R, SerializedCoverageConfig as S, SerializedConfig as a, RuntimeConfig as b };
@@ -2,7 +2,7 @@ import fs from 'node:fs';
2
2
  import { pathToFileURL } from 'node:url';
3
3
  import vm from 'node:vm';
4
4
  import { processError } from '@vitest/utils/error';
5
- import { normalize as normalize$1, relative } from 'pathe';
5
+ import { normalize as normalize$1 } from 'pathe';
6
6
  import { ViteNodeRunner, DEFAULT_REQUEST_STUBS } from 'vite-node/client';
7
7
  import { isInternalRequest, isNodeBuiltin as isNodeBuiltin$1, isPrimitive, toFilePath } from 'vite-node/utils';
8
8
  import { distDir } from '../path.js';
@@ -581,7 +581,7 @@ function listenForErrors(state) {
581
581
  dispose.length = 0;
582
582
  function catchError(err, type, event) {
583
583
  const worker = state();
584
- if (worker.current) {
584
+ if (worker.current?.type === "test") {
585
585
  const listeners = process.listeners(event);
586
586
  if (listeners.length > 1) {
587
587
  return;
@@ -589,9 +589,9 @@ function listenForErrors(state) {
589
589
  }
590
590
  const error = processError(err);
591
591
  if (!isPrimitive(error)) {
592
- error.VITEST_TEST_NAME = worker.current?.name;
592
+ error.VITEST_TEST_NAME = worker.current?.type === "test" ? worker.current.name : void 0;
593
593
  if (worker.filepath) {
594
- error.VITEST_TEST_PATH = relative(state().config.root, worker.filepath);
594
+ error.VITEST_TEST_PATH = worker.filepath;
595
595
  }
596
596
  error.VITEST_AFTER_ENV_TEARDOWN = worker.environmentTeardownRun;
597
597
  }
@@ -1,6 +1,6 @@
1
1
  import { g as globalApis } from './constants.fzPh7AOq.js';
2
- import { V as VitestIndex } from './index.B8haHJlQ.js';
3
- import './vi.DT3m61kS.js';
2
+ import { V as VitestIndex } from './index.CNRemkXW.js';
3
+ import './vi.B5EKKJdE.js';
4
4
  import '@vitest/expect';
5
5
  import '@vitest/runner';
6
6
  import '@vitest/runner/utils';
@@ -10,9 +10,9 @@ import '@vitest/utils';
10
10
  import './_commonjsHelpers.BFTU3MAI.js';
11
11
  import '@vitest/snapshot';
12
12
  import '@vitest/utils/error';
13
+ import '@vitest/spy';
13
14
  import '@vitest/utils/source-map';
14
15
  import './date.W2xKR2qe.js';
15
- import '@vitest/spy';
16
16
  import './run-once.2ogXb3JV.js';
17
17
  import './benchmark.Cdu9hjj4.js';
18
18
  import 'expect-type';
@@ -192,7 +192,7 @@ function printErrorInner(error, project, options) {
192
192
  }
193
193
  });
194
194
  if (type) {
195
- printErrorType(type, project.ctx);
195
+ printErrorType(type, project.vitest);
196
196
  }
197
197
  printErrorMessage(e, logger);
198
198
  if (options.screenshotPaths?.length) {
@@ -246,7 +246,7 @@ ${e.diff}
246
246
  logger.error(
247
247
  c.red(
248
248
  `This error originated in "${c.bold(
249
- testPath
249
+ relative(project.config.root, testPath)
250
250
  )}" test file. It doesn't mean the error was thrown inside the file itself, but while it was running.`
251
251
  )
252
252
  );
@@ -3,7 +3,7 @@ import { resolve } from 'node:path';
3
3
  import { t as takeCoverageInsideWorker } from './coverage.DnNIv-kJ.js';
4
4
  import { distDir } from '../path.js';
5
5
  import { r as rpc } from './rpc.TVf73xOu.js';
6
- import { l as loadDiffConfig, a as loadSnapshotSerializers } from './setup-common.wObu9a36.js';
6
+ import { l as loadDiffConfig, a as loadSnapshotSerializers } from './setup-common.Uaw6Zgv9.js';
7
7
  import { g as getWorkerState } from './utils.C8RiOc4B.js';
8
8
 
9
9
  function setupChaiConfig(config) {
@@ -1,4 +1,4 @@
1
- import { c as createExpect, a as globalExpect, i as inject, v as vi, b as vitest } from './vi.DT3m61kS.js';
1
+ import { c as createExpect, a as globalExpect, i as inject, v as vi, b as vitest } from './vi.B5EKKJdE.js';
2
2
  import { i as isFirstRun, a as runOnce } from './run-once.2ogXb3JV.js';
3
3
  import { b as bench } from './benchmark.Cdu9hjj4.js';
4
4
  import { expectTypeOf } from 'expect-type';
@@ -4,7 +4,7 @@ import { ParsedStack, TestError, SerializedError, ErrorWithDiff, Arrayable, Awai
4
4
  import { Writable } from 'node:stream';
5
5
  import { TransformResult as TransformResult$1, UserConfig as UserConfig$1, DepOptimizationConfig, ServerOptions, ConfigEnv, AliasOptions, ViteDevServer, ModuleNode } from 'vite';
6
6
  import { StackTraceParserOptions } from '@vitest/utils/source-map';
7
- import { S as SerializedConfig, F as FakeTimerInstallOpts } from './config.BRtC-JeT.js';
7
+ import { a as SerializedConfig, F as FakeTimerInstallOpts } from './config.BCv-fVdT.js';
8
8
  import { PrettyFormatOptions } from '@vitest/pretty-format';
9
9
  import { SnapshotSummary, SnapshotStateOptions } from '@vitest/snapshot';
10
10
  import { SerializedDiffOptions } from '@vitest/utils/diff';
@@ -1,7 +1,7 @@
1
1
  import crypto from 'node:crypto';
2
2
  import { slash, createDefer, shuffle, toArray } from '@vitest/utils';
3
- import fs, { statSync, realpathSync, promises as promises$1 } from 'node:fs';
4
- import { mkdir, writeFile } from 'node:fs/promises';
3
+ import fs, { statSync, realpathSync, promises as promises$1, mkdirSync } from 'node:fs';
4
+ import { writeFile } from 'node:fs/promises';
5
5
  import { builtinModules, createRequire } from 'node:module';
6
6
  import p, { win32, resolve as resolve$1 } from 'node:path';
7
7
  import process$1 from 'node:process';
@@ -6640,14 +6640,14 @@ function createMethodsRPC(project, options = {}) {
6640
6640
  const dir = join(project.tmpDir, transformMode);
6641
6641
  const name = hash("sha1", id, "hex");
6642
6642
  const tmp = join(dir, name);
6643
+ if (!created.has(dir)) {
6644
+ mkdirSync(dir, { recursive: true });
6645
+ created.add(dir);
6646
+ }
6643
6647
  if (promises.has(tmp)) {
6644
6648
  await promises.get(tmp);
6645
6649
  return { id: tmp };
6646
6650
  }
6647
- if (!created.has(dir)) {
6648
- await mkdir(dir, { recursive: true });
6649
- created.add(dir);
6650
- }
6651
6651
  promises.set(
6652
6652
  tmp,
6653
6653
  writeFile(tmp, code, "utf-8").finally(() => promises.delete(tmp))
@@ -1,8 +1,8 @@
1
1
  import { performance } from 'node:perf_hooks';
2
2
  import { startTests, collectTests } from '@vitest/runner';
3
- import { a as resolveSnapshotEnvironment, s as setupChaiConfig, r as resolveTestRunner } from './index.BmFFzXX_.js';
3
+ import { a as resolveSnapshotEnvironment, s as setupChaiConfig, r as resolveTestRunner } from './index.BmFgJtkv.js';
4
4
  import { s as startCoverageInsideWorker, a as stopCoverageInsideWorker } from './coverage.DnNIv-kJ.js';
5
- import { a as globalExpect, v as vi } from './vi.DT3m61kS.js';
5
+ import { a as globalExpect, v as vi } from './vi.B5EKKJdE.js';
6
6
  import { c as closeInspector } from './inspector.DKLceBVD.js';
7
7
  import { createRequire } from 'node:module';
8
8
  import timers from 'node:timers';
@@ -11,8 +11,8 @@ import util from 'node:util';
11
11
  import { getSafeTimers } from '@vitest/utils';
12
12
  import { KNOWN_ASSET_TYPES } from 'vite-node/constants';
13
13
  import { installSourcemapsSupport } from 'vite-node/source-map';
14
- import { V as VitestIndex } from './index.B8haHJlQ.js';
15
- import { s as setupCommonEnv } from './setup-common.wObu9a36.js';
14
+ import { V as VitestIndex } from './index.CNRemkXW.js';
15
+ import { s as setupCommonEnv } from './setup-common.Uaw6Zgv9.js';
16
16
  import { g as getWorkerState, r as resetModules } from './utils.C8RiOc4B.js';
17
17
  import 'chai';
18
18
  import 'node:path';
@@ -25,9 +25,9 @@ import '@vitest/runner/utils';
25
25
  import './_commonjsHelpers.BFTU3MAI.js';
26
26
  import '@vitest/snapshot';
27
27
  import '@vitest/utils/error';
28
+ import '@vitest/spy';
28
29
  import '@vitest/utils/source-map';
29
30
  import './date.W2xKR2qe.js';
30
- import '@vitest/spy';
31
31
  import './run-once.2ogXb3JV.js';
32
32
  import './benchmark.Cdu9hjj4.js';
33
33
  import 'expect-type';
@@ -13,7 +13,7 @@ async function setupCommonEnv(config) {
13
13
  globalSetup = true;
14
14
  setSafeTimers();
15
15
  if (config.globals) {
16
- (await import('./globals.BCtI_nQG.js')).registerApiGlobally();
16
+ (await import('./globals.CydvVTgC.js')).registerApiGlobally();
17
17
  }
18
18
  }
19
19
  function setupDefines(defines) {
@@ -1,4 +1,4 @@
1
- import { I as InlineConfig } from './reporters.QZ837uWx.js';
1
+ import { I as InlineConfig } from './reporters.66aFHiyX.js';
2
2
 
3
3
  type VitestInlineConfig = InlineConfig;
4
4
  declare module 'vite' {
@@ -3,7 +3,7 @@ import vm, { isContext } from 'node:vm';
3
3
  import { dirname, basename, extname, normalize, join, resolve } from 'pathe';
4
4
  import { distDir } from '../path.js';
5
5
  import { createCustomConsole } from './console.CN7AiMGV.js';
6
- import { g as getDefaultRequestStubs, s as startVitestExecutor } from './execute.Bhwls1-Z.js';
6
+ import { g as getDefaultRequestStubs, s as startVitestExecutor } from './execute.eDH0aFFd.js';
7
7
  import fs from 'node:fs';
8
8
  import { dirname as dirname$1 } from 'node:path';
9
9
  import { isNodeBuiltin, isPrimitive, toArray, getCachedData, setCacheData } from 'vite-node/utils';
@@ -1,5 +1,5 @@
1
1
  import { MessagePort } from 'node:worker_threads';
2
- import { C as ContextRPC } from './worker.DaAIyCKm.js';
2
+ import { C as ContextRPC } from './worker.BmVno_ab.js';
3
3
 
4
4
  interface WorkerContext extends ContextRPC {
5
5
  port: MessagePort;
@@ -1,6 +1,6 @@
1
1
  import { File, TaskResultPack, TaskEventPack, CancelReason, FileSpecification, Task } from '@vitest/runner';
2
2
  import { ViteNodeResolveId, ModuleCacheMap, ModuleExecutionInfo } from 'vite-node';
3
- import { S as SerializedConfig } from './config.BRtC-JeT.js';
3
+ import { a as SerializedConfig } from './config.BCv-fVdT.js';
4
4
  import { T as TransformMode, U as UserConsoleLog, A as AfterSuiteRunMeta, E as Environment } from './environment.d8YfPkTm.js';
5
5
  import { SnapshotResult } from '@vitest/snapshot';
6
6
 
package/dist/cli.js CHANGED
@@ -1,4 +1,4 @@
1
- import { c as createCLI } from './chunks/cac.87F_onld.js';
1
+ import { c as createCLI } from './chunks/cac.VN5q-TPC.js';
2
2
  import '@vitest/utils';
3
3
  import 'events';
4
4
  import 'pathe';
package/dist/config.d.ts CHANGED
@@ -1,9 +1,9 @@
1
1
  import { UserConfig as UserConfig$1, ConfigEnv } from 'vite';
2
2
  export { ConfigEnv, Plugin, UserConfig as ViteUserConfig, mergeConfig } from 'vite';
3
- import { d as CoverageV8Options, R as ResolvedCoverageOptions, U as UserWorkspaceConfig, e as UserProjectConfigFn, f as UserProjectConfigExport, T as TestProjectConfiguration } from './chunks/reporters.QZ837uWx.js';
4
- export { W as WorkspaceProjectConfiguration } from './chunks/reporters.QZ837uWx.js';
5
- import './chunks/vite.vM3UZq1q.js';
6
- import { F as FakeTimerInstallOpts } from './chunks/config.BRtC-JeT.js';
3
+ import { d as CoverageV8Options, R as ResolvedCoverageOptions, U as UserWorkspaceConfig, e as UserProjectConfigFn, f as UserProjectConfigExport, T as TestProjectConfiguration } from './chunks/reporters.66aFHiyX.js';
4
+ export { W as WorkspaceProjectConfiguration } from './chunks/reporters.66aFHiyX.js';
5
+ import './chunks/vite.BCQa3xFG.js';
6
+ import { F as FakeTimerInstallOpts } from './chunks/config.BCv-fVdT.js';
7
7
  import '@vitest/runner';
8
8
  import './chunks/environment.d8YfPkTm.js';
9
9
  import '@vitest/utils';
@@ -1,11 +1,11 @@
1
- import { R as ResolvedCoverageOptions, V as Vitest, C as CoverageMap, a as ReportContext } from './chunks/reporters.QZ837uWx.js';
1
+ import { R as ResolvedCoverageOptions, V as Vitest, C as CoverageMap, a as ReportContext } from './chunks/reporters.66aFHiyX.js';
2
2
  import { TransformResult } from 'vite';
3
3
  import { A as AfterSuiteRunMeta } from './chunks/environment.d8YfPkTm.js';
4
4
  import '@vitest/runner';
5
5
  import '@vitest/utils';
6
6
  import 'node:stream';
7
7
  import '@vitest/utils/source-map';
8
- import './chunks/config.BRtC-JeT.js';
8
+ import './chunks/config.BCv-fVdT.js';
9
9
  import '@vitest/pretty-format';
10
10
  import '@vitest/snapshot';
11
11
  import '@vitest/snapshot/environment';
package/dist/coverage.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { existsSync, promises, readdirSync, writeFileSync } from 'node:fs';
2
- import { r as resolveCoverageReporters, c as coverageConfigDefaults, m as mm } from './chunks/resolveConfig.BbcK25zb.js';
2
+ import { r as resolveCoverageReporters, c as coverageConfigDefaults, m as mm } from './chunks/resolveConfig.L1_HR0_0.js';
3
3
  import { resolve, relative } from 'pathe';
4
4
  import c from 'tinyrainbow';
5
5
  import 'node:crypto';
package/dist/execute.d.ts CHANGED
@@ -1,11 +1,11 @@
1
1
  import { ViteNodeRunnerOptions } from 'vite-node';
2
2
  import { ViteNodeRunner, ModuleExecutionInfo } from 'vite-node/client';
3
- import { R as RuntimeRPC, W as WorkerGlobalState } from './chunks/worker.DaAIyCKm.js';
3
+ import { R as RuntimeRPC, W as WorkerGlobalState } from './chunks/worker.BmVno_ab.js';
4
4
  import vm from 'node:vm';
5
5
  import { MockedModule, MockedModuleType } from '@vitest/mocker';
6
6
  import { P as PendingSuiteMock, b as MockFactory, a as MockOptions } from './chunks/mocker.cRtM890J.js';
7
7
  import '@vitest/runner';
8
- import './chunks/config.BRtC-JeT.js';
8
+ import './chunks/config.BCv-fVdT.js';
9
9
  import '@vitest/pretty-format';
10
10
  import '@vitest/snapshot';
11
11
  import '@vitest/snapshot/environment';
package/dist/execute.js CHANGED
@@ -1,4 +1,4 @@
1
- export { V as VitestExecutor } from './chunks/execute.Bhwls1-Z.js';
1
+ export { V as VitestExecutor } from './chunks/execute.eDH0aFFd.js';
2
2
  import 'node:fs';
3
3
  import 'node:url';
4
4
  import 'node:vm';
package/dist/index.d.ts CHANGED
@@ -1,15 +1,15 @@
1
1
  import { File as File$1, TaskResultPack as TaskResultPack$1, TaskEventPack, TaskPopulated, Suite as Suite$1, Test as Test$1, Custom as Custom$1, Task as Task$1, TaskBase as TaskBase$1, TaskResult as TaskResult$1, DoneCallback as DoneCallback$1, RuntimeContext as RuntimeContext$1, SuiteHooks as SuiteHooks$1, SequenceHooks as SequenceHooks$1, SequenceSetupFiles as SequenceSetupFiles$1 } from '@vitest/runner';
2
2
  export { CancelReason, ExtendedContext, HookCleanupCallback, HookListener, OnTestFailedHandler, OnTestFinishedHandler, RunMode, Custom as RunnerCustomCase, Task as RunnerTask, TaskBase as RunnerTaskBase, TaskResult as RunnerTaskResult, TaskResultPack as RunnerTaskResultPack, Test as RunnerTestCase, File as RunnerTestFile, Suite as RunnerTestSuite, SuiteAPI, SuiteCollector, SuiteFactory, TaskContext, TaskCustomOptions, TaskMeta, TaskState, TestAPI, TestContext, TestFunction, TestOptions, afterAll, afterEach, beforeAll, beforeEach, describe, it, onTestFailed, onTestFinished, suite, test } from '@vitest/runner';
3
- import { S as SerializedTestSpecification, c as CoverageProvider$1, a as ReportContext$1, g as CoverageProviderModule$1, h as CoverageReporter$1, i as CoverageProviderName, j as CoverageOptions$1, R as ResolvedCoverageOptions$1, B as BaseCoverageOptions$1, k as CoverageIstanbulOptions$1, d as CoverageV8Options$1, l as CustomProviderOptions$1, m as Reporter$1, V as Vitest$1, n as BrowserScript$1, o as BrowserConfigOptions$1, p as BuiltinEnvironment$1, q as VitestEnvironment$1, P as Pool$1, r as PoolOptions$1, s as CSSModuleScopeStrategy$1, A as ApiConfig$1, t as VitestRunMode$1, D as DepsOptimizationOptions$1, u as TransformModePatterns$1, I as InlineConfig$1, v as TypecheckConfig$1, w as UserConfig$1, x as ResolvedConfig$1, y as ProjectConfig$1, U as UserWorkspaceConfig$1, z as BenchmarkUserOptions$1 } from './chunks/reporters.QZ837uWx.js';
4
- import { W as WorkerContext$1 } from './chunks/worker.B2JXutr8.js';
3
+ import { S as SerializedTestSpecification, c as CoverageProvider$1, a as ReportContext$1, g as CoverageProviderModule$1, h as CoverageReporter$1, i as CoverageProviderName, j as CoverageOptions$1, R as ResolvedCoverageOptions$1, B as BaseCoverageOptions$1, k as CoverageIstanbulOptions$1, d as CoverageV8Options$1, l as CustomProviderOptions$1, m as Reporter$1, V as Vitest$1, n as BrowserScript$1, o as BrowserConfigOptions$1, p as BuiltinEnvironment$1, q as VitestEnvironment$1, P as Pool$1, r as PoolOptions$1, s as CSSModuleScopeStrategy$1, A as ApiConfig$1, t as VitestRunMode$1, D as DepsOptimizationOptions$1, u as TransformModePatterns$1, I as InlineConfig$1, v as TypecheckConfig$1, w as UserConfig$1, x as ResolvedConfig$1, y as ProjectConfig$1, U as UserWorkspaceConfig$1, z as BenchmarkUserOptions$1 } from './chunks/reporters.66aFHiyX.js';
4
+ import { W as WorkerContext$1 } from './chunks/worker.BT4v-DKx.js';
5
5
  import { R as RawErrsMap$1, T as TscErrorInfo$1, C as CollectLineNumbers$1, a as CollectLines$1, b as RootAndTarget$1, c as Context$1 } from './chunks/global.CnI8_G5V.js';
6
6
  import { b as Awaitable$1, U as UserConsoleLog, M as ModuleGraphData, P as ProvidedContext, N as Nullable$1, c as Arrayable$1, d as ArgumentsType$1, e as MutableArray$1, C as Constructable$1, a as EnvironmentReturn$1, V as VmEnvironmentReturn$1, E as Environment$1, R as ResolvedTestEnvironment$1, J as JSDOMOptions$1, H as HappyDOMOptions$1, f as EnvironmentOptions$1 } from './chunks/environment.d8YfPkTm.js';
7
7
  export { A as AfterSuiteRunMeta, g as ModuleCache } from './chunks/environment.d8YfPkTm.js';
8
- import { a as BirpcReturn, b as WorkerRPC$1 } from './chunks/worker.DaAIyCKm.js';
9
- export { C as ContextRPC, d as ContextTestEnvironment, e as ResolveIdFunction, c as RunnerRPC, R as RuntimeRPC, W as WorkerGlobalState } from './chunks/worker.DaAIyCKm.js';
10
- import './chunks/vite.vM3UZq1q.js';
11
- import { S as SerializedConfig, F as FakeTimerInstallOpts, R as RuntimeOptions } from './chunks/config.BRtC-JeT.js';
12
- export { b as RuntimeConfig, a as SerializedCoverageConfig } from './chunks/config.BRtC-JeT.js';
8
+ import { a as BirpcReturn, b as WorkerRPC$1 } from './chunks/worker.BmVno_ab.js';
9
+ export { C as ContextRPC, d as ContextTestEnvironment, e as ResolveIdFunction, c as RunnerRPC, R as RuntimeRPC, W as WorkerGlobalState } from './chunks/worker.BmVno_ab.js';
10
+ import './chunks/vite.BCQa3xFG.js';
11
+ import { a as SerializedConfig, F as FakeTimerInstallOpts, R as RuntimeOptions } from './chunks/config.BCv-fVdT.js';
12
+ export { b as RuntimeConfig, S as SerializedCoverageConfig } from './chunks/config.BCv-fVdT.js';
13
13
  import { ExpectStatic } from '@vitest/expect';
14
14
  export { Assertion, AsymmetricMatchersContaining, ExpectPollOptions, ExpectStatic, JestAssertion } from '@vitest/expect';
15
15
  import { spyOn, fn, MaybeMockedDeep, MaybeMocked, MaybePartiallyMocked, MaybePartiallyMockedDeep, MockInstance } from '@vitest/spy';
package/dist/index.js CHANGED
@@ -1,6 +1,6 @@
1
- export { c as createExpect, a as expect, i as inject, v as vi, b as vitest } from './chunks/vi.DT3m61kS.js';
1
+ export { c as createExpect, a as expect, i as inject, v as vi, b as vitest } from './chunks/vi.B5EKKJdE.js';
2
2
  export { i as isFirstRun, a as runOnce } from './chunks/run-once.2ogXb3JV.js';
3
- export { a as assertType, g as getRunningMode, i as isWatchMode } from './chunks/index.B8haHJlQ.js';
3
+ export { a as assertType, g as getRunningMode, i as isWatchMode } from './chunks/index.CNRemkXW.js';
4
4
  export { b as bench } from './chunks/benchmark.Cdu9hjj4.js';
5
5
  export { expectTypeOf } from 'expect-type';
6
6
  export { afterAll, afterEach, beforeAll, beforeEach, describe, it, onTestFailed, onTestFinished, suite, test } from '@vitest/runner';
@@ -14,6 +14,6 @@ import '@vitest/utils';
14
14
  import './chunks/_commonjsHelpers.BFTU3MAI.js';
15
15
  import '@vitest/snapshot';
16
16
  import '@vitest/utils/error';
17
+ import '@vitest/spy';
17
18
  import '@vitest/utils/source-map';
18
19
  import './chunks/date.W2xKR2qe.js';
19
- import '@vitest/spy';
package/dist/node.d.ts CHANGED
@@ -1,20 +1,20 @@
1
- import { x as ResolvedConfig, w as UserConfig, t as VitestRunMode, E as VitestOptions, V as Vitest, A as ApiConfig, F as TestProject, G as TestSequencer, H as TestSpecification, L as Logger, J as TestModule, M as ModuleDiagnostic } from './chunks/reporters.QZ837uWx.js';
2
- export { B as BaseCoverageOptions, z as BenchmarkUserOptions, ae as BrowserBuiltinProvider, af as BrowserCommand, ag as BrowserCommandContext, o as BrowserConfigOptions, ah as BrowserInstanceOption, ai as BrowserOrchestrator, aj as BrowserProvider, ak as BrowserProviderInitializationOptions, al as BrowserProviderModule, am as BrowserProviderOptions, n as BrowserScript, an as BrowserServerState, ao as BrowserServerStateSession, p as BuiltinEnvironment, ap as CDPSession, s as CSSModuleScopeStrategy, k as CoverageIstanbulOptions, j as CoverageOptions, c as CoverageProvider, g as CoverageProviderModule, h as CoverageReporter, d as CoverageV8Options, l as CustomProviderOptions, D as DepsOptimizationOptions, _ as HTMLOptions, I as InlineConfig, a0 as JUnitOptions, $ as JsonOptions, O as OnServerRestartHandler, K as OnTestsRerunHandler, aq as ParentProjectBrowser, P as Pool, r as PoolOptions, Q as ProcessPool, ar as ProjectBrowser, y as ProjectConfig, a as ReportContext, ax as ReportedHookContext, m as Reporter, au as ResolveSnapshotPathHandler, av as ResolveSnapshotPathHandlerContext, as as ResolvedBrowserOptions, R as ResolvedCoverageOptions, at as ResolvedProjectConfig, Z as SerializedTestProject, a1 as TaskOptions, a2 as TestCase, a3 as TestCollection, a4 as TestDiagnostic, a5 as TestModuleState, a6 as TestResult, a7 as TestResultFailed, a8 as TestResultPassed, a9 as TestResultSkipped, ay as TestRunEndReason, aw as TestRunResult, ad as TestSequencerConstructor, aa as TestState, ab as TestSuite, ac as TestSuiteState, u as TransformModePatterns, v as TypecheckConfig, U as UserWorkspaceConfig, q as VitestEnvironment, N as VitestPackageInstaller, X as WorkspaceSpec, Y as getFilePoolName } from './chunks/reporters.QZ837uWx.js';
1
+ import { x as ResolvedConfig, w as UserConfig, t as VitestRunMode, E as VitestOptions, V as Vitest, A as ApiConfig, F as TestProject, G as TestSequencer, H as TestSpecification, L as Logger, J as TestModule, M as ModuleDiagnostic } from './chunks/reporters.66aFHiyX.js';
2
+ export { B as BaseCoverageOptions, z as BenchmarkUserOptions, ae as BrowserBuiltinProvider, af as BrowserCommand, ag as BrowserCommandContext, o as BrowserConfigOptions, ah as BrowserInstanceOption, ai as BrowserOrchestrator, aj as BrowserProvider, ak as BrowserProviderInitializationOptions, al as BrowserProviderModule, am as BrowserProviderOptions, n as BrowserScript, an as BrowserServerState, ao as BrowserServerStateSession, p as BuiltinEnvironment, ap as CDPSession, s as CSSModuleScopeStrategy, k as CoverageIstanbulOptions, j as CoverageOptions, c as CoverageProvider, g as CoverageProviderModule, h as CoverageReporter, d as CoverageV8Options, l as CustomProviderOptions, D as DepsOptimizationOptions, _ as HTMLOptions, I as InlineConfig, a0 as JUnitOptions, $ as JsonOptions, O as OnServerRestartHandler, K as OnTestsRerunHandler, aq as ParentProjectBrowser, P as Pool, r as PoolOptions, Q as ProcessPool, ar as ProjectBrowser, y as ProjectConfig, a as ReportContext, ax as ReportedHookContext, m as Reporter, au as ResolveSnapshotPathHandler, av as ResolveSnapshotPathHandlerContext, as as ResolvedBrowserOptions, R as ResolvedCoverageOptions, at as ResolvedProjectConfig, Z as SerializedTestProject, a1 as TaskOptions, a2 as TestCase, a3 as TestCollection, a4 as TestDiagnostic, a5 as TestModuleState, a6 as TestResult, a7 as TestResultFailed, a8 as TestResultPassed, a9 as TestResultSkipped, ay as TestRunEndReason, aw as TestRunResult, ad as TestSequencerConstructor, aa as TestState, ab as TestSuite, ac as TestSuiteState, u as TransformModePatterns, v as TypecheckConfig, U as UserWorkspaceConfig, q as VitestEnvironment, N as VitestPackageInstaller, X as WorkspaceSpec, Y as getFilePoolName } from './chunks/reporters.66aFHiyX.js';
3
3
  import { UserConfig as UserConfig$1, Plugin, ResolvedConfig as ResolvedConfig$1, LogLevel, LoggerOptions, Logger as Logger$1, createServer as createServer$1 } from 'vite';
4
4
  import * as vite from 'vite';
5
5
  export { vite as Vite };
6
6
  export { esbuildVersion, isFileServingAllowed, parseAst, parseAstAsync, rollupVersion, version as viteVersion } from 'vite';
7
7
  import { IncomingMessage } from 'node:http';
8
- import { R as RuntimeRPC } from './chunks/worker.DaAIyCKm.js';
8
+ import { R as RuntimeRPC } from './chunks/worker.BmVno_ab.js';
9
9
  import { Writable } from 'node:stream';
10
- export { W as WorkerContext } from './chunks/worker.B2JXutr8.js';
10
+ export { W as WorkerContext } from './chunks/worker.BT4v-DKx.js';
11
11
  export { C as TypeCheckCollectLineNumbers, a as TypeCheckCollectLines, c as TypeCheckContext, T as TypeCheckErrorInfo, R as TypeCheckRawErrorsMap, b as TypeCheckRootAndTarget } from './chunks/global.CnI8_G5V.js';
12
12
  import { Debugger } from 'debug';
13
13
  export { Task as RunnerTask, TaskResult as RunnerTaskResult, TaskResultPack as RunnerTaskResultPack, Test as RunnerTestCase, File as RunnerTestFile, Suite as RunnerTestSuite, SequenceHooks, SequenceSetupFiles } from '@vitest/runner';
14
14
  export { f as EnvironmentOptions, H as HappyDOMOptions, J as JSDOMOptions } from './chunks/environment.d8YfPkTm.js';
15
15
  export { SerializedError } from '@vitest/utils';
16
- export { b as RuntimeConfig } from './chunks/config.BRtC-JeT.js';
17
- import './chunks/vite.vM3UZq1q.js';
16
+ export { b as RuntimeConfig } from './chunks/config.BCv-fVdT.js';
17
+ import './chunks/vite.BCQa3xFG.js';
18
18
  export { generateFileHash } from '@vitest/runner/utils';
19
19
  import '@vitest/utils/source-map';
20
20
  import '@vitest/pretty-format';
package/dist/node.js CHANGED
@@ -1,10 +1,10 @@
1
1
  import { resolveConfig as resolveConfig$1, mergeConfig, createServer as createServer$1 } from 'vite';
2
2
  export { esbuildVersion, isFileServingAllowed, parseAst, parseAstAsync, rollupVersion, version as viteVersion } from 'vite';
3
- import { V as Vitest, a as VitestPlugin, T as TestModule } from './chunks/cli-api.BZbq1zTX.js';
4
- export { G as GitNotFoundError, F as TestsNotFoundError, b as VitestPackageInstaller, e as createViteLogger, c as createVitest, i as isValidApiRequest, d as registerConsoleShortcuts, r as resolveFsAllow, s as startVitest } from './chunks/cli-api.BZbq1zTX.js';
5
- export { p as parseCLI } from './chunks/cac.87F_onld.js';
6
- import { a as resolveConfig$2 } from './chunks/resolveConfig.BbcK25zb.js';
7
- export { B as BaseSequencer, d as createMethodsRPC, g as getFilePoolName, b as resolveApiServerConfig } from './chunks/resolveConfig.BbcK25zb.js';
3
+ import { V as Vitest, a as VitestPlugin, T as TestModule } from './chunks/cli-api.Dis64jtY.js';
4
+ export { G as GitNotFoundError, F as TestsNotFoundError, b as VitestPackageInstaller, e as createViteLogger, c as createVitest, i as isValidApiRequest, d as registerConsoleShortcuts, r as resolveFsAllow, s as startVitest } from './chunks/cli-api.Dis64jtY.js';
5
+ export { p as parseCLI } from './chunks/cac.VN5q-TPC.js';
6
+ import { a as resolveConfig$2 } from './chunks/resolveConfig.L1_HR0_0.js';
7
+ export { B as BaseSequencer, d as createMethodsRPC, g as getFilePoolName, b as resolveApiServerConfig } from './chunks/resolveConfig.L1_HR0_0.js';
8
8
  import { slash } from '@vitest/utils';
9
9
  import { f as findUp } from './chunks/index.DBIGubLC.js';
10
10
  import { resolve } from 'pathe';
@@ -19,7 +19,7 @@ import '@vitest/snapshot/manager';
19
19
  import 'vite-node/client';
20
20
  import 'vite-node/server';
21
21
  import './chunks/index.68735LiX.js';
22
- import './chunks/index.C1f-_gvH.js';
22
+ import './chunks/index.B7vJpkTD.js';
23
23
  import 'tinyrainbow';
24
24
  import './chunks/utils.bLM2atbD.js';
25
25
  import 'node:util';
@@ -1,11 +1,11 @@
1
- export { aN as BaseReporter, az as BasicReporter, aO as BenchmarkBuiltinReporters, aA as BenchmarkReporter, aB as BenchmarkReportsMap, aP as BuiltinReporterOptions, aQ as BuiltinReporters, aC as DefaultReporter, aD as DotReporter, aE as GithubActionsReporter, aF as HangingProcessReporter, aH as JUnitReporter, aR as JsonAssertionResult, aG as JsonReporter, aS as JsonTestResult, aT as JsonTestResults, ax as ReportedHookContext, m as Reporter, aI as ReportersMap, aJ as TapFlatReporter, aK as TapReporter, ay as TestRunEndReason, aL as VerboseBenchmarkReporter, aM as VerboseReporter } from './chunks/reporters.QZ837uWx.js';
1
+ export { aN as BaseReporter, az as BasicReporter, aO as BenchmarkBuiltinReporters, aA as BenchmarkReporter, aB as BenchmarkReportsMap, aP as BuiltinReporterOptions, aQ as BuiltinReporters, aC as DefaultReporter, aD as DotReporter, aE as GithubActionsReporter, aF as HangingProcessReporter, aH as JUnitReporter, aR as JsonAssertionResult, aG as JsonReporter, aS as JsonTestResult, aT as JsonTestResults, ax as ReportedHookContext, m as Reporter, aI as ReportersMap, aJ as TapFlatReporter, aK as TapReporter, ay as TestRunEndReason, aL as VerboseBenchmarkReporter, aM as VerboseReporter } from './chunks/reporters.66aFHiyX.js';
2
2
  import '@vitest/runner';
3
3
  import './chunks/environment.d8YfPkTm.js';
4
4
  import '@vitest/utils';
5
5
  import 'node:stream';
6
6
  import 'vite';
7
7
  import '@vitest/utils/source-map';
8
- import './chunks/config.BRtC-JeT.js';
8
+ import './chunks/config.BCv-fVdT.js';
9
9
  import '@vitest/pretty-format';
10
10
  import '@vitest/snapshot';
11
11
  import '@vitest/snapshot/environment';
package/dist/reporters.js CHANGED
@@ -1,4 +1,4 @@
1
- export { B as BasicReporter, a as BenchmarkReporter, b as BenchmarkReportsMap, D as DefaultReporter, c as DotReporter, G as GithubActionsReporter, H as HangingProcessReporter, d as JUnitReporter, J as JsonReporter, R as ReportersMap, T as TapFlatReporter, e as TapReporter, V as VerboseBenchmarkReporter, f as VerboseReporter } from './chunks/index.C1f-_gvH.js';
1
+ export { B as BasicReporter, a as BenchmarkReporter, b as BenchmarkReportsMap, D as DefaultReporter, c as DotReporter, G as GithubActionsReporter, H as HangingProcessReporter, d as JUnitReporter, J as JsonReporter, R as ReportersMap, T as TapFlatReporter, e as TapReporter, V as VerboseBenchmarkReporter, f as VerboseReporter } from './chunks/index.B7vJpkTD.js';
2
2
  import 'node:fs';
3
3
  import '@vitest/runner/utils';
4
4
  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, TestContext } from '@vitest/runner';
3
3
  export { VitestRunner } from '@vitest/runner';
4
- import { S as SerializedConfig } from './chunks/config.BRtC-JeT.js';
4
+ import { a as SerializedConfig } from './chunks/config.BCv-fVdT.js';
5
5
  import '@vitest/pretty-format';
6
6
  import '@vitest/snapshot';
7
7
  import '@vitest/snapshot/environment';
package/dist/runners.js CHANGED
@@ -4,15 +4,15 @@ import { a as getBenchOptions, g as getBenchFn } from './chunks/benchmark.Cdu9hj
4
4
  import { g as getWorkerState } from './chunks/utils.C8RiOc4B.js';
5
5
  import { setState, GLOBAL_EXPECT, getState } from '@vitest/expect';
6
6
  import { getTests, getNames, getTestName } from '@vitest/runner/utils';
7
- import { g as getSnapshotClient, i as inject, c as createExpect, v as vi } from './chunks/vi.DT3m61kS.js';
7
+ import { g as getSnapshotClient, i as inject, c as createExpect, v as vi } from './chunks/vi.B5EKKJdE.js';
8
8
  import { r as rpc } from './chunks/rpc.TVf73xOu.js';
9
9
  import 'chai';
10
10
  import './chunks/_commonjsHelpers.BFTU3MAI.js';
11
11
  import '@vitest/snapshot';
12
12
  import '@vitest/utils/error';
13
+ import '@vitest/spy';
13
14
  import '@vitest/utils/source-map';
14
15
  import './chunks/date.W2xKR2qe.js';
15
- import '@vitest/spy';
16
16
  import './chunks/index.68735LiX.js';
17
17
 
18
18
  function createBenchmarkResult(name) {
@@ -1,8 +1,8 @@
1
1
  import v8 from 'node:v8';
2
- import { r as runBaseTests } from '../chunks/base.BgUWWWYp.js';
2
+ import { r as runBaseTests } from '../chunks/base.XvKTsMeK.js';
3
3
  import { c as createForksRpcOptions, u as unwrapSerializableConfig } from '../chunks/utils.Cn0zI1t3.js';
4
4
  import 'vite-node/client';
5
- import '../chunks/execute.Bhwls1-Z.js';
5
+ import '../chunks/execute.eDH0aFFd.js';
6
6
  import 'node:fs';
7
7
  import 'node:url';
8
8
  import 'node:vm';
@@ -6,11 +6,11 @@ import util from 'node:util';
6
6
  import { startTests, collectTests } from '@vitest/runner';
7
7
  import { KNOWN_ASSET_TYPES } from 'vite-node/constants';
8
8
  import { installSourcemapsSupport } from 'vite-node/source-map';
9
- import { s as setupChaiConfig, r as resolveTestRunner, a as resolveSnapshotEnvironment } from '../chunks/index.BmFFzXX_.js';
9
+ import { s as setupChaiConfig, r as resolveTestRunner, a as resolveSnapshotEnvironment } from '../chunks/index.BmFgJtkv.js';
10
10
  import { s as startCoverageInsideWorker, a as stopCoverageInsideWorker } from '../chunks/coverage.DnNIv-kJ.js';
11
- import { V as VitestIndex } from '../chunks/index.B8haHJlQ.js';
11
+ import { V as VitestIndex } from '../chunks/index.CNRemkXW.js';
12
12
  import { c as closeInspector } from '../chunks/inspector.DKLceBVD.js';
13
- import { s as setupCommonEnv } from '../chunks/setup-common.wObu9a36.js';
13
+ import { s as setupCommonEnv } from '../chunks/setup-common.Uaw6Zgv9.js';
14
14
  import { g as getWorkerState } from '../chunks/utils.C8RiOc4B.js';
15
15
  import 'chai';
16
16
  import 'node:path';
@@ -19,15 +19,15 @@ import 'node:url';
19
19
  import '../chunks/rpc.TVf73xOu.js';
20
20
  import '@vitest/utils';
21
21
  import '../chunks/index.68735LiX.js';
22
- import '../chunks/vi.DT3m61kS.js';
22
+ import '../chunks/vi.B5EKKJdE.js';
23
23
  import '@vitest/expect';
24
24
  import '@vitest/runner/utils';
25
25
  import '../chunks/_commonjsHelpers.BFTU3MAI.js';
26
26
  import '@vitest/snapshot';
27
27
  import '@vitest/utils/error';
28
+ import '@vitest/spy';
28
29
  import '@vitest/utils/source-map';
29
30
  import '../chunks/date.W2xKR2qe.js';
30
- import '@vitest/spy';
31
31
  import '../chunks/run-once.2ogXb3JV.js';
32
32
  import '../chunks/benchmark.Cdu9hjj4.js';
33
33
  import 'expect-type';
@@ -1,7 +1,7 @@
1
- import { r as runBaseTests } from '../chunks/base.BgUWWWYp.js';
1
+ import { r as runBaseTests } from '../chunks/base.XvKTsMeK.js';
2
2
  import { a as createThreadsRpcOptions } from '../chunks/utils.Cn0zI1t3.js';
3
3
  import 'vite-node/client';
4
- import '../chunks/execute.Bhwls1-Z.js';
4
+ import '../chunks/execute.eDH0aFFd.js';
5
5
  import 'node:fs';
6
6
  import 'node:url';
7
7
  import 'node:vm';
@@ -1,6 +1,6 @@
1
1
  import v8 from 'node:v8';
2
2
  import { c as createForksRpcOptions, u as unwrapSerializableConfig } from '../chunks/utils.Cn0zI1t3.js';
3
- import { r as runVmTests } from '../chunks/vm.6kNys9FN.js';
3
+ import { r as runVmTests } from '../chunks/vm.jEFQDlX_.js';
4
4
  import '@vitest/utils';
5
5
  import 'node:url';
6
6
  import 'node:vm';
@@ -13,7 +13,7 @@ import 'node:stream';
13
13
  import 'tinyrainbow';
14
14
  import '../chunks/date.W2xKR2qe.js';
15
15
  import '../chunks/utils.C8RiOc4B.js';
16
- import '../chunks/execute.Bhwls1-Z.js';
16
+ import '../chunks/execute.eDH0aFFd.js';
17
17
  import 'node:fs';
18
18
  import '@vitest/utils/error';
19
19
  import 'vite-node/client';
@@ -1,5 +1,5 @@
1
1
  import { a as createThreadsRpcOptions } from '../chunks/utils.Cn0zI1t3.js';
2
- import { r as runVmTests } from '../chunks/vm.6kNys9FN.js';
2
+ import { r as runVmTests } from '../chunks/vm.jEFQDlX_.js';
3
3
  import '@vitest/utils';
4
4
  import 'node:url';
5
5
  import 'node:vm';
@@ -12,7 +12,7 @@ import 'node:stream';
12
12
  import 'tinyrainbow';
13
13
  import '../chunks/date.W2xKR2qe.js';
14
14
  import '../chunks/utils.C8RiOc4B.js';
15
- import '../chunks/execute.Bhwls1-Z.js';
15
+ import '../chunks/execute.eDH0aFFd.js';
16
16
  import 'node:fs';
17
17
  import '@vitest/utils/error';
18
18
  import 'vite-node/client';
package/dist/workers.d.ts CHANGED
@@ -1,8 +1,8 @@
1
- import { W as WorkerGlobalState, C as ContextRPC, B as BirpcOptions, R as RuntimeRPC } from './chunks/worker.DaAIyCKm.js';
1
+ import { W as WorkerGlobalState, C as ContextRPC, B as BirpcOptions, R as RuntimeRPC } from './chunks/worker.BmVno_ab.js';
2
2
  import { Awaitable } from '@vitest/utils';
3
3
  import * as v8 from 'v8';
4
- import { S as SerializedConfig } from './chunks/config.BRtC-JeT.js';
5
- import { W as WorkerContext } from './chunks/worker.B2JXutr8.js';
4
+ import { a as SerializedConfig } from './chunks/config.BCv-fVdT.js';
5
+ import { W as WorkerContext } from './chunks/worker.BT4v-DKx.js';
6
6
  import '@vitest/runner';
7
7
  import 'vite-node';
8
8
  import './chunks/environment.d8YfPkTm.js';
package/dist/workers.js CHANGED
@@ -1,8 +1,8 @@
1
1
  export { p as provideWorkerState } from './chunks/utils.C8RiOc4B.js';
2
2
  export { collect as collectVitestWorkerTests, run as runVitestWorker } from './worker.js';
3
- export { r as runBaseTests } from './chunks/base.BgUWWWYp.js';
3
+ export { r as runBaseTests } from './chunks/base.XvKTsMeK.js';
4
4
  export { c as createForksRpcOptions, a as createThreadsRpcOptions, u as unwrapSerializableConfig } from './chunks/utils.Cn0zI1t3.js';
5
- export { r as runVmTests } from './chunks/vm.6kNys9FN.js';
5
+ export { r as runVmTests } from './chunks/vm.jEFQDlX_.js';
6
6
  import '@vitest/utils';
7
7
  import 'node:url';
8
8
  import '@vitest/utils/source-map';
@@ -16,7 +16,7 @@ import './chunks/inspector.DKLceBVD.js';
16
16
  import 'node:module';
17
17
  import './chunks/rpc.TVf73xOu.js';
18
18
  import './chunks/index.68735LiX.js';
19
- import './chunks/execute.Bhwls1-Z.js';
19
+ import './chunks/execute.eDH0aFFd.js';
20
20
  import 'node:vm';
21
21
  import '@vitest/utils/error';
22
22
  import 'vite-node/utils';
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "vitest",
3
3
  "type": "module",
4
- "version": "3.0.7",
4
+ "version": "3.0.8",
5
5
  "description": "Next generation testing framework powered by Vite",
6
6
  "author": "Anthony Fu <anthonyfu117@hotmail.com>",
7
7
  "license": "MIT",
@@ -123,8 +123,8 @@
123
123
  "@types/node": "^18.0.0 || ^20.0.0 || >=22.0.0",
124
124
  "happy-dom": "*",
125
125
  "jsdom": "*",
126
- "@vitest/browser": "3.0.7",
127
- "@vitest/ui": "3.0.7"
126
+ "@vitest/ui": "3.0.8",
127
+ "@vitest/browser": "3.0.8"
128
128
  },
129
129
  "peerDependenciesMeta": {
130
130
  "@edge-runtime/vm": {
@@ -162,14 +162,14 @@
162
162
  "tinyrainbow": "^2.0.0",
163
163
  "vite": "^5.0.0 || ^6.0.0",
164
164
  "why-is-node-running": "^2.3.0",
165
- "@vitest/mocker": "3.0.7",
166
- "@vitest/pretty-format": "^3.0.7",
167
- "@vitest/expect": "3.0.7",
168
- "@vitest/runner": "3.0.7",
169
- "@vitest/snapshot": "3.0.7",
170
- "@vitest/spy": "3.0.7",
171
- "vite-node": "3.0.7",
172
- "@vitest/utils": "3.0.7"
165
+ "@vitest/expect": "3.0.8",
166
+ "@vitest/mocker": "3.0.8",
167
+ "@vitest/pretty-format": "^3.0.8",
168
+ "@vitest/runner": "3.0.8",
169
+ "@vitest/spy": "3.0.8",
170
+ "vite-node": "3.0.8",
171
+ "@vitest/utils": "3.0.8",
172
+ "@vitest/snapshot": "3.0.8"
173
173
  },
174
174
  "devDependencies": {
175
175
  "@ampproject/remapping": "^2.3.0",
@@ -198,7 +198,7 @@
198
198
  "micromatch": "^4.0.8",
199
199
  "pretty-format": "^29.7.0",
200
200
  "prompts": "^2.4.2",
201
- "strip-literal": "^2.1.1",
201
+ "strip-literal": "^3.0.0",
202
202
  "tinyglobby": "^0.2.12",
203
203
  "ws": "^8.18.1"
204
204
  },
@@ -1,22 +0,0 @@
1
- import * as spy$1 from '@vitest/spy';
2
-
3
- function _mergeNamespaces(n, m) {
4
- m.forEach(function (e) {
5
- e && typeof e !== 'string' && !Array.isArray(e) && Object.keys(e).forEach(function (k) {
6
- if (k !== 'default' && !(k in n)) {
7
- var d = Object.getOwnPropertyDescriptor(e, k);
8
- Object.defineProperty(n, k, d.get ? d : {
9
- enumerable: true,
10
- get: function () { return e[k]; }
11
- });
12
- }
13
- });
14
- });
15
- return Object.freeze(n);
16
- }
17
-
18
- var spy = /*#__PURE__*/_mergeNamespaces({
19
- __proto__: null
20
- }, [spy$1]);
21
-
22
- export { spy as s };
@@ -7,9 +7,9 @@ import { getSafeTimers, assertTypes, createSimpleStackTrace } from '@vitest/util
7
7
  import { g as getDefaultExportFromCjs, c as commonjsGlobal } from './_commonjsHelpers.BFTU3MAI.js';
8
8
  import { stripSnapshotIndentation, addSerializer, SnapshotClient } from '@vitest/snapshot';
9
9
  import '@vitest/utils/error';
10
+ import { fn, spyOn, mocks, isMockFunction } from '@vitest/spy';
10
11
  import { parseSingleStack } from '@vitest/utils/source-map';
11
12
  import { R as RealDate, r as resetDate, m as mockDate } from './date.W2xKR2qe.js';
12
- import { fn, spyOn, mocks, isMockFunction } from '@vitest/spy';
13
13
 
14
14
  const unsupported = [
15
15
  // .poll is meant to retry matchers until they succeed, and