vitest 2.1.0-beta.5 → 2.1.0-beta.7

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 (62) hide show
  1. package/LICENSE.md +59 -320
  2. package/dist/browser.d.ts +6 -3
  3. package/dist/browser.js +2 -2
  4. package/dist/chunks/{RandomSequencer.B4M2ux5b.js → RandomSequencer.Bh5-tlNJ.js} +77 -58
  5. package/dist/chunks/{base.BH-FAiX7.js → base.BlXpj3e_.js} +1 -29
  6. package/dist/chunks/{base.BYvKfYzm.js → base.CchlWrnV.js} +2 -4
  7. package/dist/chunks/{cac.DosbLiJg.js → cac.B5XYKv2_.js} +26 -17
  8. package/dist/chunks/{cli-api.D8zgNrBU.js → cli-api.ByZPnilx.js} +7419 -7959
  9. package/dist/chunks/{constants.CaAN7icJ.js → constants.fzPh7AOq.js} +1 -1
  10. package/dist/chunks/{coverage.CqfT4xaf.js → coverage.zlNdAMHK.js} +5 -3
  11. package/dist/chunks/{creator.COdKw_ZN.js → creator.zfBZSJzo.js} +9 -9
  12. package/dist/chunks/{environment.0M5R1SX_.d.ts → environment.C5eAp3K6.d.ts} +1 -1
  13. package/dist/chunks/{execute.DT9BA6zp.js → execute._eQQfgI8.js} +322 -232
  14. package/dist/chunks/{git.ZtkbKc8u.js → git.B5SDxu-n.js} +5 -5
  15. package/dist/chunks/{globals.DRPLtPOv.js → globals.jM7MxN2t.js} +4 -4
  16. package/dist/chunks/{index.CM5UI-4O.js → index.Bn75ITYg.js} +3 -3
  17. package/dist/chunks/index.CPD77dLA.js +133 -0
  18. package/dist/chunks/{index.CxWPpGJz.js → index.CSjyR2-v.js} +2 -2
  19. package/dist/chunks/{index.Dx3f477d.js → index.DpJO1tkB.js} +1110 -1104
  20. package/dist/chunks/{index.CNZXZ9PJ.js → index.xm8OIiKD.js} +1 -1
  21. package/dist/chunks/mocker.cRtM890J.d.ts +17 -0
  22. package/dist/chunks/{reporters.DbwOGCsU.d.ts → reporters.WnPwkmgA.d.ts} +154 -129
  23. package/dist/chunks/{resolveConfig.RHsAM2_Q.js → resolveConfig.-K5hHm0S.js} +56 -34
  24. package/dist/chunks/{runBaseTests.BAhL8UH_.js → runBaseTests.Cztfoflv.js} +7 -7
  25. package/dist/chunks/{setup-common.KBrCO5LJ.js → setup-common.fGBFoQKJ.js} +1 -1
  26. package/dist/chunks/{utils.C3_cBsyn.js → utils.Cn0zI1t3.js} +16 -3
  27. package/dist/chunks/{utils.DO38lwfj.js → utils.Dbnmsfq1.js} +1 -1
  28. package/dist/chunks/{vi.B6QZ938s.js → vi.DGgiNzJE.js} +46 -37
  29. package/dist/chunks/vite.D2yAwzwa.d.ts +11 -0
  30. package/dist/chunks/{vm.kl9T_5ai.js → vm.CPXwWp4C.js} +1 -2
  31. package/dist/chunks/{worker.Cx2xE71X.d.ts → worker.Bws9Zuxu.d.ts} +1 -1
  32. package/dist/chunks/{worker.BANO5ak1.d.ts → worker.CmPmTxgH.d.ts} +2 -14
  33. package/dist/cli.js +3 -3
  34. package/dist/config.cjs +1 -0
  35. package/dist/config.d.ts +70 -2
  36. package/dist/config.js +1 -0
  37. package/dist/coverage.d.ts +4 -3
  38. package/dist/coverage.js +29 -5
  39. package/dist/environments.d.ts +2 -2
  40. package/dist/execute.d.ts +13 -14
  41. package/dist/execute.js +3 -2
  42. package/dist/index.d.ts +23 -16
  43. package/dist/index.js +4 -4
  44. package/dist/mocker.d.ts +1 -0
  45. package/dist/mocker.js +1 -0
  46. package/dist/node.d.ts +27 -9
  47. package/dist/node.js +44 -39
  48. package/dist/reporters.d.ts +2 -2
  49. package/dist/reporters.js +8 -8
  50. package/dist/runners.js +2 -2
  51. package/dist/utils.d.ts +1 -0
  52. package/dist/worker.js +3 -2
  53. package/dist/workers/forks.js +5 -4
  54. package/dist/workers/runVmTests.js +6 -6
  55. package/dist/workers/threads.js +5 -4
  56. package/dist/workers/vmForks.js +4 -4
  57. package/dist/workers/vmThreads.js +4 -4
  58. package/dist/workers.d.ts +4 -16
  59. package/dist/workers.js +6 -5
  60. package/mocker.d.ts +1 -0
  61. package/package.json +22 -17
  62. package/dist/chunks/index.DNUmWFkO.js +0 -319
@@ -1,12 +1,12 @@
1
- import { B as BaseCoverageOptions, R as ResolvedCoverageOptions } from './chunks/reporters.DbwOGCsU.js';
1
+ import * as vite from 'vite';
2
+ import { B as BaseCoverageOptions, R as ResolvedCoverageOptions, V as Vitest } from './chunks/reporters.WnPwkmgA.js';
2
3
  import '@vitest/runner';
3
- import 'vite';
4
4
  import '@vitest/pretty-format';
5
5
  import './chunks/config.CHuotKvS.js';
6
6
  import '@vitest/snapshot';
7
7
  import '@vitest/snapshot/environment';
8
8
  import 'vite-node';
9
- import './chunks/environment.0M5R1SX_.js';
9
+ import './chunks/environment.C5eAp3K6.js';
10
10
  import 'node:stream';
11
11
  import 'vite-node/client';
12
12
  import '@vitest/snapshot/manager';
@@ -164,6 +164,7 @@ declare class BaseCoverageProvider {
164
164
  resolveReporters(configReporters: NonNullable<BaseCoverageOptions['reporter']>): ResolvedCoverageOptions['reporter'];
165
165
  hasTerminalReporter(reporters: ResolvedCoverageOptions['reporter']): boolean;
166
166
  toSlices<T>(array: T[], size: number): T[][];
167
+ createUncoveredFileTransformer(ctx: Vitest): (filename: string) => Promise<vite.TransformResult | null | undefined>;
167
168
  }
168
169
 
169
170
  export { BaseCoverageProvider };
package/dist/coverage.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { relative } from 'pathe';
2
- import { m as mm, b as resolveCoverageReporters } from './chunks/resolveConfig.RHsAM2_Q.js';
2
+ import { m as mm, r as resolveCoverageReporters } from './chunks/resolveConfig.-K5hHm0S.js';
3
3
  import 'node:path';
