vitest 4.0.0-beta.17 → 4.0.0-beta.19

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 (58) hide show
  1. package/dist/browser.d.ts +3 -3
  2. package/dist/browser.js +1 -1
  3. package/dist/{worker-base.js → chunks/base.CtHM3ryk.js} +18 -91
  4. package/dist/chunks/{browser.d.CCG7W26I.d.ts → browser.d.B9iJzZyn.d.ts} +3 -2
  5. package/dist/chunks/{cac.BO_6jvrs.js → cac.DCrQhweU.js} +15 -62
  6. package/dist/chunks/{cli-api.BvCJGado.js → cli-api.BjHteKX0.js} +1322 -55
  7. package/dist/chunks/{config.d.C4PpNy7v.d.ts → config.d.u2CUDWwS.d.ts} +2 -16
  8. package/dist/chunks/{coverage.3htTSxXZ.js → coverage.FU3w4IrQ.js} +39 -1213
  9. package/dist/chunks/{creator.Daoa5_gR.js → creator.DucAaYBz.js} +1 -1
  10. package/dist/chunks/{defaults.CXFFjsi8.js → defaults.BOqNVLsY.js} +0 -1
  11. package/dist/chunks/evaluatedModules.Dg1zASAC.js +17 -0
  12. package/dist/chunks/{global.d.D1pbKXir.d.ts → global.d.BgJSTpgQ.d.ts} +2 -1
  13. package/dist/chunks/{globals.DC4ntO86.js → globals.BGT_RUsD.js} +5 -3
  14. package/dist/chunks/{index.01uBqPwR.js → index.BdSLhLDZ.js} +1 -1
  15. package/dist/chunks/{index.Bt-upxGS.js → index.CbWINfS7.js} +29 -4
  16. package/dist/chunks/{index.DehVUBn4.js → index.CcRZ6fUh.js} +1507 -12
  17. package/dist/chunks/{index.Dnl38iQ_.js → index.RwjEGCQ0.js} +3 -3
  18. package/dist/chunks/init-forks.DSafeltJ.js +54 -0
  19. package/dist/chunks/init-threads.SUtZ-067.js +17 -0
  20. package/dist/chunks/{worker.DVTUM2IW.js → init.B2EESLQM.js} +98 -81
  21. package/dist/chunks/{inspector.Br76Q2Mb.js → inspector.DLZxSeU3.js} +1 -2
  22. package/dist/chunks/{moduleRunner.d.aXWuQhZN.d.ts → moduleRunner.d.YtNsMIoJ.d.ts} +1 -1
  23. package/dist/chunks/{plugin.d.CqKwuCSa.d.ts → plugin.d.BB__S31E.d.ts} +1 -1
  24. package/dist/chunks/{reporters.d.DAyr7w3M.d.ts → reporters.d.C6nGyY9_.d.ts} +1104 -1112
  25. package/dist/chunks/{resolveSnapshotEnvironment.BsJpmVZR.js → resolveSnapshotEnvironment.DJJKMKxb.js} +2 -2
  26. package/dist/chunks/{setup-common.BewgbkTd.js → setup-common.DR1sucx6.js} +1 -1
  27. package/dist/chunks/{startModuleRunner.DPBo3mme.js → startModuleRunner.C2tTvmF9.js} +3 -1
  28. package/dist/chunks/{test.CTuWuHYH.js → test.C3RPt8JR.js} +1 -1
  29. package/dist/chunks/{vi.B2--mG9U.js → vi.BZvkKVkM.js} +1 -1
  30. package/dist/{worker-vm.js → chunks/vm.DBeOXrP9.js} +6 -66
  31. package/dist/chunks/{worker.d.DSgBAZPX.d.ts → worker.d.BFk-vvBU.d.ts} +79 -4
  32. package/dist/cli.js +8 -9
  33. package/dist/config.cjs +0 -1
  34. package/dist/config.d.ts +6 -7
  35. package/dist/config.js +1 -1
  36. package/dist/coverage.d.ts +4 -4
  37. package/dist/coverage.js +2 -13
  38. package/dist/environments.js +1 -1
  39. package/dist/index.d.ts +13 -9
  40. package/dist/index.js +5 -3
  41. package/dist/module-evaluator.d.ts +3 -3
  42. package/dist/module-runner.js +1 -1
  43. package/dist/node.d.ts +79 -15
  44. package/dist/node.js +25 -26
  45. package/dist/reporters.d.ts +4 -4
  46. package/dist/reporters.js +9 -10
  47. package/dist/runners.d.ts +1 -1
  48. package/dist/runners.js +2 -2
  49. package/dist/worker.d.ts +26 -0
  50. package/dist/worker.js +46 -0
  51. package/dist/workers/forks.js +50 -0
  52. package/dist/workers/runVmTests.js +8 -7
  53. package/dist/workers/threads.js +50 -0
  54. package/dist/workers/vmForks.js +35 -0
  55. package/dist/workers/vmThreads.js +35 -0
  56. package/package.json +17 -14
  57. package/worker.d.ts +1 -0
  58. package/dist/chunks/typechecker.DsKAhua5.js +0 -1522
