vitest 2.1.0-beta.6 → 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 (56) hide show
  1. package/LICENSE.md +52 -342
  2. package/dist/browser.d.ts +4 -2
  3. package/dist/browser.js +1 -1
  4. package/dist/chunks/{RandomSequencer.CjkAy_bL.js → RandomSequencer.Bh5-tlNJ.js} +10 -37
  5. package/dist/chunks/{base.BH-FAiX7.js → base.BlXpj3e_.js} +1 -29
  6. package/dist/chunks/{base.B-9RAXb6.js → base.CchlWrnV.js} +2 -4
  7. package/dist/chunks/{cac.BZlOqtiQ.js → cac.B5XYKv2_.js} +25 -16
  8. package/dist/chunks/{cli-api.B-2f6g4d.js → cli-api.ByZPnilx.js} +2778 -3488
  9. package/dist/chunks/{creator.D0TxjnLa.js → creator.zfBZSJzo.js} +8 -11
  10. package/dist/chunks/{execute.DT9BA6zp.js → execute._eQQfgI8.js} +322 -232
  11. package/dist/chunks/{git.ZtkbKc8u.js → git.B5SDxu-n.js} +5 -5
  12. package/dist/chunks/{globals.Br36EZIp.js → globals.jM7MxN2t.js} +3 -3
  13. package/dist/chunks/{index.CM5UI-4O.js → index.Bn75ITYg.js} +3 -3
  14. package/dist/chunks/index.CPD77dLA.js +133 -0
  15. package/dist/chunks/{index.dWDhoZDV.js → index.CSjyR2-v.js} +1 -1
  16. package/dist/chunks/{index.C4LZENmc.js → index.DpJO1tkB.js} +40 -44
  17. package/dist/chunks/{index.m3Xip5Zz.js → index.xm8OIiKD.js} +1 -1
  18. package/dist/chunks/mocker.cRtM890J.d.ts +17 -0
  19. package/dist/chunks/{reporters.B0Ao6Zu1.d.ts → reporters.WnPwkmgA.d.ts} +30 -22
  20. package/dist/chunks/{resolveConfig.C0vpvVRF.js → resolveConfig.-K5hHm0S.js} +19 -6
  21. package/dist/chunks/{runBaseTests.Cf8lGnUq.js → runBaseTests.Cztfoflv.js} +6 -6
  22. package/dist/chunks/{setup-common.B7uEQsGB.js → setup-common.fGBFoQKJ.js} +1 -1
  23. package/dist/chunks/{utils.C3_cBsyn.js → utils.Cn0zI1t3.js} +16 -3
  24. package/dist/chunks/{utils.DO38lwfj.js → utils.Dbnmsfq1.js} +1 -1
  25. package/dist/chunks/{vi.DBepMgvg.js → vi.DGgiNzJE.js} +37 -37
  26. package/dist/chunks/{vite.Bvz2vSw0.d.ts → vite.D2yAwzwa.d.ts} +1 -1
  27. package/dist/chunks/{vm.kl9T_5ai.js → vm.CPXwWp4C.js} +1 -2
  28. package/dist/chunks/{worker.DTM-0OlZ.d.ts → worker.Bws9Zuxu.d.ts} +1 -1
  29. package/dist/chunks/{worker.CTdJUeeB.d.ts → worker.CmPmTxgH.d.ts} +1 -14
  30. package/dist/cli.js +2 -2
  31. package/dist/config.d.ts +2 -2
  32. package/dist/coverage.d.ts +1 -1
  33. package/dist/coverage.js +4 -4
  34. package/dist/execute.d.ts +12 -13
  35. package/dist/execute.js +3 -2
  36. package/dist/index.d.ts +17 -15
  37. package/dist/index.js +4 -4
  38. package/dist/mocker.d.ts +1 -0
  39. package/dist/mocker.js +1 -0
  40. package/dist/node.d.ts +15 -7
  41. package/dist/node.js +18 -16
  42. package/dist/reporters.d.ts +1 -1
  43. package/dist/reporters.js +5 -5
  44. package/dist/runners.js +2 -2
  45. package/dist/utils.d.ts +1 -0
  46. package/dist/worker.js +3 -2
  47. package/dist/workers/forks.js +5 -4
  48. package/dist/workers/runVmTests.js +5 -5
  49. package/dist/workers/threads.js +5 -4
  50. package/dist/workers/vmForks.js +4 -4
  51. package/dist/workers/vmThreads.js +4 -4
  52. package/dist/workers.d.ts +2 -2
  53. package/dist/workers.js +6 -5
  54. package/mocker.d.ts +1 -0
  55. package/package.json +22 -17
  56. package/dist/chunks/index.CWhwfxXK.js +0 -835