4
4
  import 'node:fs';
5
5
  import 'node:fs/promises';
@@ -10,18 +10,18 @@ import 'node:assert';
10
10
  import 'node:v8';
11
11
  import 'node:util';
12
12
  import 'tinyrainbow';
13
- import './chunks/constants.CaAN7icJ.js';
13
+ import './chunks/constants.fzPh7AOq.js';
14
14
  import 'node:os';
15
15
  import './chunks/env.CmHVDJnw.js';
16
16
  import 'std-env';
17
17
  import '@vitest/runner/utils';
18
- import './chunks/base.BH-FAiX7.js';
18
+ import './chunks/base.BlXpj3e_.js';
19
19
  import '@vitest/utils';
20
20
  import 'node:crypto';
21
- import './chunks/RandomSequencer.B4M2ux5b.js';
21
+ import './chunks/RandomSequencer.Bh5-tlNJ.js';
22
22
  import 'node:perf_hooks';
23
- import 'execa';
24
23
  import '@vitest/utils/source-map';
24
+ import 'tinyexec';
25
25
  import 'path';
26
26
  import 'fs';
27
27
  import 'module';
@@ -212,6 +212,30 @@ class BaseCoverageProvider {
212
212
  return chunks;
213
213
  }, []);
214
214
  }
215
+ createUncoveredFileTransformer(ctx) {
216
+ const servers = [
217
+ ...ctx.projects.map((project) => ({
218
+ root: project.config.root,
219
+ vitenode: project.vitenode
220
+ })),
221
+ // Check core last as it will match all files anyway
222
+ { root: ctx.config.root, vitenode: ctx.vitenode }
223
+ ];
224
+ return async function transformFile(filename) {
225
+ let lastError;
226
+ for (const { root, vitenode } of servers) {
227
+ if (!filename.startsWith(root)) {
228
+ continue;
229
+ }
230
+ try {
231
+ return await vitenode.transformRequest(filename);
232
+ } catch (error) {
233
+ lastError = error;
234
+ }
235
+ }
236
+ throw lastError;
237
+ };
238
+ }
215
239
  }