@@ -1,8 +1,8 @@
1
1
  import { chai } from '@vitest/expect';
2
- import { l as loadDiffConfig, b as loadSnapshotSerializers, t as takeCoverageInsideWorker } from './setup-common.BewgbkTd.js';
2
+ import { l as loadDiffConfig, b as loadSnapshotSerializers, t as takeCoverageInsideWorker } from './setup-common.DR1sucx6.js';
3
3
  import { r as rpc } from './rpc.cD77ENhU.js';
4
4
  import { g as getWorkerState } from './utils.CG9h5ccR.js';
5
- import { V as VitestTestRunner, N as NodeBenchmarkRunner } from './test.CTuWuHYH.js';
5
+ import { V as VitestTestRunner, N as NodeBenchmarkRunner } from './test.C3RPt8JR.js';
6
6
 
7
7
  function setupChaiConfig(config) {
8
8
  Object.assign(chai.config, config);
@@ -18,7 +18,7 @@ async function stopCoverageInsideWorker(options, loader, runtimeOptions) {
18
18
 
19
19
  let globalSetup = false;
20
20
  async function setupCommonEnv(config) {
21
- if (setupDefines(config), setupEnv(config.env), !globalSetup && (globalSetup = true, setSafeTimers(), config.globals)) (await import('./globals.DC4ntO86.js')).registerApiGlobally();
21
+ if (setupDefines(config), setupEnv(config.env), !globalSetup && (globalSetup = true, setSafeTimers(), config.globals)) (await import('./globals.BGT_RUsD.js')).registerApiGlobally();
22
22
  }
23
23
  function setupDefines(config) {
24
24
  for (const key in config.defines) globalThis[key] = config.defines[key];
@@ -1,5 +1,5 @@
1
1
  import fs from 'node:fs';
2
- import nodeModule, { isBuiltin } from 'node:module';
2
+ import nodeModule, { builtinModules, isBuiltin } from 'node:module';
3
3
  import { isBareImport } from '@vitest/utils/helpers';
4
4
  import { pathToFileURL } from 'node:url';
5
5
  import { normalize as normalize$1, join as join$1 } from 'pathe';
@@ -428,6 +428,7 @@ function fixLeadingSlashes(id) {
428
428
  return id.startsWith("//") ? id.replace(multipleSlashRe, "/") : id;
429
429
  }
430
430
 
431
+ const nodeBuiltins = builtinModules.filter((id) => !id.includes(":"));
431
432
  class VitestTransport {
432
433
  constructor(options) {
433
434
  this.options = options;
@@ -437,6 +438,7 @@ class VitestTransport {
437
438
  if (event.event !== "vite:invoke") return { error: /* @__PURE__ */ new Error(`Vitest Module Runner doesn't support ${event.event} event.`) };
438
439
  const { name, data } = event.data;
439
440
  if (name !== "fetchModule") return { error: /* @__PURE__ */ new Error(`Unknown method: ${name}. Expected "fetchModule".`) };
441
+ if (name === "getBuiltins") return { result: [...nodeBuiltins, /^node:/] };
440
442
  try {
441
443
  return { result: await this.options.fetchModule(...data) };
442
444
  } catch (error) {
@@ -7,7 +7,7 @@ import { setState, GLOBAL_EXPECT, getState } from '@vitest/expect';
7
7
  import { getTests, getNames, getTestName } from '@vitest/runner/utils';
8
8
  import { processError } from '@vitest/utils/error';
9
9
  import { normalize } from 'pathe';
10
- import { a as getSnapshotClient, i as inject, c as createExpect, v as vi } from './vi.B2--mG9U.js';
10
+ import { a as getSnapshotClient, i as inject, c as createExpect, v as vi } from './vi.BZvkKVkM.js';
11
11
  import { r as rpc } from './rpc.cD77ENhU.js';
12
12
 
13
13
  function createBenchmarkResult(name) {
@@ -257,7 +257,7 @@ function createExpect(test) {
257
257
  return getWorkerState().filepath;
258
258
  },
259
259
  currentTestName: test ? getTestName(test) : globalState.currentTestName
260
- }, expect), expect.extend = (matchers) => chai.expect.extend(expect, matchers), expect.addEqualityTesters = (customTesters) => addCustomEqualityTesters(customTesters), expect.soft = (...args) => {
260
+ }, expect), expect.assert = chai.assert, expect.extend = (matchers) => chai.expect.extend(expect, matchers), expect.addEqualityTesters = (customTesters) => addCustomEqualityTesters(customTesters), expect.soft = (...args) => {
261
261
  // @ts-expect-error private soft access
262
262
  return expect(...args).withContext({ soft: true });
263
263
  }, expect.poll = createExpectPoll(expect), expect.unreachable = (message) => {
@@ -1,32 +1,17 @@
1
- import { c as createForksRpcOptions, u as unwrapSerializableConfig, a as createThreadsRpcOptions, e as execute, t as teardown$1 } from './chunks/worker.DVTUM2IW.js';
2
- import v8 from 'node:v8';
3
1
  import { fileURLToPath, pathToFileURL } from 'node:url';
4
2
  import vm, { isContext, runInContext } from 'node:vm';
5
3
  import { dirname, basename, extname, normalize, resolve } from 'pathe';
6
- import { distDir } from './path.js';
7
- import { createCustomConsole } from './chunks/console.CTJL2nuH.js';
4
+ import { distDir } from '../path.js';
5
+ import { createCustomConsole } from './console.CTJL2nuH.js';
8
6
  import fs from 'node:fs';
9
7
  import { createRequire, Module, isBuiltin } from 'node:module';
10
8
  import { toArray, isBareImport } from '@vitest/utils/helpers';
11
9
  import { findNearestPackageData } from '@vitest/utils/resolver';
12
10
  import { dirname as dirname$1 } from 'node:path';
13
11
  import { CSS_LANGS_RE, KNOWN_ASSET_RE } from '@vitest/utils/constants';
14
- import { getDefaultRequestStubs } from './module-evaluator.js';
15
- import { s as startVitestModuleRunner, c as createNodeImportMeta, a as VITEST_VM_CONTEXT_SYMBOL } from './chunks/startModuleRunner.DPBo3mme.js';
16
- import { p as provideWorkerState } from './chunks/utils.CG9h5ccR.js';
17
- import '@vitest/utils/source-map';
18
- import 'vite/module-runner';
19
- import './chunks/index.Bt-upxGS.js';
20
- import 'node:console';
21
- import './chunks/inspector.Br76Q2Mb.js';
22
- import './chunks/rpc.cD77ENhU.js';
23
- import '@vitest/utils/timers';
24
- import './chunks/index.Bgo3tNWt.js';
25
- import 'node:stream';
26
- import 'tinyrainbow';
27
- import './chunks/date.-jtEtIeV.js';
28
- import '@vitest/utils/serialize';
29
- import '@vitest/mocker';
12
+ import { getDefaultRequestStubs } from '../module-evaluator.js';
13
+ import { s as startVitestModuleRunner, c as createNodeImportMeta, a as VITEST_VM_CONTEXT_SYMBOL } from './startModuleRunner.C2tTvmF9.js';
14
+ import { p as provideWorkerState } from './utils.CG9h5ccR.js';
30
15
 
31
16
  function interopCommonJsModule(interopDefault, mod) {
32
17
  if (isPrimitive(mod) || Array.isArray(mod) || mod instanceof Promise) return {
@@ -648,49 +633,4 @@ async function runVmTests(method, state) {
648
633
  }
649
634
  }
650
635
 
651
- class ForksVmWorker {
652
- getRpcOptions() {
653
- return createForksRpcOptions(v8);
654
- }
655
- async executeTests(method, state) {
656
- const exit = process.exit;
657
- state.ctx.config = unwrapSerializableConfig(state.ctx.config);
658
- try {
659
- await runVmTests(method, state);
660
- } finally {
661
- process.exit = exit;
662
- }
663
- }
664
- runTests(state) {
665
- return this.executeTests("run", state);
666
- }
667
- collectTests(state) {
668
- return this.executeTests("collect", state);
669
- }
670
- }
671
- const worker$1 = new ForksVmWorker();
672
-
673
- class ThreadsVmWorker {
674
- getRpcOptions(ctx) {
675
- return createThreadsRpcOptions(ctx);
676
- }
677
- runTests(state) {
678
- return runVmTests("run", state);
679
- }
680
- collectTests(state) {
681
- return runVmTests("collect", state);
682
- }
683
- }
684
- const worker = new ThreadsVmWorker();
685
-
686
- async function run(ctx) {
687
- await execute("run", ctx, ctx.pool === "vmForks" ? worker$1 : worker);
688
- }
689
- async function collect(ctx) {
690
- await execute("collect", ctx, ctx.pool === "vmForks" ? worker$1 : worker);
691
- }
692
- async function teardown() {
693
- await teardown$1();
694
- }
695
-
696
- export { collect, run, teardown };
636
+ export { runVmTests as r };
@@ -1,6 +1,6 @@
1
1
  import { CancelReason, File, TestAnnotation, TaskResultPack, TaskEventPack, FileSpecification, Task } from '@vitest/runner';
2
2
  import { FetchFunctionOptions, FetchResult, EvaluatedModules } from 'vite/module-runner';
3
- import { S as SerializedConfig } from './config.d.C4PpNy7v.js';
3
+ import { S as SerializedConfig } from './config.d.u2CUDWwS.js';
4
4
  import { E as Environment } from './environment.d.CrsxCzP1.js';
5
5
  import { SnapshotResult } from '@vitest/snapshot';
6
6
 
@@ -43,6 +43,80 @@ type LabelColor = "black" | "red" | "green" | "yellow" | "blue" | "magenta" | "c
43
43
  type ArgumentsType<T> = T extends (...args: infer A) => any ? A : never;
44
44
  type ReturnType<T> = T extends (...args: any) => infer R ? R : never;
45
45
  type PromisifyFn<T> = ReturnType<T> extends Promise<any> ? T : (...args: ArgumentsType<T>) => Promise<Awaited<ReturnType<T>>>;
46
+ type BirpcResolver = (name: string, resolved: (...args: unknown[]) => unknown) => ((...args: unknown[]) => unknown) | undefined;
47
+ interface ChannelOptions {
48
+ /**
49
+ * Function to post raw message
50
+ */
51
+ post: (data: any, ...extras: any[]) => any | Promise<any>;
52
+ /**
53
+ * Listener to receive raw message
54
+ */
55
+ on: (fn: (data: any, ...extras: any[]) => void) => any | Promise<any>;
56
+ /**
57
+ * Clear the listener when `$close` is called
58
+ */
59
+ off?: (fn: (data: any, ...extras: any[]) => void) => any | Promise<any>;
60
+ /**
61
+ * Custom function to serialize data
62
+ *
63
+ * by default it passes the data as-is
64
+ */
65
+ serialize?: (data: any) => any;
66
+ /**
67
+ * Custom function to deserialize data
68
+ *
69
+ * by default it passes the data as-is
70
+ */
71
+ deserialize?: (data: any) => any;
72
+ /**
73
+ * Call the methods with the RPC context or the original functions object
74
+ */
75
+ bind?: 'rpc' | 'functions';
76
+ }
77
+ interface EventOptions<Remote> {
78
+ /**
79
+ * Names of remote functions that do not need response.
80
+ */
81
+ eventNames?: (keyof Remote)[];
82
+ /**
83
+ * Maximum timeout for waiting for response, in milliseconds.
84
+ *
85
+ * @default 60_000
86
+ */
87
+ timeout?: number;
88
+ /**
89
+ * Custom resolver to resolve function to be called
90
+ *
91
+ * For advanced use cases only
92
+ */
93
+ resolver?: BirpcResolver;
94
+ /**
95
+ * Custom error handler
96
+ *
97
+ * @deprecated use `onFunctionError` and `onGeneralError` instead
98
+ */
99
+ onError?: (error: Error, functionName: string, args: any[]) => boolean | void;
100
+ /**
101
+ * Custom error handler for errors occurred in local functions being called
102
+ *
103
+ * @returns `true` to prevent the error from being thrown
104
+ */
105
+ onFunctionError?: (error: Error, functionName: string, args: any[]) => boolean | void;
106
+ /**
107
+ * Custom error handler for errors occurred during serialization or messsaging
108
+ *
109
+ * @returns `true` to prevent the error from being thrown
110
+ */
111
+ onGeneralError?: (error: Error, functionName?: string, args?: any[]) => boolean | void;
112
+ /**
113
+ * Custom error handler for timeouts
114
+ *
115
+ * @returns `true` to prevent the error from being thrown
116
+ */
117
+ onTimeoutError?: (functionName: string, args: any[]) => boolean | void;
118
+ }
119
+ type BirpcOptions<Remote> = EventOptions<Remote> & ChannelOptions;
46
120
  type BirpcFn<T> = PromisifyFn<T> & {
47
121
  /**
48
122
  * Send event without asking for response
@@ -96,13 +170,14 @@ interface ContextTestEnvironment {
96
170
  type TestExecutionMethod = "run" | "collect";
97
171
  interface ContextRPC {
98
172
  pool: string;
99
- workerId: number;
100
173
  config: SerializedConfig;
101
174
  projectName: string;
102
- files: string[] | FileSpecification[];
175
+ files: FileSpecification[];
103
176
  environment: ContextTestEnvironment;
104
177
  providedContext: Record<string, any>;
105
178
  invalidates?: string[];
179
+ /** Exposed to test runner as `VITEST_WORKER_ID`. Value is unique per each isolated worker. */
180
+ workerId: number;
106
181
  }
107
182
  interface WorkerGlobalState {
108
183
  ctx: ContextRPC;
@@ -133,4 +208,4 @@ interface WorkerGlobalState {
133
208
  onFilterStackTrace?: (trace: string) => string;
134
209
  }
135
210
 
136
- export type { AfterSuiteRunMeta as A, BirpcReturn as B, ContextRPC as C, LabelColor as L, ModuleGraphData as M, ProvidedContext as P, RunnerRPC as R, TestExecutionMethod as T, UserConsoleLog as U, WorkerGlobalState as W, RuntimeRPC as a, ContextTestEnvironment as b, ResolveFunctionResult as c };
211
+ export type { AfterSuiteRunMeta as A, BirpcOptions as B, ContextRPC as C, LabelColor as L, ModuleGraphData as M, ProvidedContext as P, RuntimeRPC as R, TestExecutionMethod as T, UserConsoleLog as U, WorkerGlobalState as W, BirpcReturn as a, RunnerRPC as b, ContextTestEnvironment as c, ResolveFunctionResult as d };
package/dist/cli.js CHANGED
@@ -1,21 +1,14 @@
1
- import { c as createCLI } from './chunks/cac.BO_6jvrs.js';
1
+ import { c as createCLI } from './chunks/cac.DCrQhweU.js';
2
2
  import '@vitest/utils/helpers';
3
3
  import 'events';
4
4
  import 'pathe';
5
5
  import 'tinyrainbow';
6
6
  import './chunks/constants.D_Q9UYh-.js';
7
- import './chunks/index.DehVUBn4.js';
7
+ import './chunks/index.CcRZ6fUh.js';
8
8
  import 'node:fs';
9
9
  import 'node:fs/promises';
10
- import './chunks/typechecker.DsKAhua5.js';
11
- import 'node:os';
12
10
  import 'node:perf_hooks';
13
- import 'tinyexec';
14
- import './path.js';
15
- import 'node:path';
16
- import 'node:url';
17
11
  import '@vitest/runner/utils';
18
- import 'vite';
19
12
  import '@vitest/utils/source-map';
20
13
  import './chunks/env.D4Lgay0q.js';
21
14
  import 'std-env';
@@ -23,6 +16,12 @@ import 'node:util';
23
16
  import 'node:console';
24
17
  import 'node:stream';
25
18
  import '@vitest/utils/display';
19
+ import 'node:os';
20
+ import 'tinyexec';
21
+ import './path.js';
22
+ import 'node:path';
23
+ import 'node:url';
24
+ import 'vite';
26
25
  import '@vitest/utils/offset';
27
26
  import 'node:module';
28
27
 
package/dist/config.cjs CHANGED
@@ -43,7 +43,6 @@ const configDefaults = Object.freeze({
43
43
  watch: !stdEnv.isCI && process.stdin.isTTY,
44
44
  globals: false,
45
45
  environment: "node",
46
- pool: "forks",
47
46
  clearMocks: false,
48
47
  restoreMocks: false,
49
48
  mockReset: false,
package/dist/config.d.ts CHANGED
@@ -1,12 +1,12 @@
1
1
  import { HookHandler, ConfigEnv, UserConfig } from 'vite';
2
2
  export { ConfigEnv, Plugin, UserConfig as ViteUserConfig, mergeConfig } from 'vite';
3
- import { I as InlineConfig, c as CoverageV8Options, R as ResolvedCoverageOptions, U as UserWorkspaceConfig, d as UserProjectConfigFn, e as UserProjectConfigExport } from './chunks/reporters.d.DAyr7w3M.js';
4
- export { a as TestProjectConfiguration, g as TestProjectInlineConfiguration, f as TestUserConfig, W as WatcherTriggerPattern } from './chunks/reporters.d.DAyr7w3M.js';
5
- import { V as VitestPluginContext } from './chunks/plugin.d.CqKwuCSa.js';
6
- import { F as FakeTimerInstallOpts } from './chunks/config.d.C4PpNy7v.js';
3
+ import { I as InlineConfig, c as CoverageV8Options, R as ResolvedCoverageOptions, U as UserWorkspaceConfig, d as UserProjectConfigFn, e as UserProjectConfigExport } from './chunks/reporters.d.C6nGyY9_.js';
4
+ export { a as TestProjectConfiguration, g as TestProjectInlineConfiguration, f as TestUserConfig, W as WatcherTriggerPattern } from './chunks/reporters.d.C6nGyY9_.js';
5
+ import { V as VitestPluginContext } from './chunks/plugin.d.BB__S31E.js';
6
+ import { F as FakeTimerInstallOpts } from './chunks/config.d.u2CUDWwS.js';
7
7
  import '@vitest/runner';
8
8
  import '@vitest/utils';
9
- import './chunks/worker.d.DSgBAZPX.js';
9
+ import './chunks/worker.d.BFk-vvBU.js';
10
10
  import 'vite/module-runner';
11
11
  import './chunks/environment.d.CrsxCzP1.js';
12
12
  import '@vitest/snapshot';
@@ -14,7 +14,7 @@ import 'node:stream';
14
14
  import '@vitest/mocker';
15
15
  import '@vitest/utils/source-map';
16
16
  import 'vitest/browser';
17
- import './chunks/browser.d.CCG7W26I.js';
17
+ import './chunks/browser.d.B9iJzZyn.js';
18
18
  import '@vitest/pretty-format';
19
19
  import '@vitest/utils/diff';
20
20
  import '@vitest/expect';
@@ -51,7 +51,6 @@ declare const configDefaults: Readonly<{
51
51
  watch: boolean;
52
52
  globals: boolean;
53
53
  environment: "node";
54
- pool: "forks";
55
54
  clearMocks: boolean;
56
55
  restoreMocks: boolean;
57
56
  mockReset: boolean;
package/dist/config.js CHANGED
@@ -1,4 +1,4 @@
1
- export { c as configDefaults, a as coverageConfigDefaults, d as defaultExclude, b as defaultInclude } from './chunks/defaults.CXFFjsi8.js';
1
+ export { c as configDefaults, a as coverageConfigDefaults, d as defaultExclude, b as defaultInclude } from './chunks/defaults.BOqNVLsY.js';
2
2
  export { mergeConfig } from 'vite';
3
3
  export { d as defaultBrowserPort } from './chunks/constants.D_Q9UYh-.js';
4
4
  import 'node:os';
@@ -1,17 +1,17 @@
1
- import { R as ResolvedCoverageOptions, V as Vitest, C as CoverageMap, b as ReportContext } from './chunks/reporters.d.DAyr7w3M.js';
1
+ import { R as ResolvedCoverageOptions, V as Vitest, C as CoverageMap, b as ReportContext } from './chunks/reporters.d.C6nGyY9_.js';
2
2
  import { TransformResult } from 'vite';
3
- import { A as AfterSuiteRunMeta } from './chunks/worker.d.DSgBAZPX.js';
3
+ import { A as AfterSuiteRunMeta } from './chunks/worker.d.BFk-vvBU.js';
4
4
  import '@vitest/runner';
5
5
  import '@vitest/utils';
6
6
  import 'node:stream';
7
7
  import '@vitest/mocker';
8
8
  import '@vitest/utils/source-map';
9
9
  import 'vitest/browser';
10
- import './chunks/config.d.C4PpNy7v.js';
10
+ import './chunks/config.d.u2CUDWwS.js';
11
11
  import '@vitest/pretty-format';
12
12
  import '@vitest/snapshot';
13
13
  import '@vitest/utils/diff';
14
- import './chunks/browser.d.CCG7W26I.js';
14
+ import './chunks/browser.d.B9iJzZyn.js';
15
15
  import '@vitest/expect';
16
16
  import 'vitest/optional-types.js';
17
17
  import './chunks/benchmark.d.DAaHLpsq.js';
package/dist/coverage.js CHANGED
@@ -1,4 +1,4 @@
1
- export { B as BaseCoverageProvider } from './chunks/coverage.3htTSxXZ.js';
1
+ export { B as BaseCoverageProvider } from './chunks/coverage.FU3w4IrQ.js';
2
2
  import 'node:fs';
3
3
  import 'node:path';
4
4
  import '@vitest/utils/helpers';
@@ -6,7 +6,7 @@ import 'pathe';
6
6
  import 'picomatch';
7
7
  import 'tinyglobby';
8
8
  import 'tinyrainbow';
9
- import './chunks/defaults.CXFFjsi8.js';
9
+ import './chunks/defaults.BOqNVLsY.js';
10
10
  import 'node:os';
11
11
  import './chunks/env.D4Lgay0q.js';
12
12
  import 'std-env';
@@ -20,15 +20,4 @@ import 'node:v8';
20
20
  import 'node:util';
21
21
  import 'vite';
22
22
  import './chunks/constants.D_Q9UYh-.js';
23
- import 'node:tty';
24
- import './path.js';
25
- import './chunks/typechecker.DsKAhua5.js';
26
- import 'node:perf_hooks';
27
- import 'tinyexec';
28
- import '@vitest/runner/utils';
29
- import 'debug';
30
- import 'node:events';
31
- import './chunks/index.Bgo3tNWt.js';
32
- import 'tinypool';
33
- import 'node:worker_threads';
34
23
  import './chunks/coverage.D_JHT54q.js';
@@ -1,2 +1,2 @@
1
- export { e as builtinEnvironments, p as populateGlobal } from './chunks/index.Bt-upxGS.js';
1
+ export { e as builtinEnvironments, p as populateGlobal } from './chunks/index.CbWINfS7.js';
2
2
  import 'node:console';
package/dist/index.d.ts CHANGED
@@ -1,25 +1,25 @@
1
- import { S as SerializedTestSpecification } from './chunks/browser.d.CCG7W26I.js';
2
- export { B as BrowserTesterOptions } from './chunks/browser.d.CCG7W26I.js';
3
- import './chunks/global.d.D1pbKXir.js';
1
+ import { S as SerializedTestSpecification } from './chunks/browser.d.B9iJzZyn.js';
2
+ export { B as BrowserTesterOptions } from './chunks/browser.d.B9iJzZyn.js';
3
+ import './chunks/global.d.BgJSTpgQ.js';
4
4
  import { File, TestAnnotation, TaskResultPack, TaskEventPack, TaskPopulated } from '@vitest/runner';
5
5
  export { CancelReason, ImportDuration, OnTestFailedHandler, OnTestFinishedHandler, RunMode, Task as RunnerTask, TaskBase as RunnerTaskBase, TaskEventPack as RunnerTaskEventPack, TaskResult as RunnerTaskResult, TaskResultPack as RunnerTaskResultPack, Test as RunnerTestCase, File as RunnerTestFile, Suite as RunnerTestSuite, SuiteAPI, SuiteCollector, SuiteFactory, TaskCustomOptions, TaskMeta, TaskState, TestAPI, TestAnnotation, TestContext, TestFunction, TestOptions, afterAll, afterEach, beforeAll, beforeEach, describe, it, onTestFailed, onTestFinished, suite, test } from '@vitest/runner';
6
6
  import { Awaitable } from '@vitest/utils';
7
7
  export { ParsedStack, SerializedError, TestError } from '@vitest/utils';
8
- import { U as UserConsoleLog, L as LabelColor, M as ModuleGraphData, B as BirpcReturn, P as ProvidedContext } from './chunks/worker.d.DSgBAZPX.js';
9
- export { A as AfterSuiteRunMeta, C as ContextRPC, b as ContextTestEnvironment, R as RunnerRPC, a as RuntimeRPC, T as TestExecutionMethod, W as WorkerGlobalState } from './chunks/worker.d.DSgBAZPX.js';
10
- import { S as SerializedConfig, F as FakeTimerInstallOpts, R as RuntimeOptions } from './chunks/config.d.C4PpNy7v.js';
11
- export { b as RuntimeConfig, a as SerializedCoverageConfig } from './chunks/config.d.C4PpNy7v.js';
8
+ import { U as UserConsoleLog, L as LabelColor, M as ModuleGraphData, a as BirpcReturn, P as ProvidedContext } from './chunks/worker.d.BFk-vvBU.js';
9
+ export { A as AfterSuiteRunMeta, C as ContextRPC, c as ContextTestEnvironment, b as RunnerRPC, R as RuntimeRPC, T as TestExecutionMethod, W as WorkerGlobalState } from './chunks/worker.d.BFk-vvBU.js';
10
+ import { S as SerializedConfig, F as FakeTimerInstallOpts, R as RuntimeOptions } from './chunks/config.d.u2CUDWwS.js';
11
+ export { b as RuntimeConfig, a as SerializedCoverageConfig } from './chunks/config.d.u2CUDWwS.js';
12
12
  import { ExpectStatic } from '@vitest/expect';
13
13
  export { Assertion, AsymmetricMatchersContaining, DeeplyAllowMatchers, ExpectPollOptions, ExpectStatic, JestAssertion, Matchers, chai } from '@vitest/expect';
14
14
  import { spyOn, fn, MaybeMockedDeep, MaybeMocked, MaybePartiallyMocked, MaybePartiallyMockedDeep, MockInstance } from '@vitest/spy';
15
15
  export { Mock, MockContext, MockInstance, Mocked, MockedClass, MockedFunction, MockedObject } from '@vitest/spy';
16
16
  import { M as MockFactoryWithHelper, a as MockOptions } from './chunks/mocker.d.BE_2ls6u.js';
17
17
  export { b as bench } from './chunks/suite.d.BJWk38HB.js';
18
+ import { EvaluatedModules } from 'vite/module-runner';
18
19
  export { a as BenchFunction, b as Benchmark, c as BenchmarkAPI, B as BenchmarkResult } from './chunks/benchmark.d.DAaHLpsq.js';
19
20
  export { ExpectTypeOf, expectTypeOf } from 'expect-type';
20
21
  export { SnapshotData, SnapshotMatchOptions, SnapshotResult, SnapshotSerializer, SnapshotStateOptions, SnapshotSummary, SnapshotUpdateState, UncheckedSnapshot } from '@vitest/snapshot';
21
22
  export { DiffOptions } from '@vitest/utils/diff';
22
- export { EvaluatedModules } from 'vite/module-runner';
23
23
  export { Bench as BenchFactory, Options as BenchOptions, Task as BenchTask, TaskResult as BenchTaskResult } from 'tinybench';
24
24
  import '@vitest/pretty-format';
25
25
  import './chunks/environment.d.CrsxCzP1.js';
@@ -476,6 +476,10 @@ interface VitestUtils {
476
476
  declare const vitest: VitestUtils;
477
477
  declare const vi: VitestUtils;
478
478
 
479
+ declare class VitestEvaluatedModules extends EvaluatedModules {
480
+ getModuleSourceMapById(id: string): any;
481
+ }
482
+
479
483
  interface AssertType {
480
484
  <T>(value: T): void;
481
485
  }
@@ -486,5 +490,5 @@ interface BrowserUI {
486
490
  setIframeViewport: (width: number, height: number) => Promise<void>;
487
491
  }
488
492
 
489
- export { LabelColor, ModuleGraphData, ProvidedContext, SerializedConfig, SerializedTestSpecification, UserConsoleLog, assert, assertType, createExpect, globalExpect as expect, inject, should, vi, vitest };
493
+ export { VitestEvaluatedModules as EvaluatedModules, LabelColor, ModuleGraphData, ProvidedContext, SerializedConfig, SerializedTestSpecification, UserConsoleLog, assert, assertType, createExpect, globalExpect as expect, inject, should, vi, vitest };
490
494
  export type { AssertType, BrowserUI, TransformResultWithSource, VitestUtils, WebSocketEvents, WebSocketHandlers, WebSocketRPC };
package/dist/index.js CHANGED
@@ -1,9 +1,9 @@
1
- export { b as assert, c as createExpect, g as expect, i as inject, s as should, v as vi, d as vitest } from './chunks/vi.B2--mG9U.js';
1
+ export { b as assert, c as createExpect, g as expect, i as inject, s as should, v as vi, d as vitest } from './chunks/vi.BZvkKVkM.js';
2
2
  export { b as bench } from './chunks/benchmark.DHKMYAts.js';
3
- export { a as assertType } from './chunks/index.Dnl38iQ_.js';
3
+ export { V as EvaluatedModules } from './chunks/evaluatedModules.Dg1zASAC.js';
4
+ export { a as assertType } from './chunks/index.RwjEGCQ0.js';
4
5
  export { expectTypeOf } from 'expect-type';
5
6
  export { afterAll, afterEach, beforeAll, beforeEach, describe, it, onTestFailed, onTestFinished, suite, test } from '@vitest/runner';
6
- export { EvaluatedModules } from 'vite/module-runner';
7
7
  export { chai } from '@vitest/expect';
8
8
  import '@vitest/runner/utils';
9
9
  import './chunks/utils.CG9h5ccR.js';
@@ -16,3 +16,5 @@ import '@vitest/utils/offset';
16
16
  import '@vitest/utils/source-map';
17
17
  import './chunks/_commonjsHelpers.BFTU3MAI.js';
18
18
  import './chunks/date.-jtEtIeV.js';
19
+ import 'pathe';
20
+ import 'vite/module-runner';
@@ -1,10 +1,10 @@
1
1
  import 'vite/module-runner';
2
- export { b as VitestModuleEvaluator, a as VitestModuleEvaluatorOptions, c as createImportMetaEnvProxy, g as getDefaultRequestStubs, i as isPrimitive, u as unwrapId, w as wrapId } from './chunks/moduleRunner.d.aXWuQhZN.js';
2
+ export { b as VitestModuleEvaluator, a as VitestModuleEvaluatorOptions, c as createImportMetaEnvProxy, g as getDefaultRequestStubs, i as isPrimitive, u as unwrapId, w as wrapId } from './chunks/moduleRunner.d.YtNsMIoJ.js';
3
3
  import 'node:vm';
4
4
  import '@vitest/spy';
5
- import './chunks/worker.d.DSgBAZPX.js';
5
+ import './chunks/worker.d.BFk-vvBU.js';
6
6
  import '@vitest/runner';
7
- import './chunks/config.d.C4PpNy7v.js';
7
+ import './chunks/config.d.u2CUDWwS.js';
8
8
  import '@vitest/pretty-format';
9
9
  import '@vitest/snapshot';
10
10
  import '@vitest/utils/diff';
@@ -1,5 +1,5 @@
1
1
  export { VitestModuleEvaluator } from './module-evaluator.js';
2
- export { a as VITEST_VM_CONTEXT_SYMBOL, V as VitestModuleRunner, s as startVitestModuleRunner } from './chunks/startModuleRunner.DPBo3mme.js';
2
+ export { a as VITEST_VM_CONTEXT_SYMBOL, V as VitestModuleRunner, s as startVitestModuleRunner } from './chunks/startModuleRunner.C2tTvmF9.js';
3
3
  export { g as getWorkerState } from './chunks/utils.CG9h5ccR.js';
4
4
  import 'node:module';
5
5
  import 'node:url';