@@ -13,7 +13,7 @@ async function setupCommonEnv(config) {
13
13
  globalSetup = true;
14
14
  setSafeTimers();
15
15
  if (config.globals) {
16
- (await import('./globals.Br36EZIp.js')).registerApiGlobally();
16
+ (await import('./globals.jM7MxN2t.js')).registerApiGlobally();
17
17
  }
18
18
  }
19
19
  function setupDefines(defines) {
@@ -3,6 +3,8 @@ import { parseRegexp } from '@vitest/utils';
3
3
  const REGEXP_WRAP_PREFIX = "$$vitest:";
4
4
  const processSend = process.send?.bind(process);
5
5
  const processOn = process.on?.bind(process);
6
+ const processOff = process.off?.bind(process);
7
+ const dispose = [];
6
8
  function createThreadsRpcOptions({
7
9
  port
8
10
  }) {
@@ -15,6 +17,15 @@ function createThreadsRpcOptions({
15
17
  }
16
18
  };
17
19
  }
20
+ function disposeInternalListeners() {
21
+ for (const fn of dispose) {
22
+ try {
23
+ fn();
24
+ } catch {
25
+ }
26
+ }
27
+ dispose.length = 0;
28
+ }
18
29
  function createForksRpcOptions(nodeV8) {
19
30
  return {
20
31
  serialize: nodeV8.serialize,
@@ -23,12 +34,14 @@ function createForksRpcOptions(nodeV8) {
23
34
  processSend(v);
24
35
  },
25
36
  on(fn) {
26
- processOn("message", (message, ...extras) => {
37
+ const handler = (message, ...extras) => {
27
38
  if (message?.__tinypool_worker_message__) {
28
39
  return;
29
40
  }
30
41
  return fn(message, ...extras);
31
- });
42
+ };
43
+ processOn("message", handler);
44
+ dispose.push(() => processOff("message", handler));
32
45
  }
33
46
  };
34
47
  }
@@ -52,4 +65,4 @@ function unwrapSerializableConfig(config) {
52
65
  return config;
53
66
  }
54
67
 
55
- export { createThreadsRpcOptions as a, createForksRpcOptions as c, unwrapSerializableConfig as u };
68
+ export { createThreadsRpcOptions as a, createForksRpcOptions as c, disposeInternalListeners as d, unwrapSerializableConfig as u };
@@ -1,6 +1,6 @@
1
1
  import { isAbsolute, relative, dirname, basename } from 'pathe';
2
2
  import c from 'tinyrainbow';
3
- import { a as slash } from './base.BH-FAiX7.js';
3
+ import { a as slash } from './base.BlXpj3e_.js';
4
4
 
5
5
  const F_RIGHT = "\u2192";
6
6
  const F_DOWN = "\u2193";
@@ -11,7 +11,7 @@ import { getSafeTimers, assertTypes, createSimpleStackTrace } from '@vitest/util
11
11
  import 'pathe';
12
12
  import './env.CmHVDJnw.js';
13
13
  import { parseSingleStack } from '@vitest/utils/source-map';
14
- import { i as isChildProcess } from './base.BH-FAiX7.js';
14
+ import { i as isChildProcess } from './base.BlXpj3e_.js';
15
15
  import { R as RealDate, r as resetDate, m as mockDate } from './date.W2xKR2qe.js';
16
16
  import { spyOn, fn, isMockFunction, mocks } from '@vitest/spy';
17
17
 
@@ -191,16 +191,16 @@ function getError(expected, promise) {
191
191
  }
192
192
  throw new Error("snapshot function didn't throw");
193
193
  }