216
240
  function resolveGlobThresholds(thresholds) {
217
241
  if (!thresholds || typeof thresholds !== "object") {
@@ -1,5 +1,5 @@
1
- import { E as Environment } from './chunks/environment.0M5R1SX_.js';
2
- export { a as EnvironmentReturn, V as VmEnvironmentReturn } from './chunks/environment.0M5R1SX_.js';
1
+ import { E as Environment } from './chunks/environment.C5eAp3K6.js';
2
+ export { a as EnvironmentReturn, V as VmEnvironmentReturn } from './chunks/environment.C5eAp3K6.js';
3
3
 
4
4
  declare const environments: {
5
5
  node: Environment;
package/dist/execute.d.ts CHANGED
@@ -1,15 +1,17 @@
1
1
  import vm from 'node:vm';
2
2
  import { ViteNodeRunner } from 'vite-node/client';
3
3
  import { ViteNodeRunnerOptions } from 'vite-node';
4
- import { P as PendingSuiteMock, f as MockFactory, R as RuntimeRPC, W as WorkerGlobalState, g as MockMap } from './chunks/worker.BANO5ak1.js';
4
+ import { R as RuntimeRPC, W as WorkerGlobalState } from './chunks/worker.CmPmTxgH.js';
5
+ import * as _vitest_mocker from '@vitest/mocker';
6
+ import { MockedModuleType } from '@vitest/mocker';
7
+ import { P as PendingSuiteMock, b as MockFactory, a as MockOptions } from './chunks/mocker.cRtM890J.js';
5
8
  import '@vitest/runner';
6
9
  import './chunks/config.CHuotKvS.js';
7
10
  import '@vitest/pretty-format';
8
11
  import '@vitest/snapshot';
9
12
  import '@vitest/snapshot/environment';
10
- import './chunks/environment.0M5R1SX_.js';
13
+ import './chunks/environment.C5eAp3K6.js';
11
14
 
12
- type Key = string | symbol;
13
15
  interface MockContext {
14
16
  /**
15
17
  * When mocking with a factory, this refers to the module that imported the mock.
@@ -20,39 +22,37 @@ declare class VitestMocker {
20
22
  executor: VitestExecutor;
21
23
  static pendingIds: PendingSuiteMock[];
22
24
  private spyModule?;
23
- private resolveCache;
24
25
  private primitives;
25
26
  private filterPublicKeys;
27
+ private registries;
26
28
  private mockContext;
27
29
  constructor(executor: VitestExecutor);
28
30
  private get root();
29
- private get mockMap();
30
31
  private get moduleCache();
31
32
  private get moduleDirectories();
32
33
  initializeSpyModule(): Promise<void>;
34
+ private getMockerRegistry;
35
+ reset(): void;
33
36
  private deleteCachedItem;
34
37
  private isModuleDirectory;
35
38
  getSuiteFilepath(): string;
36
39
  private createError;
37
- getMocks(): {
38
- [x: string]: string | MockFactory | null;
39
- };
40
40
  private resolvePath;
41
41
  resolveMocks(): Promise<void>;
42
42
  private callFunctionMock;
43
43
  getMockContext(): MockContext;
44
44
  getMockPath(dep: string): string;
45
- getDependencyMock(id: string): string | MockFactory | null;
45
+ getDependencyMock(id: string): _vitest_mocker.MockedModule | undefined;
46
46
  normalizePath(path: string): string;
47
47
  resolveMockPath(mockPath: string, external: string | null): string | null;
48
- mockObject(object: Record<Key, any>, mockExports?: Record<Key, any>): Record<Key, any>;
48
+ mockObject(object: Record<string | symbol, any>, mockExports?: Record<string | symbol, any>, behavior?: MockedModuleType): Record<string | symbol, any>;
49
49
  unmockPath(path: string): void;
50
- mockPath(originalId: string, path: string, external: string | null, factory: MockFactory | undefined): void;
50
+ mockPath(originalId: string, path: string, external: string | null, mockType: MockedModuleType | undefined, factory: MockFactory | undefined): void;
51
51
  importActual<T>(rawId: string, importer: string, callstack?: string[] | null): Promise<T>;
52
52
  importMock(rawId: string, importee: string): Promise<any>;
53
53
  requestWithMock(url: string, callstack: string[]): Promise<any>;
54
- queueMock(id: string, importer: string, factory?: MockFactory, throwIfCached?: boolean): void;
55
- queueUnmock(id: string, importer: string, throwIfCached?: boolean): void;
54
+ queueMock(id: string, importer: string, factoryOrOptions?: MockFactory | MockOptions): void;
55
+ queueUnmock(id: string, importer: string): void;
56
56
  }
57
57
 
58
58
  interface ModuleEvaluateOptions {
@@ -115,7 +115,6 @@ declare class ExternalModulesExecutor {
115
115
  }
116
116
 
117
117
  interface ExecuteOptions extends ViteNodeRunnerOptions {
118
- mockMap: MockMap;
119
118
  moduleDirectories?: string[];
120
119
  state: WorkerGlobalState;
121
120
  context?: vm.Context;
package/dist/execute.js CHANGED
@@ -1,4 +1,4 @@
1
- export { V as VitestExecutor } from './chunks/execute.DT9BA6zp.js';
1
+ export { V as VitestExecutor } from './chunks/execute._eQQfgI8.js';
2
2
  import 'node:vm';
3
3
  import 'node:url';
4
4
  import 'node:fs';
@@ -8,4 +8,5 @@ import 'pathe';
8
8
  import '@vitest/utils/error';
9
9
  import './path.js';
10
10
  import '@vitest/utils';
11
- import './chunks/base.BH-FAiX7.js';
11
+ import '@vitest/mocker';
12
+ import 'node:module';
package/dist/index.d.ts CHANGED
@@ -1,23 +1,25 @@
1
- import { V as VitestEnvironment$1, S as SerializedSpec, b as RawErrsMap$1, T as TscErrorInfo$1, c as CollectLineNumbers$1, d as CollectLines$1, e as RootAndTarget$1, f as Context$1, C as CoverageProvider$1, g as ReportContext$1, a 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, l as CoverageV8Options$1, m as CustomProviderOptions$1, n as Reporter$1, o as Vitest$1, p as BrowserScript$1, q as BrowserConfigOptions$1, r as BuiltinEnvironment$1, P as Pool$1, s as PoolOptions$1, t as CSSModuleScopeStrategy$1, A as ApiConfig$1, u as VitestRunMode$1, D as DepsOptimizationOptions$1, v as TransformModePatterns$1, I as InlineConfig$1, w as TypecheckConfig$1, U as UserConfig$1, x as ResolvedConfig$1, y as ProjectConfig$1, z as UserWorkspaceConfig$1, E as BenchmarkUserOptions$1 } from './chunks/reporters.DbwOGCsU.js';
1
+ import './chunks/vite.D2yAwzwa.js';
2
2
  import { Plugin } from '@vitest/pretty-format';
3
3
  import { SnapshotState } from '@vitest/snapshot';
4
4
  export { SnapshotData, SnapshotMatchOptions, SnapshotResult, SnapshotSerializer, SnapshotStateOptions, SnapshotSummary, SnapshotUpdateState, UncheckedSnapshot } from '@vitest/snapshot';
5
5
  import { PromisifyAssertion, Tester, ExpectStatic } from '@vitest/expect';
6
6
  export { Assertion, AsymmetricMatchersContaining, ExpectPollOptions, ExpectStatic, JestAssertion } from '@vitest/expect';
7
+ import { e as VitestEnvironment$1, S as SerializedTestSpecification, f as RawErrsMap$1, T as TscErrorInfo$1, g as CollectLineNumbers$1, h as CollectLines$1, i as RootAndTarget$1, j as Context$1, C as CoverageProvider$1, k as ReportContext$1, a as CoverageProviderModule$1, l as CoverageReporter$1, m as CoverageProviderName, n as CoverageOptions$1, R as ResolvedCoverageOptions$1, B as BaseCoverageOptions$1, o as CoverageIstanbulOptions$1, b as CoverageV8Options$1, p as CustomProviderOptions$1, q as Reporter$1, V as Vitest$1, r as BrowserScript$1, s as BrowserConfigOptions$1, t as BuiltinEnvironment$1, P as Pool$1, u as PoolOptions$1, v as CSSModuleScopeStrategy$1, A as ApiConfig$1, w as VitestRunMode$1, D as DepsOptimizationOptions$1, x as TransformModePatterns$1, I as InlineConfig$1, y as TypecheckConfig$1, z as UserConfig$1, E as ResolvedConfig$1, F as ProjectConfig$1, U as UserWorkspaceConfig$1, G as BenchmarkUserOptions$1 } from './chunks/reporters.WnPwkmgA.js';
7
8
  import { B as BenchmarkResult } from './chunks/benchmark.puBFxyfE.js';
8
9
  export { b as BenchFunction, a as Benchmark, c as BenchmarkAPI } from './chunks/benchmark.puBFxyfE.js';
9
- import { U as UserConsoleLog, P as ProvidedContext, M as ModuleGraphData, b as Awaitable$1, N as Nullable$1, c as Arrayable$1, d as ArgumentsType$1, e as MutableArray$1, C as Constructable$1, O as OnServerRestartHandler$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.0M5R1SX_.js';
10
- export { A as AfterSuiteRunMeta, g as ModuleCache } from './chunks/environment.0M5R1SX_.js';
10
+ import { U as UserConsoleLog, P as ProvidedContext, M as ModuleGraphData, b as Awaitable$1, N as Nullable$1, c as Arrayable$1, d as ArgumentsType$1, e as MutableArray$1, C as Constructable$1, O as OnServerRestartHandler$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.C5eAp3K6.js';
11
+ export { A as AfterSuiteRunMeta, g as ModuleCache } from './chunks/environment.C5eAp3K6.js';
11
12
  import { TaskPopulated, TaskResultPack, File as File$1, Suite as Suite$1, Test as Test$1, Custom as Custom$1, Task as Task$1, SequenceHooks as SequenceHooks$1, SequenceSetupFiles as SequenceSetupFiles$1 } from '@vitest/runner';
12
13
  export { CancelReason, DoneCallback, ExtendedContext, HookCleanupCallback, HookListener, OnTestFailedHandler, RunMode, Custom as RunnerCustomCase, Task as RunnerTask, Test as RunnerTestCase, File as RunnerTestFile, Suite as RunnerTestSuite, RuntimeContext, SuiteAPI, SuiteCollector, SuiteFactory, SuiteHooks, TaskBase, TaskContext, TaskCustomOptions, TaskMeta, TaskResult, TaskResultPack, TaskState, TestAPI, TestContext, TestFunction, TestOptions, afterAll, afterEach, beforeAll, beforeEach, describe, it, onTestFailed, onTestFinished, suite, test } from '@vitest/runner';
13
14
  export { b as bench } from './chunks/suite.CcK46U-P.js';
14
15
  import { F as FakeTimerInstallOpts, R as RuntimeOptions, S as SerializedConfig } from './chunks/config.CHuotKvS.js';
15
16
  export { b as RuntimeConfig, a as SerializedCoverageConfig } from './chunks/config.CHuotKvS.js';
16
- import { M as MockFactoryWithHelper, a as BirpcReturn } from './chunks/worker.BANO5ak1.js';
17
- export { C as ContextRPC, e as ContextTestEnvironment, c as ResolveIdFunction, b as RunnerRPC, R as RuntimeRPC, W as WorkerGlobalState, d as WorkerRPC } from './chunks/worker.BANO5ak1.js';
17
+ import { M as MockFactoryWithHelper, a as MockOptions } from './chunks/mocker.cRtM890J.js';
18
18
  import { spyOn, fn, MaybeMockedDeep, MaybeMocked, MaybePartiallyMocked, MaybePartiallyMockedDeep, MockInstance } from '@vitest/spy';
19
19
  export { Mock, MockContext, MockInstance, Mocked, MockedClass, MockedFunction, MockedObject } from '@vitest/spy';
20
- export { W as WorkerContext } from './chunks/worker.Cx2xE71X.js';
20
+ import { a as BirpcReturn } from './chunks/worker.CmPmTxgH.js';
21
+ export { C as ContextRPC, e as ContextTestEnvironment, c as ResolveIdFunction, b as RunnerRPC, R as RuntimeRPC, W as WorkerGlobalState, d as WorkerRPC } from './chunks/worker.CmPmTxgH.js';
22
+ export { W as WorkerContext } from './chunks/worker.Bws9Zuxu.js';
21
23
  export { ErrorWithDiff, ParsedStack, SerializedError, TestError } from '@vitest/utils';
22
24
  export { DiffOptions } from '@vitest/utils/diff';
23
25
  import * as chai from 'chai';
@@ -34,6 +36,7 @@ import '@vitest/utils/source-map';
34
36
  import 'node:fs';
35
37
  import '@vitest/runner/utils';
36
38
  import '@vitest/snapshot/environment';
39
+ import '@vitest/mocker';
37
40
  import 'node:worker_threads';
38
41
 
39
42
  declare global {
@@ -1233,6 +1236,10 @@ interface VitestUtils {
1233
1236
  * Will call next available timer and wait until it's resolved if it was set asynchronously. Useful to make assertions between each timer call.
1234
1237
  */
1235
1238
  advanceTimersToNextTimerAsync: () => Promise<VitestUtils>;
1239
+ /**
1240
+ * Similar to [`vi.advanceTimersByTime`](https://vitest.dev/api/vi#vi-advancetimersbytime), but will advance timers by the milliseconds needed to execute callbacks currently scheduled with `requestAnimationFrame`.
1241
+ */
1242
+ advanceTimersToNextFrame: () => VitestUtils;
1236
1243
  /**
1237
1244
  * Get the number of waiting timers.
1238
1245
  */
@@ -1348,8 +1355,8 @@ interface VitestUtils {
1348
1355
  * @param path Path to the module. Can be aliased, if your Vitest config supports it
1349
1356
  * @param factory Mocked module factory. The result of this function will be an exports object
1350
1357
  */
1351
- mock(path: string, factory?: MockFactoryWithHelper): void;
1352
- mock<T>(module: Promise<T>, factory?: MockFactoryWithHelper<T>): void;
1358
+ mock(path: string, factory?: MockFactoryWithHelper | MockOptions): void;
1359
+ mock<T>(module: Promise<T>, factory?: MockFactoryWithHelper<T> | MockOptions): void;
1353
1360
  /**
1354
1361
  * Removes module from mocked registry. All calls to import will return the original module even if it was mocked before.
1355
1362
  *
@@ -1367,8 +1374,8 @@ interface VitestUtils {
1367
1374
  * @param path Path to the module. Can be aliased, if your Vitest config supports it
1368
1375
  * @param factory Mocked module factory. The result of this function will be an exports object
1369
1376
  */
1370
- doMock(path: string, factory?: MockFactoryWithHelper): void;
1371
- doMock<T>(module: Promise<T>, factory?: MockFactoryWithHelper<T>): void;
1377
+ doMock(path: string, factory?: MockFactoryWithHelper | MockOptions): void;
1378
+ doMock<T>(module: Promise<T>, factory?: MockFactoryWithHelper<T> | MockOptions): void;
1372
1379
  /**
1373
1380
  * Removes module from mocked registry. All subsequent calls to import will return original module.
1374
1381
  *
@@ -1467,7 +1474,7 @@ interface VitestUtils {
1467
1474
  * Changes the value of `import.meta.env` and `process.env`.
1468
1475
  * You can return it back to original value with `vi.unstubAllEnvs`, or by enabling `unstubEnvs` config option.
1469
1476
  */
1470
- stubEnv: <T extends string>(name: T, value: T extends 'PROD' | 'DEV' | 'SSR' ? boolean : string) => VitestUtils;
1477
+ stubEnv: <T extends string>(name: T, value: T extends 'PROD' | 'DEV' | 'SSR' ? boolean : string | undefined) => VitestUtils;
1471
1478
  /**
1472
1479
  * Reset the value to original value that was available before first `vi.stubGlobal` was called.
1473
1480
  */
@@ -1538,7 +1545,7 @@ interface TransformResultWithSource {
1538
1545
  interface WebSocketHandlers {
1539
1546
  onTaskUpdate: (packs: TaskResultPack[]) => void;
1540
1547
  getFiles: () => File$1[];
1541
- getTestFiles: () => Promise<SerializedSpec[]>;
1548
+ getTestFiles: () => Promise<SerializedTestSpecification[]>;
1542
1549
  getPaths: () => string[];
1543
1550
  getConfig: () => SerializedConfig;
1544
1551
  getModuleGraph: (projectName: string, id: string, browser?: boolean) => Promise<ModuleGraphData>;
@@ -1555,7 +1562,7 @@ interface WebSocketEvents {
1555
1562
  onTaskUpdate?: (packs: TaskResultPack[]) => Awaitable$1<void>;
1556
1563
  onUserConsoleLog?: (log: UserConsoleLog) => Awaitable$1<void>;
1557
1564
  onPathsCollected?: (paths?: string[]) => Awaitable$1<void>;
1558
- onSpecsCollected?: (specs?: SerializedSpec[]) => Awaitable$1<void>;
1565
+ onSpecsCollected?: (specs?: SerializedTestSpecification[]) => Awaitable$1<void>;
1559
1566
  onFinishedReportCoverage: () => void;
1560
1567
  }
1561
1568
  type WebSocketRPC = BirpcReturn<WebSocketEvents, WebSocketHandlers>;
@@ -1677,10 +1684,10 @@ type ProjectConfig = ProjectConfig$1;
1677
1684
  /** @deprecated import from `vitest/node` instead */
1678
1685
  type UserWorkspaceConfig = UserWorkspaceConfig$1;
1679
1686
 
1680
- /** @deprecated use `SerializedSpec` instead */
1681
- type SerializableSpec = SerializedSpec;
1687
+ /** @deprecated use `SerializedTestSpecification` instead */
1688
+ type SerializableSpec = SerializedTestSpecification;
1682
1689
 
1683
1690
  /** @deprecated import from `vitest/node` instead */
1684
1691
  type BenchmarkUserOptions = BenchmarkUserOptions$1;
1685
1692
 
1686
- export { type ApiConfig, type ArgumentsType, type Arrayable, type AssertType, type Awaitable, type BaseCoverageOptions, BenchmarkResult, type BenchmarkUserOptions, type BrowserConfigOptions, type BrowserScript, type BrowserUI, type BuiltinEnvironment, type CSSModuleScopeStrategy, type CollectLineNumbers, type CollectLines, type Constructable, type Context, type CoverageIstanbulOptions, type CoverageOptions, type CoverageProvider, type CoverageProviderModule, type CoverageReporter, type CoverageV8Options, type Custom, type CustomProviderOptions, type DepsOptimizationOptions, type Environment, type EnvironmentOptions, type EnvironmentReturn, type ExpectTypeOf, type File, type HappyDOMOptions, type InlineConfig, type JSDOMOptions, ModuleGraphData, type MutableArray, type Nullable, type OnServerRestartHandler, type Pool, type PoolOptions, type ProjectConfig, ProvidedContext, type RawErrsMap, type ReportContext, type Reporter, type ResolvedConfig, type ResolvedCoverageOptions, type ResolvedTestEnvironment, type RootAndTarget, type SequenceHooks, type SequenceSetupFiles, type SerializableSpec, SerializedConfig, SerializedSpec, type Suite, type Task, type Test, type TransformModePatterns, type TransformResultWithSource, type TscErrorInfo, type TypecheckConfig, type UserConfig, UserConsoleLog, type UserWorkspaceConfig, type Vitest, type VitestEnvironment, type VitestRunMode, type VitestUtils, type VmEnvironmentReturn, type WebSocketEvents, type WebSocketHandlers, type WebSocketRPC, assertType, createExpect, globalExpect as expect, expectTypeOf, getRunningMode, inject, isFirstRun, isWatchMode, runOnce, vi, vitest };
1693
+ export { type ApiConfig, type ArgumentsType, type Arrayable, type AssertType, type Awaitable, type BaseCoverageOptions, BenchmarkResult, type BenchmarkUserOptions, type BrowserConfigOptions, type BrowserScript, type BrowserUI, type BuiltinEnvironment, type CSSModuleScopeStrategy, type CollectLineNumbers, type CollectLines, type Constructable, type Context, type CoverageIstanbulOptions, type CoverageOptions, type CoverageProvider, type CoverageProviderModule, type CoverageReporter, type CoverageV8Options, type Custom, type CustomProviderOptions, type DepsOptimizationOptions, type Environment, type EnvironmentOptions, type EnvironmentReturn, type ExpectTypeOf, type File, type HappyDOMOptions, type InlineConfig, type JSDOMOptions, ModuleGraphData, type MutableArray, type Nullable, type OnServerRestartHandler, type Pool, type PoolOptions, type ProjectConfig, ProvidedContext, type RawErrsMap, type ReportContext, type Reporter, type ResolvedConfig, type ResolvedCoverageOptions, type ResolvedTestEnvironment, type RootAndTarget, type SequenceHooks, type SequenceSetupFiles, type SerializableSpec, SerializedConfig, SerializedTestSpecification, type Suite, type Task, type Test, type TransformModePatterns, type TransformResultWithSource, type TscErrorInfo, type TypecheckConfig, type UserConfig, UserConsoleLog, type UserWorkspaceConfig, type Vitest, type VitestEnvironment, type VitestRunMode, type VitestUtils, type VmEnvironmentReturn, type WebSocketEvents, type WebSocketHandlers, type WebSocketRPC, assertType, createExpect, globalExpect as expect, expectTypeOf, getRunningMode, inject, isFirstRun, isWatchMode, runOnce, vi, vitest };
package/dist/index.js CHANGED
@@ -1,9 +1,9 @@
1
1
  export { afterAll, afterEach, beforeAll, beforeEach, describe, it, onTestFailed, onTestFinished, suite, test } from '@vitest/runner';
2
2
  export { b as bench } from './chunks/benchmark.C8CRJYG4.js';
3
- import { d as dist } from './chunks/index.CNZXZ9PJ.js';
4
- export { a as assertType, g as getRunningMode, b as inject, i as isWatchMode } from './chunks/index.CNZXZ9PJ.js';
3
+ import { d as dist } from './chunks/index.xm8OIiKD.js';
4
+ export { a as assertType, g as getRunningMode, b as inject, i as isWatchMode } from './chunks/index.xm8OIiKD.js';
5
5
  export { i as isFirstRun, a as runOnce } from './chunks/run-once.Sxe67Wng.js';
6
- export { c as createExpect, a as expect, v as vi, b as vitest } from './chunks/vi.B6QZ938s.js';
6
+ export { c as createExpect, a as expect, v as vi, b as vitest } from './chunks/vi.DGgiNzJE.js';
7
7
  import * as chai from 'chai';
8
8
  export { chai };
9
9
  export { assert, should } from 'chai';
@@ -20,7 +20,7 @@ import '@vitest/snapshot';
20
20
  import '@vitest/utils/error';
21
21
  import './chunks/tasks.BZnCS9aT.js';
22
22
  import '@vitest/utils/source-map';
23
- import './chunks/base.BH-FAiX7.js';
23
+ import './chunks/base.BlXpj3e_.js';
24
24
  import './chunks/date.W2xKR2qe.js';
25
25
  import '@vitest/spy';
26
26
 
@@ -0,0 +1 @@
1
+ export * from '@vitest/mocker';
package/dist/mocker.js ADDED
@@ -0,0 +1 @@
1
+ export * from '@vitest/mocker';
package/dist/node.d.ts CHANGED
@@ -1,15 +1,15 @@
1
- import { u as VitestRunMode, U as UserConfig, F as VitestOptions, o as Vitest, x as ResolvedConfig, W as WorkspaceProject, A as ApiConfig, L as Logger, G as TestSequencer, H as WorkspaceSpec } from './chunks/reporters.DbwOGCsU.js';
2
- export { B as BaseCoverageOptions, E as BenchmarkUserOptions, $ as BrowserBuiltinProvider, a0 as BrowserCommand, a1 as BrowserCommandContext, q as BrowserConfigOptions, a5 as BrowserOrchestrator, Q as BrowserProvider, O as BrowserProviderInitializationOptions, Y as BrowserProviderModule, _ as BrowserProviderOptions, p as BrowserScript, a2 as BrowserServer, a3 as BrowserServerState, a4 as BrowserServerStateContext, r as BuiltinEnvironment, X as CDPSession, t as CSSModuleScopeStrategy, k as CoverageIstanbulOptions, j as CoverageOptions, C as CoverageProvider, a as CoverageProviderModule, h as CoverageReporter, l as CoverageV8Options, m as CustomProviderOptions, D as DepsOptimizationOptions, ag as FileDiagnostic, a8 as HTMLOptions, I as InlineConfig, a7 as JUnitOptions, a6 as JsonOptions, P as Pool, s as PoolOptions, J as ProcessPool, y as ProjectConfig, g as ReportContext, Z as ResolvedBrowserOptions, R as ResolvedCoverageOptions, al as ResolvedProjectConfig, ae as TaskOptions, a9 as TestCase, ad as TestCollection, af as TestDiagnostic, aa as TestFile, ac as TestProject, ah as TestResult, aj as TestResultFailed, ai as TestResultPassed, ak as TestResultSkipped, N as TestSequencerConstructor, ab as TestSuite, v as TransformModePatterns, c as TypeCheckCollectLineNumbers, d as TypeCheckCollectLines, f as TypeCheckContext, T as TypeCheckErrorInfo, b as TypeCheckRawErrorsMap, e as TypeCheckRootAndTarget, w as TypecheckConfig, z as UserWorkspaceConfig, V as VitestEnvironment, M as VitestPackageInstaller, K as getFilePoolName } from './chunks/reporters.DbwOGCsU.js';
3
- import { UserConfig as UserConfig$1, Plugin, ResolvedConfig as ResolvedConfig$1 } from 'vite';
1
+ import { UserConfig as UserConfig$1, Plugin, ResolvedConfig as ResolvedConfig$1, createServer as createServer$1 } from 'vite';
4
2
  import * as vite from 'vite';
5
3
  export { vite as Vite };
6
- export { createServer, isFileServingAllowed, parseAst, parseAstAsync } from 'vite';
4
+ export { createLogger as createViteLogger, isFileServingAllowed, parseAst, parseAstAsync } from 'vite';
5
+ import { w as VitestRunMode, z as UserConfig, H as VitestOptions, V as Vitest, E as ResolvedConfig, J as WorkspaceProject, A as ApiConfig, L as Logger, K as TestSequencer, M as WorkspaceSpec, N as TestModule, O as ModuleDiagnostic } from './chunks/reporters.WnPwkmgA.js';
6
+ export { B as BaseCoverageOptions, G as BenchmarkUserOptions, a5 as BrowserBuiltinProvider, a6 as BrowserCommand, a7 as BrowserCommandContext, s as BrowserConfigOptions, ab as BrowserOrchestrator, a0 as BrowserProvider, $ as BrowserProviderInitializationOptions, a2 as BrowserProviderModule, a4 as BrowserProviderOptions, r as BrowserScript, a8 as BrowserServer, a9 as BrowserServerState, aa as BrowserServerStateContext, t as BuiltinEnvironment, a1 as CDPSession, v as CSSModuleScopeStrategy, o as CoverageIstanbulOptions, n as CoverageOptions, C as CoverageProvider, a as CoverageProviderModule, l as CoverageReporter, b as CoverageV8Options, p as CustomProviderOptions, D as DepsOptimizationOptions, ae as HTMLOptions, I as InlineConfig, ad as JUnitOptions, ac as JsonOptions, P as Pool, u as PoolOptions, Q as ProcessPool, F as ProjectConfig, k as ReportContext, a3 as ResolvedBrowserOptions, R as ResolvedCoverageOptions, ap as ResolvedProjectConfig, aj as TaskOptions, af as TestCase, ai as TestCollection, ak as TestDiagnostic, ah as TestProject, al as TestResult, an as TestResultFailed, am as TestResultPassed, ao as TestResultSkipped, _ as TestSequencerConstructor, Z as TestSpecification, ag as TestSuite, x as TransformModePatterns, g as TypeCheckCollectLineNumbers, h as TypeCheckCollectLines, j as TypeCheckContext, T as TypeCheckErrorInfo, f as TypeCheckRawErrorsMap, i as TypeCheckRootAndTarget, y as TypecheckConfig, U as UserWorkspaceConfig, e as VitestEnvironment, Y as VitestPackageInstaller, X as getFilePoolName } from './chunks/reporters.WnPwkmgA.js';
7
7
  import { Writable } from 'node:stream';
8
- import { P as ProvidedContext } from './chunks/environment.0M5R1SX_.js';
9
- export { f as EnvironmentOptions, H as HappyDOMOptions, J as JSDOMOptions, O as OnServerRestartHandler } from './chunks/environment.0M5R1SX_.js';
10
- import { R as RuntimeRPC } from './chunks/worker.BANO5ak1.js';
8
+ import { P as ProvidedContext } from './chunks/environment.C5eAp3K6.js';
9
+ export { f as EnvironmentOptions, H as HappyDOMOptions, J as JSDOMOptions, O as OnServerRestartHandler } from './chunks/environment.C5eAp3K6.js';
10
+ import { R as RuntimeRPC } from './chunks/worker.CmPmTxgH.js';
11
11
  import createDebug from 'debug';
12
- export { W as WorkerContext } from './chunks/worker.Cx2xE71X.js';
12
+ export { W as WorkerContext } from './chunks/worker.Bws9Zuxu.js';
13
13
  export { SequenceHooks, SequenceSetupFiles } from '@vitest/runner';
14
14
  export { b as RuntimeConfig } from './chunks/config.CHuotKvS.js';
15
15
  import '@vitest/pretty-format';
@@ -45,6 +45,10 @@ interface CliOptions extends UserConfig {
45
45
  * Output collected tests as JSON or to a file
46
46
  */
47
47
  json?: string | boolean;
48
+ /**
49
+ * Output collected test files only
50
+ */
51
+ filesOnly?: boolean;
48
52
  }
49
53
  /**
50
54
  * Start Vitest programmatically
@@ -99,4 +103,18 @@ declare class BaseSequencer implements TestSequencer {
99
103
  sort(files: WorkspaceSpec[]): Promise<WorkspaceSpec[]>;
100
104
  }
101
105
 
102
- export { ApiConfig, BaseSequencer, GitNotFoundError, type GlobalSetupContext, ResolvedConfig, TestSequencer, FilesNotFoundError as TestsNotFoundError, UserConfig, Vitest, VitestPlugin, VitestRunMode, WorkspaceProject, WorkspaceSpec, createDebugger, createMethodsRPC, createVitest, distDir, parseCLI, registerConsoleShortcuts, resolveApiServerConfig, resolveConfig, resolveFsAllow, rootDir, startVitest };
106
+ /** @deprecated use `createViteServer` instead */
107
+ declare const createServer: typeof createServer$1;
108
+ declare const createViteServer: typeof createServer$1;
109
+
110
+ /**
111
+ * @deprecated Use `TestModule` instead
112
+ */
113
+ declare const TestFile: typeof TestModule;
114
+
115
+ /**
116
+ * @deprecated Use `ModuleDiagnostic` instead
117
+ */
118
+ type FileDiagnostic = ModuleDiagnostic;
119
+
120
+ export { ApiConfig, BaseSequencer, type FileDiagnostic, GitNotFoundError, type GlobalSetupContext, ModuleDiagnostic, ResolvedConfig, TestFile, TestModule, TestSequencer, FilesNotFoundError as TestsNotFoundError, UserConfig, Vitest, VitestPlugin, VitestRunMode, WorkspaceProject, WorkspaceSpec, createDebugger, createMethodsRPC, createServer, createViteServer, createVitest, distDir, parseCLI, registerConsoleShortcuts, resolveApiServerConfig, resolveConfig, resolveFsAllow, rootDir, startVitest };
package/dist/node.js CHANGED
@@ -1,37 +1,47 @@
1
- export { G as GitNotFoundError, F as TestsNotFoundError, a as VitestPackageInstaller, V as VitestPlugin, c as createVitest, r as registerConsoleShortcuts, b as resolveFsAllow, s as startVitest } from './chunks/cli-api.D8zgNrBU.js';
2
- export { p as parseCLI } from './chunks/cac.DosbLiJg.js';
3
- export { c as createMethodsRPC, g as getFilePoolName, r as resolveApiServerConfig, a as resolveConfig } from './chunks/resolveConfig.RHsAM2_Q.js';
1
+ import { createServer as createServer$1 } from 'vite';
2
+ export { createLogger as createViteLogger, isFileServingAllowed, parseAst, parseAstAsync } from 'vite';
3
+ import { f as TestModule } from './chunks/index.DpJO1tkB.js';
4
+ export { e as TestCase, i as TestProject, g as TestSuite } from './chunks/index.DpJO1tkB.js';
5
+ export { G as GitNotFoundError, T as TestSpecification, F as TestsNotFoundError, a as VitestPackageInstaller, V as VitestPlugin, c as createVitest, r as registerConsoleShortcuts, b as resolveFsAllow, s as startVitest } from './chunks/cli-api.ByZPnilx.js';
6
+ export { p as parseCLI } from './chunks/cac.B5XYKv2_.js';
7
+ export { c as createMethodsRPC, g as getFilePoolName, a as resolveApiServerConfig, b as resolveConfig } from './chunks/resolveConfig.-K5hHm0S.js';
4
8
  import createDebug from 'debug';
5
9
  export { distDir, rootDir } from './path.js';
6
- export { B as BaseSequencer } from './chunks/RandomSequencer.B4M2ux5b.js';
7
- export { createServer, isFileServingAllowed, parseAst, parseAstAsync } from 'vite';
8
- export { d as TestCase, e as TestFile, h as TestProject, f as TestSuite } from './chunks/index.Dx3f477d.js';
10
+ export { B as BaseSequencer } from './chunks/RandomSequencer.Bh5-tlNJ.js';
9
11
  import 'node:fs';
12
+ import 'tinyrainbow';
10
13
  import 'pathe';
11
- import './chunks/coverage.CqfT4xaf.js';
12
- import './chunks/index.CM5UI-4O.js';
13
- import 'node:path';
14
- import 'node:url';
14
+ import './chunks/tasks.BZnCS9aT.js';
15
+ import '@vitest/runner/utils';
16
+ import '@vitest/utils';
17
+ import './chunks/env.CmHVDJnw.js';
18
+ import 'std-env';
19
+ import './chunks/utils.Dbnmsfq1.js';
20
+ import './chunks/base.BlXpj3e_.js';
21
+ import 'node:perf_hooks';
22
+ import '@vitest/utils/source-map';
23
+ import './chunks/index.CxRxs566.js';
24
+ import './chunks/utils.Ck2hJTRs.js';
25
+ import 'node:os';
26
+ import 'node:stream';
27
+ import 'node:console';
15
28
  import 'node:process';
16
29
  import './chunks/_commonjsHelpers.BFTU3MAI.js';
17
- import 'readline';
30
+ import 'assert';
18
31
  import 'events';
19
- import './chunks/constants.CaAN7icJ.js';
20
- import 'node:worker_threads';
21
- import 'os';
22
- import 'path';
23
- import 'util';
24
- import 'stream';
25
- import 'fs';
32
+ import 'node:module';
33
+ import 'node:fs/promises';
34
+ import './chunks/coverage.zlNdAMHK.js';
35
+ import './chunks/index.Bn75ITYg.js';
36
+ import 'node:path';
37
+ import 'node:url';
38
+ import 'readline';
39
+ import './chunks/constants.fzPh7AOq.js';
26
40
  import 'vite-node/client';
27
41
  import '@vitest/snapshot/manager';
28
42
  import 'vite-node/server';
29
- import '@vitest/runner/utils';
30
- import './chunks/base.BH-FAiX7.js';
31
- import '@vitest/utils';
32
- import './chunks/env.CmHVDJnw.js';
33
- import 'std-env';
34
43
  import './chunks/index.BpSiYbpB.js';
44
+ import 'stream';
35
45
  import 'zlib';
36
46
  import 'buffer';
37
47
  import 'crypto';
@@ -40,31 +50,22 @@ import 'http';
40
50
  import 'net';
41
51
  import 'tls';
42
52
  import 'url';
43
- import '@vitest/utils/source-map';
44
- import 'node:os';
45
- import 'node:fs/promises';
53
+ import 'path';
54
+ import 'fs';
46
55
  import 'node:crypto';
47
56
  import 'vite-node/utils';
48
57
  import 'magic-string';
49
- import '@vitest/utils/ast';
50
- import 'node:module';
51
- import 'tinyrainbow';
52
- import './chunks/index.CxRxs566.js';
53
- import './chunks/utils.Ck2hJTRs.js';
58
+ import '@vitest/mocker/node';
59
+ import 'node:worker_threads';
54
60
  import 'node:readline';
55
- import './chunks/utils.DO38lwfj.js';
56
61
  import 'node:assert';
57
62
  import 'node:v8';
58
63
  import 'node:util';
64
+ import 'util';
59
65
  import 'node:events';
60
66
  import 'tinypool';
61
- import 'node:perf_hooks';
62
- import 'execa';
67
+ import 'tinyexec';
63
68
  import 'module';
64
- import './chunks/tasks.BZnCS9aT.js';
65
- import 'node:stream';
66
- import 'node:console';
67
- import 'assert';
68
69
 
69
70
  function createDebugger(namespace) {
70
71
  const debug = createDebug(namespace);
@@ -73,4 +74,8 @@ function createDebugger(namespace) {
73
74
  }
74
75
  }
75
76
 
76
- export { createDebugger };
77
+ const createServer = createServer$1;
78
+ const createViteServer = createServer$1;
79
+ const TestFile = TestModule;
80
+
81
+ export { TestFile, TestModule, createDebugger, createServer, createViteServer };
@@ -1,4 +1,4 @@
1
- export { aL as BaseReporter, aC as BasicReporter, aT as BenchmarkBuiltinReporters, aS as BenchmarkReportsMap, aO as BuiltinReporterOptions, aN as BuiltinReporters, aB as DefaultReporter, aD as DotReporter, ag as FileDiagnostic, aK as GithubActionsReporter, aJ as HangingProcessReporter, aH as JUnitReporter, aP as JsonAssertionResult, aE as JsonReporter, aQ as JsonTestResult, aR as JsonTestResults, n as Reporter, aM as ReportersMap, aI as TapFlatReporter, aG as TapReporter, ae as TaskOptions, a9 as TestCase, ad as TestCollection, af as TestDiagnostic, aa as TestFile, ac as TestProject, ah as TestResult, aj as TestResultFailed, ai as TestResultPassed, ak as TestResultSkipped, ab as TestSuite, aF as VerboseReporter } from './chunks/reporters.DbwOGCsU.js';
1
+ export { aA as BaseReporter, ar as BasicReporter, aK as BenchmarkBuiltinReporters, aJ as BenchmarkReportsMap, aF as BuiltinReporterOptions, aE as BuiltinReporters, aq as DefaultReporter, as as DotReporter, aC as FileDiagnostic, az as GithubActionsReporter, ay as HangingProcessReporter, aw as JUnitReporter, aG as JsonAssertionResult, at as JsonReporter, aH as JsonTestResult, aI as JsonTestResults, q as Reporter, aD as ReportersMap, ax as TapFlatReporter, av as TapReporter, aj as TaskOptions, af as TestCase, ai as TestCollection, ak as TestDiagnostic, aB as TestFile, N as TestModule, ah as TestProject, al as TestResult, an as TestResultFailed, am as TestResultPassed, ao as TestResultSkipped, ag as TestSuite, au as VerboseReporter } from './chunks/reporters.WnPwkmgA.js';
2
2
  import '@vitest/runner';
3
3
  import 'vite';
4
4
  import '@vitest/pretty-format';
@@ -6,7 +6,7 @@ import './chunks/config.CHuotKvS.js';
6
6
  import '@vitest/snapshot';
7
7
  import '@vitest/snapshot/environment';
8
8
  import 'vite-node';
9
- import './chunks/environment.0M5R1SX_.js';
9
+ import './chunks/environment.C5eAp3K6.js';
10
10
  import 'node:stream';
11
11
  import 'vite-node/client';
12
12
  import '@vitest/snapshot/manager';
package/dist/reporters.js CHANGED
@@ -1,21 +1,21 @@
1
- export { B as BasicReporter, g as BenchmarkReportsMap, D as DefaultReporter, a as DotReporter, G as GithubActionsReporter, H as HangingProcessReporter, b as JUnitReporter, J as JsonReporter, R as ReportersMap, c as TapFlatReporter, T as TapReporter, d as TestCase, e as TestFile, f as TestSuite, V as VerboseReporter } from './chunks/index.Dx3f477d.js';
2
- import './chunks/tasks.BZnCS9aT.js';
3
- import '@vitest/runner/utils';
4
- import '@vitest/utils';
1
+ export { B as BasicReporter, h as BenchmarkReportsMap, D as DefaultReporter, a as DotReporter, G as GithubActionsReporter, H as HangingProcessReporter, b as JUnitReporter, J as JsonReporter, R as ReportersMap, c as TapFlatReporter, T as TapReporter, e as TestCase, d as TestFile, f as TestModule, g as TestSuite, V as VerboseReporter } from './chunks/index.DpJO1tkB.js';
5
2
  import 'node:fs';
6
3
  import 'tinyrainbow';
7
4
  import 'pathe';
5
+ import './chunks/tasks.BZnCS9aT.js';
6
+ import '@vitest/runner/utils';
7
+ import '@vitest/utils';
8
8
  import './chunks/env.CmHVDJnw.js';
9
9
  import 'std-env';
10
- import './chunks/utils.DO38lwfj.js';
11
- import './chunks/base.BH-FAiX7.js';
10
+ import './chunks/utils.Dbnmsfq1.js';
11
+ import './chunks/base.BlXpj3e_.js';
12
12
  import 'node:perf_hooks';
13
13
  import '@vitest/utils/source-map';
14
14
  import './chunks/index.CxRxs566.js';
15
15
  import './chunks/utils.Ck2hJTRs.js';
16
- import './chunks/RandomSequencer.B4M2ux5b.js';
16
+ import './chunks/RandomSequencer.Bh5-tlNJ.js';
17
17
  import 'node:fs/promises';
18
- import 'execa';
18
+ import 'tinyexec';
19
19
  import 'node:url';
20
20
  import 'node:os';
21
21
  import 'path';
package/dist/runners.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { setState, GLOBAL_EXPECT, getState } from '@vitest/expect';
2
- import { g as getSnapshotClient, c as createExpect, v as vi } from './chunks/vi.B6QZ938s.js';
2
+ import { g as getSnapshotClient, c as createExpect, v as vi } from './chunks/vi.DGgiNzJE.js';
3
3
  import 'pathe';
4
4
  import { g as getTestName } from './chunks/tasks.BZnCS9aT.js';
5
5
  import { createDefer, getSafeTimers } from '@vitest/utils';
@@ -14,7 +14,7 @@ import './chunks/_commonjsHelpers.BFTU3MAI.js';
14
14
  import '@vitest/snapshot';
15
15
  import '@vitest/utils/error';
16
16
  import '@vitest/utils/source-map';
17
- import './chunks/base.BH-FAiX7.js';
17
+ import './chunks/base.BlXpj3e_.js';
18
18
  import './chunks/date.W2xKR2qe.js';
19
19
  import '@vitest/spy';
20
20
  import 'std-env';
package/dist/utils.d.ts CHANGED
@@ -1,2 +1,3 @@
1
1
  export * from '@vitest/utils';
2
2
  export * from '@vitest/utils/source-map';
3
+ import '@vitest/mocker';
package/dist/worker.js CHANGED
@@ -4,9 +4,10 @@ import { ViteNodeRunner, ModuleCacheMap } from 'vite-node/client';
4
4
  import { readFileSync } from 'node:fs';
5
5
  import { resolve, normalize } from 'pathe';
6
6
  import { e as environments } from './chunks/index.lVXYBqEP.js';
7
- import { i as isChildProcess, s as setProcessTitle } from './chunks/base.BH-FAiX7.js';
7
+ import { i as isChildProcess, s as setProcessTitle } from './chunks/base.BlXpj3e_.js';
8
8
  import { s as setupInspect } from './chunks/inspector.70d6emsh.js';
9
9
  import { c as createRuntimeRpc, a as rpcDone } from './chunks/rpc.B7Mfb-Yf.js';
10
+ import { d as disposeInternalListeners } from './chunks/utils.Cn0zI1t3.js';
10
11
  import 'node:console';
11
12
  import '@vitest/utils';
12
13
  import 'node:module';
@@ -62,6 +63,7 @@ if (isChildProcess()) {
62
63
  setProcessTitle(`vitest ${workerId}`);
63
64
  }
64
65
  async function execute(mehtod, ctx) {
66
+ disposeInternalListeners();
65
67
  const prepareStart = performance.now();
66
68
  const inspectorCleanup = setupInspect(ctx);
67
69
  process.env.VITEST_WORKER_ID = String(ctx.workerId);
@@ -95,7 +97,6 @@ async function execute(mehtod, ctx) {
95
97
  ctx,
96
98
  // here we create a new one, workers can reassign this if they need to keep it non-isolated
97
99
  moduleCache: new ModuleCacheMap(),
98
- mockMap: /* @__PURE__ */ new Map(),
99
100
  config: ctx.config,
100
101
  onCancel,
101
102
  environment,