194
- const SnapshotPlugin = (chai, utils) => {
195
- const getTestNames = (test) => {
196
- if (!test) {
197
- return {};
198
- }
199
- return {
200
- filepath: test.file.filepath,
201
- name: getNames(test).slice(1).join(" > ")
202
- };
194
+ function getTestNames(test) {
195
+ if (!test) {
196
+ return {};
197
+ }
198
+ return {
199
+ filepath: test.file.filepath,
200
+ name: getNames(test).slice(1).join(" > ")
203
201
  };
202
+ }
203
+ const SnapshotPlugin = (chai, utils) => {
204
204
  for (const key of ["matchSnapshot", "toMatchSnapshot"]) {
205
205
  utils.addMethod(
206
206
  chai.Assertion.prototype,
@@ -3469,18 +3469,6 @@ function waitUntil(callback, options = {}) {
3469
3469
  function createVitest() {
3470
3470
  let _mockedDate = null;
3471
3471
  let _config = null;
3472
- function _mocker() {
3473
- return typeof __vitest_mocker__ !== "undefined" ? __vitest_mocker__ : new Proxy(
3474
- {},
3475
- {
3476
- get(_, name) {
3477
- throw new Error(
3478
- `Vitest mocker was not initialized in this environment. vi.${String(name)}() is forbidden.`
3479
- );
3480
- }
3481
- }
3482
- );
3483
- }
3484
3472
  const workerState = getWorkerState();
3485
3473
  let _timers;
3486
3474
  const timers = () => _timers ||= new FakeTimers({
@@ -3490,15 +3478,6 @@ function createVitest() {
3490
3478
  const _stubsGlobal = /* @__PURE__ */ new Map();
3491
3479
  const _stubsEnv = /* @__PURE__ */ new Map();
3492
3480
  const _envBooleans = ["PROD", "DEV", "SSR"];
3493
- const getImporter = (name) => {
3494
- const stackTrace = createSimpleStackTrace({ stackTraceLimit: 5 });
3495
- const stackArray = stackTrace.split("\n");
3496
- const importerStackIndex = stackArray.findIndex((stack2) => {
3497
- return stack2.includes(` at Object.${name}`) || stack2.includes(`${name}@`);
3498
- });
3499
- const stack = parseSingleStack(stackArray[importerStackIndex + 1]);
3500
- return stack?.file || "";
3501
- };
3502
3481
  const utils = {
3503
3482
  useFakeTimers(config) {
3504
3483
  if (isChildProcess()) {
@@ -3602,14 +3581,13 @@ function createVitest() {
3602
3581
  _mocker().queueMock(
3603
3582
  path,
3604
3583
  importer,
3605
- factory ? () => factory(
3584
+ typeof factory === "function" ? () => factory(
3606
3585
  () => _mocker().importActual(
3607
3586
  path,
3608
3587
  importer,
3609
3588
  _mocker().getMockContext().callstack
3610
3589
  )
3611
- ) : void 0,
3612
- true
3590
+ ) : factory
3613
3591
  );
3614
3592
  },
3615
3593
  unmock(path) {
@@ -3630,14 +3608,13 @@ function createVitest() {
3630
3608
  _mocker().queueMock(
3631
3609
  path,
3632
3610
  importer,
3633
- factory ? () => factory(
3611
+ typeof factory === "function" ? () => factory(
3634
3612
  () => _mocker().importActual(
3635
3613
  path,
3636
3614
  importer,
3637
3615
  _mocker().getMockContext().callstack
3638
3616
  )
3639
- ) : void 0,
3640
- false
3617
+ ) : factory
3641
3618
  );
3642
3619
  },
3643
3620
  doUnmock(path) {
@@ -3698,6 +3675,8 @@ function createVitest() {
3698
3675
  }
3699
3676
  if (_envBooleans.includes(name)) {
3700
3677
  process.env[name] = value ? "1" : "";
3678
+ } else if (value === void 0) {
3679
+ delete process.env[name];
3701
3680
  } else {
3702
3681
  process.env[name] = String(value);
3703
3682
  }
@@ -3748,5 +3727,26 @@ function createVitest() {
3748
3727
  }
3749
3728
  const vitest = createVitest();
3750
3729
  const vi = vitest;
3730
+ function _mocker() {
3731
+ return typeof __vitest_mocker__ !== "undefined" ? __vitest_mocker__ : new Proxy(
3732
+ {},
3733
+ {
3734
+ get(_, name) {
3735
+ throw new Error(
3736
+ `Vitest mocker was not initialized in this environment. vi.${String(name)}() is forbidden.`
3737
+ );
3738
+ }
3739
+ }
3740
+ );
3741
+ }
3742
+ function getImporter(name) {
3743
+ const stackTrace = createSimpleStackTrace({ stackTraceLimit: 5 });
3744
+ const stackArray = stackTrace.split("\n");
3745
+ const importerStackIndex = stackArray.findIndex((stack2) => {
3746
+ return stack2.includes(` at Object.${name}`) || stack2.includes(`${name}@`);
3747
+ });
3748
+ const stack = parseSingleStack(stackArray[importerStackIndex + 1]);
3749
+ return stack?.file || "";
3750
+ }
3751
3751
 
3752
3752
  export { globalExpect as a, vitest as b, createExpect as c, getSnapshotClient as g, resetModules as r, vi as v };
@@ -1,4 +1,4 @@
1
- import { I as InlineConfig } from './reporters.B0Ao6Zu1.js';
1
+ import { I as InlineConfig } from './reporters.WnPwkmgA.js';
2
2
 
3
3
  type VitestInlineConfig = InlineConfig;
4
4
  declare module 'vite' {
@@ -2,7 +2,7 @@ import vm, { isContext } from 'node:vm';
2
2
  import { fileURLToPath, pathToFileURL } from 'node:url';
3
3
  import { dirname, basename, extname, normalize, join, resolve } from 'pathe';
4
4
  import { createCustomConsole } from './console.DI3gHgtH.js';
5
- import { g as getDefaultRequestStubs, s as startVitestExecutor } from './execute.DT9BA6zp.js';
5
+ import { g as getDefaultRequestStubs, s as startVitestExecutor } from './execute._eQQfgI8.js';
6
6
  import { distDir } from '../path.js';
7
7
  import { dirname as dirname$1 } from 'node:path';
8
8
  import fs from 'node:fs';
@@ -822,7 +822,6 @@ async function runVmTests(method, state) {
822
822
  const executor = await startVitestExecutor({
823
823
  context,
824
824
  moduleCache: state.moduleCache,
825
- mockMap: state.mockMap,
826
825
  state,
827
826
  externalModulesExecutor,
828
827
  requestStubs: stubs
@@ -1,5 +1,5 @@
1
1
  import { MessagePort } from 'node:worker_threads';
2
- import { C as ContextRPC } from './worker.CTdJUeeB.js';
2
+ import { C as ContextRPC } from './worker.CmPmTxgH.js';
3
3
 
4
4
  interface WorkerContext extends ContextRPC {
5
5
  port: MessagePort;
@@ -4,18 +4,6 @@ import { S as SerializedConfig } from './config.CHuotKvS.js';
4
4
  import { SnapshotResult } from '@vitest/snapshot';
5
5
  import { T as TransformMode, U as UserConsoleLog, A as AfterSuiteRunMeta, E as Environment } from './environment.C5eAp3K6.js';
6
6
 
7
- type Promisable<T> = T | Promise<T>;
8
- type MockFactoryWithHelper<M = unknown> = (importOriginal: <T extends M = M>() => Promise<T>) => Promisable<Partial<M>>;
9
- type MockFactory = () => any;
10
- type MockMap = Map<string, Record<string, string | null | MockFactory>>;
11
- interface PendingSuiteMock {
12
- id: string;
13
- importer: string;
14
- type: 'mock' | 'unmock';
15
- throwIfCached: boolean;
16
- factory?: MockFactory;
17
- }
18
-
19
7
  interface RuntimeRPC {
20
8
  fetch: (id: string, transformMode: TransformMode) => Promise<{
21
9
  externalize?: string;
@@ -134,7 +122,6 @@ interface WorkerGlobalState {
134
122
  environmentTeardownRun?: boolean;
135
123
  onCancel: Promise<CancelReason>;
136
124
  moduleCache: ModuleCacheMap;
137
- mockMap: MockMap;
138
125
  providedContext: Record<string, any>;
139
126
  durations: {
140
127
  environment: number;
@@ -142,4 +129,4 @@ interface WorkerGlobalState {
142
129
  };
143
130
  }
144
131
 
145
- export type { BirpcOptions as B, ContextRPC as C, MockFactoryWithHelper as M, PendingSuiteMock as P, RuntimeRPC as R, WorkerGlobalState as W, BirpcReturn as a, RunnerRPC as b, ResolveIdFunction as c, WorkerRPC as d, ContextTestEnvironment as e, MockFactory as f, MockMap as g };
132
+ export type { BirpcOptions as B, ContextRPC as C, RuntimeRPC as R, WorkerGlobalState as W, BirpcReturn as a, RunnerRPC as b, ResolveIdFunction as c, WorkerRPC as d, ContextTestEnvironment as e };
package/dist/cli.js CHANGED
@@ -1,8 +1,8 @@
1
- import { c as createCLI } from './chunks/cac.BZlOqtiQ.js';
1
+ import { c as createCLI } from './chunks/cac.B5XYKv2_.js';
2
2
  import 'pathe';
3
3
  import 'events';
4
4
  import 'tinyrainbow';
5
- import './chunks/base.BH-FAiX7.js';
5
+ import './chunks/base.BlXpj3e_.js';
6
6
  import '@vitest/utils';
7
7
  import './chunks/constants.fzPh7AOq.js';
8
8
 
package/dist/config.d.ts CHANGED
@@ -1,7 +1,7 @@
1
- import './chunks/vite.Bvz2vSw0.js';
1
+ import './chunks/vite.D2yAwzwa.js';
2
2
  import { ConfigEnv, UserConfig } from 'vite';
3
3
  export { ConfigEnv, Plugin, UserConfig, mergeConfig } from 'vite';
4
- import { R as ResolvedCoverageOptions, b as CoverageV8Options, U as UserWorkspaceConfig, c as UserProjectConfigFn, d as UserProjectConfigExport, W as WorkspaceProjectConfiguration } from './chunks/reporters.B0Ao6Zu1.js';
4
+ import { R as ResolvedCoverageOptions, b as CoverageV8Options, U as UserWorkspaceConfig, c as UserProjectConfigFn, d as UserProjectConfigExport, W as WorkspaceProjectConfiguration } from './chunks/reporters.WnPwkmgA.js';
5
5
  import '@vitest/runner';
6
6
  import '@vitest/pretty-format';
7
7
  import './chunks/config.CHuotKvS.js';
@@ -1,5 +1,5 @@
1
1
  import * as vite from 'vite';
2
- import { B as BaseCoverageOptions, R as ResolvedCoverageOptions, V as Vitest } from './chunks/reporters.B0Ao6Zu1.js';
2
+ import { B as BaseCoverageOptions, R as ResolvedCoverageOptions, V as Vitest } from './chunks/reporters.WnPwkmgA.js';
3
3
  import '@vitest/runner';
4
4
  import '@vitest/pretty-format';
5
5
  import './chunks/config.CHuotKvS.js';
package/dist/coverage.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { relative } from 'pathe';
2
- import { m as mm, r as resolveCoverageReporters } from './chunks/resolveConfig.C0vpvVRF.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';
@@ -15,13 +15,13 @@ 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.CjkAy_bL.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';
package/dist/execute.d.ts CHANGED
@@ -1,7 +1,10 @@
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.CTdJUeeB.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';
@@ -9,7 +12,6 @@ import '@vitest/snapshot';
9
12
  import '@vitest/snapshot/environment';
10
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,10 +1,10 @@
1
- import './chunks/vite.Bvz2vSw0.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 SerializedSpec, 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.B0Ao6Zu1.js';
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';
8
8
  import { B as BenchmarkResult } from './chunks/benchmark.puBFxyfE.js';
9
9
  export { b as BenchFunction, a as Benchmark, c as BenchmarkAPI } from './chunks/benchmark.puBFxyfE.js';
10
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';
@@ -14,11 +14,12 @@ export { CancelReason, DoneCallback, ExtendedContext, HookCleanupCallback, HookL
14
14
  export { b as bench } from './chunks/suite.CcK46U-P.js';
15
15
  import { F as FakeTimerInstallOpts, R as RuntimeOptions, S as SerializedConfig } from './chunks/config.CHuotKvS.js';
16
16
  export { b as RuntimeConfig, a as SerializedCoverageConfig } from './chunks/config.CHuotKvS.js';
17
- import { M as MockFactoryWithHelper, a as BirpcReturn } from './chunks/worker.CTdJUeeB.js';
18
- 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.CTdJUeeB.js';
17
+ import { M as MockFactoryWithHelper, a as MockOptions } from './chunks/mocker.cRtM890J.js';
19
18
  import { spyOn, fn, MaybeMockedDeep, MaybeMocked, MaybePartiallyMocked, MaybePartiallyMockedDeep, MockInstance } from '@vitest/spy';
20
19
  export { Mock, MockContext, MockInstance, Mocked, MockedClass, MockedFunction, MockedObject } from '@vitest/spy';
21
- export { W as WorkerContext } from './chunks/worker.DTM-0OlZ.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';
22
23
  export { ErrorWithDiff, ParsedStack, SerializedError, TestError } from '@vitest/utils';
23
24
  export { DiffOptions } from '@vitest/utils/diff';
24
25
  import * as chai from 'chai';
@@ -35,6 +36,7 @@ import '@vitest/utils/source-map';
35
36
  import 'node:fs';
36
37
  import '@vitest/runner/utils';
37
38
  import '@vitest/snapshot/environment';
39
+ import '@vitest/mocker';
38
40
  import 'node:worker_threads';
39
41
 
40
42
  declare global {
@@ -1353,8 +1355,8 @@ interface VitestUtils {
1353
1355
  * @param path Path to the module. Can be aliased, if your Vitest config supports it
1354
1356
  * @param factory Mocked module factory. The result of this function will be an exports object
1355
1357
  */
1356
- mock(path: string, factory?: MockFactoryWithHelper): void;
1357
- 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;
1358
1360
  /**
1359
1361
  * Removes module from mocked registry. All calls to import will return the original module even if it was mocked before.
1360
1362
  *
@@ -1372,8 +1374,8 @@ interface VitestUtils {
1372
1374
  * @param path Path to the module. Can be aliased, if your Vitest config supports it
1373
1375
  * @param factory Mocked module factory. The result of this function will be an exports object
1374
1376
  */
1375
- doMock(path: string, factory?: MockFactoryWithHelper): void;
1376
- 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;
1377
1379
  /**
1378
1380
  * Removes module from mocked registry. All subsequent calls to import will return original module.
1379
1381
  *
@@ -1472,7 +1474,7 @@ interface VitestUtils {
1472
1474
  * Changes the value of `import.meta.env` and `process.env`.
1473
1475
  * You can return it back to original value with `vi.unstubAllEnvs`, or by enabling `unstubEnvs` config option.
1474
1476
  */
1475
- 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;
1476
1478
  /**
1477
1479
  * Reset the value to original value that was available before first `vi.stubGlobal` was called.
1478
1480
  */
@@ -1543,7 +1545,7 @@ interface TransformResultWithSource {
1543
1545
  interface WebSocketHandlers {
1544
1546
  onTaskUpdate: (packs: TaskResultPack[]) => void;
1545
1547
  getFiles: () => File$1[];
1546
- getTestFiles: () => Promise<SerializedSpec[]>;
1548
+ getTestFiles: () => Promise<SerializedTestSpecification[]>;
1547
1549
  getPaths: () => string[];
1548
1550
  getConfig: () => SerializedConfig;
1549
1551
  getModuleGraph: (projectName: string, id: string, browser?: boolean) => Promise<ModuleGraphData>;
@@ -1560,7 +1562,7 @@ interface WebSocketEvents {
1560
1562
  onTaskUpdate?: (packs: TaskResultPack[]) => Awaitable$1<void>;
1561
1563
  onUserConsoleLog?: (log: UserConsoleLog) => Awaitable$1<void>;
1562
1564
  onPathsCollected?: (paths?: string[]) => Awaitable$1<void>;
1563
- onSpecsCollected?: (specs?: SerializedSpec[]) => Awaitable$1<void>;
1565
+ onSpecsCollected?: (specs?: SerializedTestSpecification[]) => Awaitable$1<void>;
1564
1566
  onFinishedReportCoverage: () => void;
1565
1567
  }
1566
1568
  type WebSocketRPC = BirpcReturn<WebSocketEvents, WebSocketHandlers>;
@@ -1682,10 +1684,10 @@ type ProjectConfig = ProjectConfig$1;
1682
1684
  /** @deprecated import from `vitest/node` instead */
1683
1685
  type UserWorkspaceConfig = UserWorkspaceConfig$1;
1684
1686
 
1685
- /** @deprecated use `SerializedSpec` instead */
1686
- type SerializableSpec = SerializedSpec;
1687
+ /** @deprecated use `SerializedTestSpecification` instead */
1688
+ type SerializableSpec = SerializedTestSpecification;
1687
1689
 
1688
1690
  /** @deprecated import from `vitest/node` instead */
1689
1691
  type BenchmarkUserOptions = BenchmarkUserOptions$1;
1690
1692
 
1691
- 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.m3Xip5Zz.js';
4
- export { a as assertType, g as getRunningMode, b as inject, i as isWatchMode } from './chunks/index.m3Xip5Zz.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.DBepMgvg.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 { 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.B0Ao6Zu1.js';
2
- export { B as BaseCoverageOptions, G as BenchmarkUserOptions, a4 as BrowserBuiltinProvider, a5 as BrowserCommand, a6 as BrowserCommandContext, s as BrowserConfigOptions, aa as BrowserOrchestrator, $ as BrowserProvider, _ as BrowserProviderInitializationOptions, a1 as BrowserProviderModule, a3 as BrowserProviderOptions, r as BrowserScript, a7 as BrowserServer, a8 as BrowserServerState, a9 as BrowserServerStateContext, t as BuiltinEnvironment, a0 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, ad as HTMLOptions, I as InlineConfig, ac as JUnitOptions, ab as JsonOptions, P as Pool, u as PoolOptions, Q as ProcessPool, F as ProjectConfig, k as ReportContext, a2 as ResolvedBrowserOptions, R as ResolvedCoverageOptions, ao as ResolvedProjectConfig, ai as TaskOptions, ae as TestCase, ah as TestCollection, aj as TestDiagnostic, ag as TestProject, ak as TestResult, am as TestResultFailed, al as TestResultPassed, an as TestResultSkipped, Z as TestSequencerConstructor, af 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.B0Ao6Zu1.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
8
  import { P as ProvidedContext } from './chunks/environment.C5eAp3K6.js';
9
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.CTdJUeeB.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.DTM-0OlZ.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,6 +103,10 @@ declare class BaseSequencer implements TestSequencer {
99
103
  sort(files: WorkspaceSpec[]): Promise<WorkspaceSpec[]>;
100
104
  }
101
105
 
106
+ /** @deprecated use `createViteServer` instead */
107
+ declare const createServer: typeof createServer$1;
108
+ declare const createViteServer: typeof createServer$1;
109
+
102
110
  /**
103
111
  * @deprecated Use `TestModule` instead
104
112
  */
@@ -109,4 +117,4 @@ declare const TestFile: typeof TestModule;
109
117
  */
110
118
  type FileDiagnostic = ModuleDiagnostic;
111
119
 
112
- export { ApiConfig, BaseSequencer, type FileDiagnostic, GitNotFoundError, type GlobalSetupContext, ModuleDiagnostic, ResolvedConfig, TestFile, TestModule, TestSequencer, FilesNotFoundError as TestsNotFoundError, UserConfig, Vitest, VitestPlugin, VitestRunMode, WorkspaceProject, WorkspaceSpec, createDebugger, createMethodsRPC, createVitest, distDir, parseCLI, registerConsoleShortcuts, resolveApiServerConfig, resolveConfig, resolveFsAllow, rootDir, startVitest };
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 };