vitest 4.0.13 → 4.0.15

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 (50) hide show
  1. package/dist/browser.d.ts +1 -1
  2. package/dist/browser.js +1 -1
  3. package/dist/chunks/{base.Dqf2QAxh.js → base.CTp-EStD.js} +6 -6
  4. package/dist/chunks/browser.d.DBzUq_Na.d.ts +57 -0
  5. package/dist/chunks/{cac.L-UbQ_Ix.js → cac.BNNpZQl7.js} +10 -25
  6. package/dist/chunks/{cli-api.CdZ6wo9-.js → cli-api.C7sYjHmQ.js} +442 -110
  7. package/dist/chunks/{config.d.g6OOauRt.d.ts → config.d.CzIjkicf.d.ts} +1 -0
  8. package/dist/chunks/evaluatedModules.d.BxJ5omdx.d.ts +7 -0
  9. package/dist/chunks/{globals.C0izxiX3.js → globals.DOayXfHP.js} +3 -3
  10. package/dist/chunks/{index.DWDW6mLz.js → index.456_DGfR.js} +137 -22
  11. package/dist/chunks/{index.QWbK7rHY.js → index.BspFP3mn.js} +12 -7
  12. package/dist/chunks/{index.CMvpbrsJ.js → index.Drsj_6e7.js} +1 -1
  13. package/dist/chunks/{index.DBx1AtPJ.js → index.Z5E_ObnR.js} +1 -1
  14. package/dist/chunks/{index.CQwQ_SLL.js → index.bFLgAE-Z.js} +2 -2
  15. package/dist/chunks/{init-forks.CglOH45c.js → init-forks.CKEYp90N.js} +11 -2
  16. package/dist/chunks/{init-threads.BuMdIy1r.js → init-threads.D8Ok07M7.js} +1 -1
  17. package/dist/chunks/{init.MkYs5nmh.js → init.B04saIIg.js} +4 -4
  18. package/dist/chunks/modules.DJPjQW6m.js +35 -0
  19. package/dist/chunks/{plugin.d.B4l3vYM_.d.ts → plugin.d.CY7CUjf-.d.ts} +1 -1
  20. package/dist/chunks/{reporters.d.J2RlBlp9.d.ts → reporters.d.OXEK7y4s.d.ts} +29 -6
  21. package/dist/chunks/{setup-common.DGHc_BUK.js → setup-common.Cm-kSBVi.js} +1 -1
  22. package/dist/chunks/{startModuleRunner.W28wBIgJ.js → startModuleRunner.Iz2V0ESw.js} +8 -9
  23. package/dist/chunks/{test.DqQZzsWf.js → test.BT8LKgU9.js} +8 -3
  24. package/dist/chunks/{vi.BiaV1qII.js → vi.2VT5v0um.js} +40 -30
  25. package/dist/chunks/{vm.Y19jrZy2.js → vm.BwmD1Rql.js} +2 -2
  26. package/dist/chunks/{worker.d.DCy61tzi.d.ts → worker.d.B4A26qg6.d.ts} +2 -2
  27. package/dist/cli.js +2 -2
  28. package/dist/config.d.ts +7 -7
  29. package/dist/coverage.d.ts +8 -8
  30. package/dist/environments.js +1 -1
  31. package/dist/index.d.ts +22 -14
  32. package/dist/index.js +3 -3
  33. package/dist/module-evaluator.d.ts +5 -0
  34. package/dist/module-evaluator.js +23 -5
  35. package/dist/module-runner.js +2 -1
  36. package/dist/node.d.ts +8 -8
  37. package/dist/node.js +7 -6
  38. package/dist/reporters.d.ts +7 -7
  39. package/dist/reporters.js +2 -2
  40. package/dist/runners.d.ts +2 -1
  41. package/dist/runners.js +2 -2
  42. package/dist/worker.d.ts +2 -2
  43. package/dist/worker.js +10 -9
  44. package/dist/workers/forks.js +11 -10
  45. package/dist/workers/runVmTests.js +5 -5
  46. package/dist/workers/threads.js +11 -10
  47. package/dist/workers/vmForks.js +6 -5
  48. package/dist/workers/vmThreads.js +6 -5
  49. package/package.json +15 -20
  50. package/dist/chunks/browser.d.CDvMh6F9.d.ts +0 -18
@@ -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.BiaV1qII.js';
10
+ import { a as getSnapshotClient, i as inject, c as createExpect, v as vi } from './vi.2VT5v0um.js';
11
11
  import { r as rpc } from './rpc.BytlcPfC.js';
12
12
 
13
13
  function createBenchmarkResult(name) {
@@ -122,8 +122,11 @@ class VitestTestRunner {
122
122
  assertionsErrors = /* @__PURE__ */ new WeakMap();
123
123
  pool = this.workerState.ctx.pool;
124
124
  _otel;
125
+ viteEnvironment;
125
126
  constructor(config) {
126
127
  this.config = config;
128
+ const environment = this.workerState.environment;
129
+ this.viteEnvironment = environment.viteEnvironment || environment.name;
127
130
  }
128
131
  importFile(filepath, source) {
129
132
  if (source === "setup") {
@@ -223,9 +226,11 @@ class VitestTestRunner {
223
226
  getImportDurations() {
224
227
  const importDurations = {};
225
228
  const entries = this.workerState.moduleExecutionInfo?.entries() || [];
226
- for (const [filepath, { duration, selfTime }] of entries) importDurations[normalize(filepath)] = {
229
+ for (const [filepath, { duration, selfTime, external, importer }] of entries) importDurations[normalize(filepath)] = {
227
230
  selfTime,
228
- totalTime: duration
231
+ totalTime: duration,
232
+ external,
233
+ importer
229
234
  };
230
235
  return importDurations;
231
236
  }
@@ -1,8 +1,8 @@
1
1
  import { chai, equals, iterableEquality, subsetEquality, JestExtend, JestChaiExpect, JestAsymmetricMatchers, GLOBAL_EXPECT, ASYMMETRIC_MATCHERS_OBJECT, getState, setState, addCustomEqualityTesters, customMatchers } from '@vitest/expect';
2
2
  import { getCurrentTest } from '@vitest/runner';
3
- import { getNames, getTestName } from '@vitest/runner/utils';
4
3
  import { g as getWorkerState, i as isChildProcess, w as waitForImportsToResolve, r as resetModules } from './utils.DvEY5TfP.js';
5
- import { getSafeTimers } from '@vitest/utils/timers';
4
+ import { getSafeTimers, delay } from '@vitest/utils/timers';
5
+ import { getNames } from '@vitest/runner/utils';
6
6
  import { stripSnapshotIndentation, addSerializer, SnapshotClient } from '@vitest/snapshot';
7
7
  import '@vitest/utils/error';
8
8
  import { assertTypes, createSimpleStackTrace } from '@vitest/utils/helpers';
@@ -25,6 +25,18 @@ const unsupported = [
25
25
  "toThrow",
26
26
  "toThrowError"
27
27
  ];
28
+ /**
29
+ * Attaches a `cause` property to the error if missing, copies the stack trace from the source, and throws.
30
+ *
31
+ * @param error - The error to throw
32
+ * @param source - Error to copy the stack trace from
33
+ *
34
+ * @throws Always throws the provided error with an amended stack trace
35
+ */
36
+ function throwWithCause(error, source) {
37
+ if (error.cause == null) error.cause = /* @__PURE__ */ new Error("Matcher did not succeed in time.");
38
+ throw copyStackTrace$1(error, source);
39
+ }
28
40
  function createExpectPoll(expect) {
29
41
  return function poll(fn, options = {}) {
30
42
  const defaults = getWorkerState().config.expect?.poll ?? {};
@@ -41,35 +53,33 @@ function createExpectPoll(expect) {
41
53
  if (typeof key === "string" && unsupported.includes(key)) throw new SyntaxError(`expect.poll() is not supported in combination with .${key}(). Use vi.waitFor() if your assertion condition is unstable.`);
42
54
  return function(...args) {
43
55
  const STACK_TRACE_ERROR = /* @__PURE__ */ new Error("STACK_TRACE_ERROR");
44
- const promise = () => new Promise((resolve, reject) => {
45
- let intervalId;
46
- let timeoutId;
47
- let lastError;
56
+ const promise = async () => {
48
57
  const { setTimeout, clearTimeout } = getSafeTimers();
49
- const check = async () => {
50
- try {
51
- chai.util.flag(assertion, "_name", key);
52
- const obj = await fn();
53
- chai.util.flag(assertion, "object", obj);
54
- resolve(await assertionFunction.call(assertion, ...args));
55
- clearTimeout(intervalId);
56
- clearTimeout(timeoutId);
57
- } catch (err) {
58
- lastError = err;
59
- if (!chai.util.flag(assertion, "_isLastPollAttempt")) intervalId = setTimeout(check, interval);
60
- }
61
- };
62
- timeoutId = setTimeout(() => {
63
- clearTimeout(intervalId);
64
- chai.util.flag(assertion, "_isLastPollAttempt", true);
65
- const rejectWithCause = (error) => {
66
- if (error.cause == null) error.cause = /* @__PURE__ */ new Error("Matcher did not succeed in time.");
67
- reject(copyStackTrace$1(error, STACK_TRACE_ERROR));
68
- };
69
- check().then(() => rejectWithCause(lastError)).catch((e) => rejectWithCause(e));
58
+ let executionPhase = "fn";
59
+ let hasTimedOut = false;
60
+ const timerId = setTimeout(() => {
61
+ hasTimedOut = true;
70
62
  }, timeout);
71
- check();
72
- });
63
+ chai.util.flag(assertion, "_name", key);
64
+ try {
65
+ while (true) {
66
+ const isLastAttempt = hasTimedOut;
67
+ if (isLastAttempt) chai.util.flag(assertion, "_isLastPollAttempt", true);
68
+ try {
69
+ executionPhase = "fn";
70
+ const obj = await fn();
71
+ chai.util.flag(assertion, "object", obj);
72
+ executionPhase = "assertion";
73
+ return await assertionFunction.call(assertion, ...args);
74
+ } catch (err) {
75
+ if (isLastAttempt || executionPhase === "assertion" && chai.util.flag(assertion, "_poll.assert_once")) throwWithCause(err, STACK_TRACE_ERROR);
76
+ await delay(interval, setTimeout);
77
+ }
78
+ }
79
+ } finally {
80
+ clearTimeout(timerId);
81
+ }
82
+ };
73
83
  let awaited = false;
74
84
  test.onFinished ??= [];
75
85
  test.onFinished.push(() => {
@@ -315,7 +325,7 @@ function createExpect(test) {
315
325
  get testPath() {
316
326
  return getWorkerState().filepath;
317
327
  },
318
- currentTestName: test ? getTestName(test) : globalState.currentTestName
328
+ currentTestName: test ? test.fullTestName ?? "" : globalState.currentTestName
319
329
  }, expect);
320
330
  expect.assert = chai.assert;
321
331
  // @ts-expect-error untyped
@@ -1,7 +1,7 @@
1
1
  import { fileURLToPath, pathToFileURL } from 'node:url';
2
2
  import vm, { isContext, runInContext } from 'node:vm';
3
3
  import { dirname, basename, extname, normalize, resolve } from 'pathe';
4
- import { l as loadEnvironment } from './init.MkYs5nmh.js';
4
+ import { l as loadEnvironment } from './init.B04saIIg.js';
5
5
  import { distDir } from '../path.js';
6
6
  import { createCustomConsole } from './console.Cf-YriPC.js';
7
7
  import fs from 'node:fs';
@@ -11,7 +11,7 @@ import { findNearestPackageData } from '@vitest/utils/resolver';
11
11
  import { dirname as dirname$1 } from 'node:path';
12
12
  import { CSS_LANGS_RE, KNOWN_ASSET_RE } from '@vitest/utils/constants';
13
13
  import { getDefaultRequestStubs } from '../module-evaluator.js';
14
- import { s as startVitestModuleRunner, c as createNodeImportMeta, a as VITEST_VM_CONTEXT_SYMBOL } from './startModuleRunner.W28wBIgJ.js';
14
+ import { s as startVitestModuleRunner, c as createNodeImportMeta, a as VITEST_VM_CONTEXT_SYMBOL } from './startModuleRunner.Iz2V0ESw.js';
15
15
  import { p as provideWorkerState } from './utils.DvEY5TfP.js';
16
16
 
17
17
  function interopCommonJsModule(interopDefault, mod) {
@@ -1,6 +1,6 @@
1
1
  import { FileSpecification, Task, CancelReason } from '@vitest/runner';
2
2
  import { EvaluatedModules } from 'vite/module-runner';
3
- import { S as SerializedConfig } from './config.d.g6OOauRt.js';
3
+ import { S as SerializedConfig } from './config.d.CzIjkicf.js';
4
4
  import { E as Environment } from './environment.d.CrsxCzP1.js';
5
5
  import { R as RuntimeRPC, a as RunnerRPC } from './rpc.d.RH3apGEf.js';
6
6
 
@@ -235,4 +235,4 @@ interface WorkerGlobalState {
235
235
  onFilterStackTrace?: (trace: string) => string;
236
236
  }
237
237
 
238
- export type { BirpcOptions as B, ContextRPC as C, TestExecutionMethod as T, WorkerGlobalState as W, WorkerSetupContext as a, BirpcReturn as b, ContextTestEnvironment as c, WorkerTestEnvironment as d, WorkerExecuteContext as e };
238
+ export type { BirpcOptions as B, ContextRPC as C, TestExecutionMethod as T, WorkerGlobalState as W, WorkerSetupContext as a, BirpcReturn as b, ContextTestEnvironment as c, WorkerExecuteContext as d, WorkerTestEnvironment as e };
package/dist/cli.js CHANGED
@@ -1,10 +1,10 @@
1
- import { c as createCLI } from './chunks/cac.L-UbQ_Ix.js';
1
+ import { c as createCLI } from './chunks/cac.BNNpZQl7.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.DWDW6mLz.js';
7
+ import './chunks/index.456_DGfR.js';
8
8
  import 'node:fs';
9
9
  import 'node:fs/promises';
10
10
  import 'node:perf_hooks';
package/dist/config.d.ts CHANGED
@@ -1,9 +1,9 @@
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.J2RlBlp9.js';
4
- export { b as TestProjectConfiguration, g as TestProjectInlineConfiguration, f as TestUserConfig, W as WatcherTriggerPattern } from './chunks/reporters.d.J2RlBlp9.js';
5
- import { V as VitestPluginContext } from './chunks/plugin.d.B4l3vYM_.js';
6
- import { F as FakeTimerInstallOpts } from './chunks/config.d.g6OOauRt.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.OXEK7y4s.js';
4
+ export { b as TestProjectConfiguration, g as TestProjectInlineConfiguration, f as TestUserConfig, W as WatcherTriggerPattern } from './chunks/reporters.d.OXEK7y4s.js';
5
+ import { V as VitestPluginContext } from './chunks/plugin.d.CY7CUjf-.js';
6
+ import { F as FakeTimerInstallOpts } from './chunks/config.d.CzIjkicf.js';
7
7
  import '@vitest/runner';
8
8
  import '@vitest/utils';
9
9
  import './chunks/rpc.d.RH3apGEf.js';
@@ -11,12 +11,12 @@ import '@vitest/snapshot';
11
11
  import 'vite/module-runner';
12
12
  import './chunks/traces.d.402V_yFI.js';
13
13
  import 'node:stream';
14
+ import './chunks/browser.d.DBzUq_Na.js';
15
+ import './chunks/worker.d.B4A26qg6.js';
16
+ import './chunks/environment.d.CrsxCzP1.js';
14
17
  import '@vitest/mocker';
15
18
  import '@vitest/utils/source-map';
16
19
  import 'vitest/browser';
17
- import './chunks/browser.d.CDvMh6F9.js';
18
- import './chunks/worker.d.DCy61tzi.js';
19
- import './chunks/environment.d.CrsxCzP1.js';
20
20
  import '@vitest/pretty-format';
21
21
  import '@vitest/utils/diff';
22
22
  import '@vitest/expect';
@@ -1,20 +1,20 @@
1
- import { R as ResolvedCoverageOptions, V as Vitest, C as CoverageMap, a as ReportContext } from './chunks/reporters.d.J2RlBlp9.js';
1
+ import { R as ResolvedCoverageOptions, V as Vitest, C as CoverageMap, a as ReportContext } from './chunks/reporters.d.OXEK7y4s.js';
2
2
  import { TransformResult } from 'vite';
3
3
  import { A as AfterSuiteRunMeta } from './chunks/rpc.d.RH3apGEf.js';
4
4
  import '@vitest/runner';
5
5
  import '@vitest/utils';
6
6
  import 'node:stream';
7
- import '@vitest/mocker';
8
- import '@vitest/utils/source-map';
9
- import 'vitest/browser';
10
- import './chunks/config.d.g6OOauRt.js';
7
+ import './chunks/browser.d.DBzUq_Na.js';
8
+ import './chunks/worker.d.B4A26qg6.js';
9
+ import 'vite/module-runner';
10
+ import './chunks/config.d.CzIjkicf.js';
11
11
  import '@vitest/pretty-format';
12
12
  import '@vitest/snapshot';
13
13
  import '@vitest/utils/diff';
14
- import './chunks/browser.d.CDvMh6F9.js';
15
- import './chunks/worker.d.DCy61tzi.js';
16
- import 'vite/module-runner';
17
14
  import './chunks/environment.d.CrsxCzP1.js';
15
+ import '@vitest/mocker';
16
+ import '@vitest/utils/source-map';
17
+ import 'vitest/browser';
18
18
  import '@vitest/expect';
19
19
  import 'vitest/optional-types.js';
20
20
  import './chunks/traces.d.402V_yFI.js';
@@ -1,3 +1,3 @@
1
- export { e as builtinEnvironments, p as populateGlobal } from './chunks/index.QWbK7rHY.js';
1
+ export { e as builtinEnvironments, p as populateGlobal } from './chunks/index.BspFP3mn.js';
2
2
  import 'node:url';
3
3
  import 'node:console';
package/dist/index.d.ts CHANGED
@@ -1,14 +1,14 @@
1
- import { S as SerializedTestSpecification } from './chunks/browser.d.CDvMh6F9.js';
2
- export { B as BrowserTesterOptions } from './chunks/browser.d.CDvMh6F9.js';
1
+ import { M as ModuleDefinitionDurationsDiagnostic, U as UntrackedModuleDefinitionDiagnostic, S as SerializedTestSpecification, a as ModuleDefinitionDiagnostic, b as ModuleDefinitionLocation, c as SourceModuleDiagnostic, d as SourceModuleLocations } from './chunks/browser.d.DBzUq_Na.js';
2
+ export { B as BrowserTesterOptions } from './chunks/browser.d.DBzUq_Na.js';
3
3
  import './chunks/global.d.B15mdLcR.js';
4
4
  import { File, TestAnnotation, TestArtifact, TaskResultPack, TaskEventPack, Test, 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, TestAnnotationArtifact, TestArtifact, TestArtifactBase, TestArtifactLocation, TestArtifactRegistry, TestAttachment, TestContext, TestFunction, TestOptions, afterAll, afterEach, beforeAll, beforeEach, describe, it, onTestFailed, onTestFinished, recordArtifact, suite, test } from '@vitest/runner';
6
6
  import { Awaitable } from '@vitest/utils';
7
7
  export { ParsedStack, SerializedError, TestError } from '@vitest/utils';
8
- import { b as BirpcReturn } from './chunks/worker.d.DCy61tzi.js';
9
- export { C as ContextRPC, c as ContextTestEnvironment, T as TestExecutionMethod, W as WorkerGlobalState } from './chunks/worker.d.DCy61tzi.js';
10
- import { S as SerializedConfig, F as FakeTimerInstallOpts, R as RuntimeOptions } from './chunks/config.d.g6OOauRt.js';
11
- export { b as RuntimeConfig, a as SerializedCoverageConfig } from './chunks/config.d.g6OOauRt.js';
8
+ import { b as BirpcReturn } from './chunks/worker.d.B4A26qg6.js';
9
+ export { C as ContextRPC, c as ContextTestEnvironment, T as TestExecutionMethod, W as WorkerGlobalState } from './chunks/worker.d.B4A26qg6.js';
10
+ import { S as SerializedConfig, F as FakeTimerInstallOpts, R as RuntimeOptions } from './chunks/config.d.CzIjkicf.js';
11
+ export { b as RuntimeConfig, a as SerializedCoverageConfig } from './chunks/config.d.CzIjkicf.js';
12
12
  import { U as UserConsoleLog, L as LabelColor, M as ModuleGraphData, P as ProvidedContext } from './chunks/rpc.d.RH3apGEf.js';
13
13
  export { A as AfterSuiteRunMeta, a as RunnerRPC, R as RuntimeRPC } from './chunks/rpc.d.RH3apGEf.js';
14
14
  import { ExpectStatic } from '@vitest/expect';
@@ -16,13 +16,14 @@ export { Assertion, AsymmetricMatchersContaining, DeeplyAllowMatchers, ExpectPol
16
16
  import { spyOn, fn, MaybeMockedDeep, MaybeMocked, MaybePartiallyMocked, MaybePartiallyMockedDeep, MockInstance } from '@vitest/spy';
17
17
  export { Mock, MockContext, MockInstance, MockResult, MockResultIncomplete, MockResultReturn, MockResultThrow, MockSettledResult, MockSettledResultFulfilled, MockSettledResultIncomplete, MockSettledResultRejected, Mocked, MockedClass, MockedFunction, MockedObject } from '@vitest/spy';
18
18
  export { b as bench } from './chunks/suite.d.BJWk38HB.js';
19
- import { EvaluatedModules } from 'vite/module-runner';
19
+ export { V as EvaluatedModules } from './chunks/evaluatedModules.d.BxJ5omdx.js';
20
20
  export { a as BenchFunction, b as Benchmark, c as BenchmarkAPI, B as BenchmarkResult } from './chunks/benchmark.d.DAaHLpsq.js';
21
21
  export { ExpectTypeOf, expectTypeOf } from 'expect-type';
22
22
  export { SnapshotData, SnapshotMatchOptions, SnapshotResult, SnapshotSerializer, SnapshotStateOptions, SnapshotSummary, SnapshotUpdateState, UncheckedSnapshot } from '@vitest/snapshot';
23
23
  export { DiffOptions } from '@vitest/utils/diff';
24
24
  export { Bench as BenchFactory, Options as BenchOptions, Task as BenchTask, TaskResult as BenchTaskResult } from 'tinybench';
25
25
  import '@vitest/pretty-format';
26
+ import 'vite/module-runner';
26
27
  import './chunks/environment.d.CrsxCzP1.js';
27
28
  import './chunks/traces.d.402V_yFI.js';
28
29
  import '@vitest/runner/utils';
@@ -37,6 +38,9 @@ interface SourceMap {
37
38
  toString: () => string;
38
39
  toUrl: () => string;
39
40
  }
41
+ interface ExternalResult {
42
+ source?: string;
43
+ }
40
44
  interface TransformResultWithSource {
41
45
  code: string;
42
46
  map: SourceMap | {
@@ -46,6 +50,9 @@ interface TransformResultWithSource {
46
50
  deps?: string[];
47
51
  dynamicDeps?: string[];
48
52
  source?: string;
53
+ transformTime?: number;
54
+ modules?: ModuleDefinitionDurationsDiagnostic[];
55
+ untrackedModules?: UntrackedModuleDefinitionDiagnostic[];
49
56
  }
50
57
  interface WebSocketHandlers {
51
58
  onTaskUpdate: (packs: TaskResultPack[], events: TaskEventPack[]) => void;
@@ -58,7 +65,8 @@ interface WebSocketHandlers {
58
65
  color?: LabelColor;
59
66
  }[];
60
67
  getModuleGraph: (projectName: string, id: string, browser?: boolean) => Promise<ModuleGraphData>;
61
- getTransformResult: (projectName: string, id: string, browser?: boolean) => Promise<TransformResultWithSource | undefined>;
68
+ getTransformResult: (projectName: string, id: string, testFileId: string, browser?: boolean) => Promise<TransformResultWithSource | undefined>;
69
+ getExternalResult: (id: string, testFileId: string) => Promise<ExternalResult | undefined>;
62
70
  readTestFile: (id: string) => Promise<string | null>;
63
71
  saveTestFile: (id: string, content: string) => Promise<void>;
64
72
  rerun: (files: string[], resetTestNamePattern?: boolean) => Promise<void>;
@@ -484,10 +492,6 @@ interface VitestUtils {
484
492
  declare const vitest: VitestUtils;
485
493
  declare const vi: VitestUtils;
486
494
 
487
- declare class VitestEvaluatedModules extends EvaluatedModules {
488
- getModuleSourceMapById(id: string): any;
489
- }
490
-
491
495
  interface AssertType {
492
496
  <T>(value: T): void;
493
497
  }
@@ -498,5 +502,9 @@ interface BrowserUI {
498
502
  setIframeViewport: (width: number, height: number) => Promise<void>;
499
503
  }
500
504
 
501
- export { VitestEvaluatedModules as EvaluatedModules, LabelColor, ModuleGraphData, ProvidedContext, SerializedConfig, SerializedTestSpecification, UserConsoleLog, assert, assertType, createExpect, globalExpect as expect, inject, should, vi, vitest };
502
- export type { AssertType, BrowserUI, TransformResultWithSource, VitestUtils, WebSocketEvents, WebSocketHandlers, WebSocketRPC };
505
+ declare namespace Experimental {
506
+ export { ModuleDefinitionDiagnostic, ModuleDefinitionDurationsDiagnostic, ModuleDefinitionLocation, SourceModuleDiagnostic, SourceModuleLocations, UntrackedModuleDefinitionDiagnostic };
507
+ }
508
+
509
+ export { Experimental, LabelColor, ModuleGraphData, ProvidedContext, SerializedConfig, SerializedTestSpecification, UserConsoleLog, assert, assertType, createExpect, globalExpect as expect, inject, should, vi, vitest };
510
+ export type { AssertType, BrowserUI, ExternalResult, TransformResultWithSource, VitestUtils, WebSocketEvents, WebSocketHandlers, WebSocketRPC };
package/dist/index.js CHANGED
@@ -1,13 +1,13 @@
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.BiaV1qII.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.2VT5v0um.js';
2
2
  export { b as bench } from './chunks/benchmark.B3N2zMcH.js';
3
3
  export { V as EvaluatedModules } from './chunks/evaluatedModules.Dg1zASAC.js';
4
- export { a as assertType } from './chunks/index.DBx1AtPJ.js';
4
+ export { a as assertType } from './chunks/index.Z5E_ObnR.js';
5
5
  export { expectTypeOf } from 'expect-type';
6
6
  export { afterAll, afterEach, beforeAll, beforeEach, describe, it, onTestFailed, onTestFinished, recordArtifact, suite, test } from '@vitest/runner';
7
7
  export { chai } from '@vitest/expect';
8
- import '@vitest/runner/utils';
9
8
  import './chunks/utils.DvEY5TfP.js';
10
9
  import '@vitest/utils/timers';
10
+ import '@vitest/runner/utils';
11
11
  import '@vitest/snapshot';
12
12
  import '@vitest/utils/error';
13
13
  import '@vitest/utils/helpers';
@@ -1,4 +1,5 @@
1
1
  import { ModuleEvaluator, ModuleRunnerImportMeta, ModuleRunnerContext, EvaluatedModuleNode } from 'vite/module-runner';
2
+ import { V as VitestEvaluatedModules } from './chunks/evaluatedModules.d.BxJ5omdx.js';
2
3
  import vm from 'node:vm';
3
4
  import { R as RuntimeRPC } from './chunks/rpc.d.RH3apGEf.js';
4
5
  import '@vitest/runner';
@@ -12,6 +13,8 @@ interface ModuleExecutionInfoEntry {
12
13
  duration: number;
13
14
  /** The time that was spent executing the module itself and externalized imports. */
14
15
  selfTime: number;
16
+ external?: boolean;
17
+ importer?: string;
15
18
  }
16
19
 
17
20
  declare class FileMap {
@@ -85,6 +88,7 @@ interface VitestVmOptions {
85
88
  }
86
89
 
87
90
  interface VitestModuleEvaluatorOptions {
91
+ evaluatedModules?: VitestEvaluatedModules;
88
92
  interopDefault?: boolean | undefined;
89
93
  moduleExecutionInfo?: ModuleExecutionInfo;
90
94
  getCurrentTestFilepath?: () => string | undefined;
@@ -101,6 +105,7 @@ declare class VitestModuleEvaluator implements ModuleEvaluator {
101
105
  private primitives;
102
106
  private debug;
103
107
  private _otel;
108
+ private _evaluatedModules?;
104
109
  constructor(vmOptions?: VitestVmOptions | undefined, options?: VitestModuleEvaluatorOptions);
105
110
  private convertIdToImportUrl;
106
111
  runExternalModule(id: string): Promise<any>;
@@ -1,5 +1,5 @@
1
1
  import { isBuiltin, createRequire } from 'node:module';
2
- import { pathToFileURL } from 'node:url';
2
+ import { pathToFileURL, fileURLToPath } from 'node:url';
3
3
  import vm from 'node:vm';
4
4
  import { isAbsolute } from 'pathe';
5
5
  import { ssrModuleExportsKey, ssrImportMetaKey, ssrImportKey, ssrDynamicImportKey, ssrExportAllKey } from 'vite/module-runner';
@@ -8,7 +8,7 @@ import { T as Traces } from './chunks/traces.U4xDYhzZ.js';
8
8
  const performanceNow = performance.now.bind(performance);
9
9
  class ModuleDebug {
10
10
  executionStack = [];
11
- startCalculateModuleExecutionInfo(filename, startOffset) {
11
+ startCalculateModuleExecutionInfo(filename, options) {
12
12
  const startTime = performanceNow();
13
13
  this.executionStack.push({
14
14
  filename,
@@ -22,7 +22,9 @@ class ModuleDebug {
22
22
  const selfTime = duration - currentExecution.subImportTime;
23
23
  if (this.executionStack.length > 0) this.executionStack.at(-1).subImportTime += duration;
24
24
  return {
25
- startOffset,
25
+ startOffset: options.startOffset,
26
+ external: options.external,
27
+ importer: options.importer,
26
28
  duration,
27
29
  selfTime
28
30
  };
@@ -40,11 +42,13 @@ class VitestModuleEvaluator {
40
42
  primitives;
41
43
  debug = new ModuleDebug();
42
44
  _otel;
45
+ _evaluatedModules;
43
46
  constructor(vmOptions, options = {}) {
44
47
  this.options = options;
45
48
  this._otel = options.traces || new Traces({ enabled: false });
46
49
  this.vm = vmOptions;
47
50
  this.stubs = getDefaultRequestStubs(vmOptions?.context);
51
+ this._evaluatedModules = options.evaluatedModules;
48
52
  if (options.compiledFunctionArgumentsNames) this.compiledFunctionArgumentsNames = options.compiledFunctionArgumentsNames;
49
53
  if (options.compiledFunctionArgumentsValues) this.compiledFunctionArgumentsValues = options.compiledFunctionArgumentsValues;
50
54
  if (vmOptions) this.primitives = vm.runInContext("({ Object, Proxy, Reflect })", vmOptions.context);
@@ -67,7 +71,16 @@ class VitestModuleEvaluator {
67
71
  async runExternalModule(id) {
68
72
  if (id in this.stubs) return this.stubs[id];
69
73
  const file = this.convertIdToImportUrl(id);
70
- const namespace = await this._otel.$("vitest.module.external", { attributes: { "code.file.path": file } }, () => this.vm ? this.vm.externalModulesExecutor.import(file) : import(file));
74
+ const importer = (this._evaluatedModules?.getModuleById(id)?.importers)?.values().next().value;
75
+ const filename = id.startsWith("file://") ? fileURLToPath(id) : id;
76
+ const finishModuleExecutionInfo = this.debug.startCalculateModuleExecutionInfo(filename, {
77
+ startOffset: 0,
78
+ external: true,
79
+ importer
80
+ });
81
+ const namespace = await this._otel.$("vitest.module.external", { attributes: { "code.file.path": file } }, () => this.vm ? this.vm.externalModulesExecutor.import(file) : import(file)).finally(() => {
82
+ this.options.moduleExecutionInfo?.set(filename, finishModuleExecutionInfo());
83
+ });
71
84
  if (!this.shouldInterop(file, namespace)) return namespace;
72
85
  const { mod, defaultExport } = interopModule(namespace);
73
86
  const { Proxy, Reflect } = this.primitives;
@@ -174,7 +187,12 @@ class VitestModuleEvaluator {
174
187
  lineOffset: 0,
175
188
  columnOffset: -codeDefinition.length
176
189
  };
177
- const finishModuleExecutionInfo = this.debug.startCalculateModuleExecutionInfo(options.filename, codeDefinition.length);
190
+ // this will always be 1 element because it's cached after load
191
+ const importer = module.importers.values().next().value;
192
+ const finishModuleExecutionInfo = this.debug.startCalculateModuleExecutionInfo(options.filename, {
193
+ startOffset: codeDefinition.length,
194
+ importer
195
+ });
178
196
  try {
179
197
  const initModule = this.vm ? vm.runInContext(wrappedCode, this.vm.context, options) : vm.runInThisContext(wrappedCode, options);
180
198
  const dynamicRequest = async (dep, options) => {
@@ -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.W28wBIgJ.js';
2
+ export { a as VITEST_VM_CONTEXT_SYMBOL, V as VitestModuleRunner, s as startVitestModuleRunner } from './chunks/startModuleRunner.Iz2V0ESw.js';
3
3
  export { g as getWorkerState } from './chunks/utils.DvEY5TfP.js';
4
4
  import 'node:module';
5
5
  import 'node:url';
@@ -9,6 +9,7 @@ import 'vite/module-runner';
9
9
  import './chunks/traces.U4xDYhzZ.js';
10
10
  import 'node:fs';
11
11
  import '@vitest/utils/helpers';
12
+ import './chunks/modules.DJPjQW6m.js';
12
13
  import './path.js';
13
14
  import 'node:path';
14
15
  import '@vitest/utils/serialize';
package/dist/node.d.ts CHANGED
@@ -3,24 +3,24 @@ import { InlineConfig, UserConfig as UserConfig$1, Plugin, ResolvedConfig as Res
3
3
  export { vite as Vite };
4
4
  export { esbuildVersion, isCSSRequest, isFileServingAllowed, parseAst, parseAstAsync, rollupVersion, version as viteVersion } from 'vite';
5
5
  import { IncomingMessage } from 'node:http';
6
- import { h as ResolvedConfig, f as UserConfig, i as VitestRunMode, j as VitestOptions, V as Vitest, A as ApiConfig, k as TestSpecification, T as TestProject, P as PoolWorker, l as PoolOptions, m as WorkerRequest, n as TestSequencer, L as Logger } from './chunks/reporters.d.J2RlBlp9.js';
7
- export { at as BaseCoverageOptions, Y as BenchmarkUserOptions, Z as BrowserBuiltinProvider, $ as BrowserCommand, a0 as BrowserCommandContext, a1 as BrowserConfigOptions, a2 as BrowserInstanceOption, a3 as BrowserModuleMocker, a4 as BrowserOrchestrator, a5 as BrowserProvider, a6 as BrowserProviderOption, a7 as BrowserScript, a8 as BrowserServerFactory, a9 as BrowserServerOptions, aa as BrowserServerState, ab as BrowserServerStateSession, ai as BuiltinEnvironment, ac as CDPSession, aj as CSSModuleScopeStrategy, au as CoverageIstanbulOptions, av as CoverageOptions, aw as CoverageProvider, ax as CoverageProviderModule, ay as CoverageReporter, c as CoverageV8Options, az as CustomProviderOptions, ak as DepsOptimizationOptions, al as EnvironmentOptions, H as HTMLOptions, I as InlineConfig, t as JUnitOptions, J as JsonOptions, M as ModuleDiagnostic, O as OnServerRestartHandler, o as OnTestsRerunHandler, ad as ParentProjectBrowser, am as Pool, q as PoolRunnerInitializer, r as PoolTask, ae as ProjectBrowser, an as ProjectConfig, a as ReportContext, aB as ReportedHookContext, aC as Reporter, ap as ResolveSnapshotPathHandler, aq as ResolveSnapshotPathHandlerContext, af as ResolvedBrowserOptions, R as ResolvedCoverageOptions, ao as ResolvedProjectConfig, S as SerializedTestProject, u as TaskOptions, v as TestCase, w as TestCollection, x as TestDiagnostic, y as TestModule, z as TestModuleState, B as TestResult, D as TestResultFailed, E as TestResultPassed, F as TestResultSkipped, aD as TestRunEndReason, aA as TestRunResult, X as TestSequencerConstructor, G as TestState, K as TestSuite, N as TestSuiteState, ag as ToMatchScreenshotComparators, ah as ToMatchScreenshotOptions, ar as TypecheckConfig, U as UserWorkspaceConfig, as as VitestEnvironment, p as VitestPackageInstaller, W as WatcherTriggerPattern, s as WorkerResponse, _ as _BrowserNames, Q as experimental_getRunnerTask } from './chunks/reporters.d.J2RlBlp9.js';
8
- export { C as CacheKeyIdGenerator, a as CacheKeyIdGeneratorContext, V as VitestPluginContext } from './chunks/plugin.d.B4l3vYM_.js';
6
+ import { h as ResolvedConfig, f as UserConfig, i as VitestRunMode, j as VitestOptions, V as Vitest, A as ApiConfig, k as TestSpecification, T as TestProject, P as PoolWorker, l as PoolOptions, m as WorkerRequest, n as TestSequencer, L as Logger } from './chunks/reporters.d.OXEK7y4s.js';
7
+ export { at as BaseCoverageOptions, Y as BenchmarkUserOptions, Z as BrowserBuiltinProvider, $ as BrowserCommand, a0 as BrowserCommandContext, a1 as BrowserConfigOptions, a2 as BrowserInstanceOption, a3 as BrowserModuleMocker, a4 as BrowserOrchestrator, a5 as BrowserProvider, a6 as BrowserProviderOption, a7 as BrowserScript, a8 as BrowserServerFactory, a9 as BrowserServerOptions, aa as BrowserServerState, ab as BrowserServerStateSession, ai as BuiltinEnvironment, ac as CDPSession, aj as CSSModuleScopeStrategy, au as CoverageIstanbulOptions, av as CoverageOptions, aw as CoverageProvider, ax as CoverageProviderModule, ay as CoverageReporter, c as CoverageV8Options, az as CustomProviderOptions, ak as DepsOptimizationOptions, al as EnvironmentOptions, H as HTMLOptions, I as InlineConfig, t as JUnitOptions, J as JsonOptions, M as ModuleDiagnostic, O as OnServerRestartHandler, o as OnTestsRerunHandler, ad as ParentProjectBrowser, am as Pool, q as PoolRunnerInitializer, r as PoolTask, ae as ProjectBrowser, an as ProjectConfig, a as ReportContext, aB as ReportedHookContext, aC as Reporter, ap as ResolveSnapshotPathHandler, aq as ResolveSnapshotPathHandlerContext, af as ResolvedBrowserOptions, R as ResolvedCoverageOptions, ao as ResolvedProjectConfig, S as SerializedTestProject, u as TaskOptions, v as TestCase, w as TestCollection, x as TestDiagnostic, y as TestModule, z as TestModuleState, B as TestResult, D as TestResultFailed, E as TestResultPassed, F as TestResultSkipped, aD as TestRunEndReason, aA as TestRunResult, X as TestSequencerConstructor, G as TestState, K as TestSuite, N as TestSuiteState, ag as ToMatchScreenshotComparators, ah as ToMatchScreenshotOptions, ar as TypecheckConfig, U as UserWorkspaceConfig, as as VitestEnvironment, p as VitestPackageInstaller, W as WatcherTriggerPattern, s as WorkerResponse, _ as _BrowserNames, Q as experimental_getRunnerTask } from './chunks/reporters.d.OXEK7y4s.js';
8
+ export { C as CacheKeyIdGenerator, a as CacheKeyIdGeneratorContext, V as VitestPluginContext } from './chunks/plugin.d.CY7CUjf-.js';
9
9
  import { Awaitable } from '@vitest/utils';
10
10
  export { SerializedError } from '@vitest/utils';
11
11
  import { R as RuntimeRPC } from './chunks/rpc.d.RH3apGEf.js';
12
12
  import { Writable } from 'node:stream';
13
- import { C as ContextRPC } from './chunks/worker.d.DCy61tzi.js';
14
- export { T as TestExecutionType } from './chunks/worker.d.DCy61tzi.js';
15
- import { Debugger } from 'debug';
13
+ import { C as ContextRPC } from './chunks/worker.d.B4A26qg6.js';
14
+ export { T as TestExecutionType } from './chunks/worker.d.B4A26qg6.js';
15
+ import { Debugger } from 'obug';
16
16
  import './chunks/global.d.B15mdLcR.js';
17
17
  export { Task as RunnerTask, TaskResult as RunnerTaskResult, TaskResultPack as RunnerTaskResultPack, Test as RunnerTestCase, File as RunnerTestFile, Suite as RunnerTestSuite, SequenceHooks, SequenceSetupFiles } from '@vitest/runner';
18
- export { b as RuntimeConfig } from './chunks/config.d.g6OOauRt.js';
18
+ export { b as RuntimeConfig } from './chunks/config.d.CzIjkicf.js';
19
19
  export { generateFileHash } from '@vitest/runner/utils';
20
+ import './chunks/browser.d.DBzUq_Na.js';
20
21
  import '@vitest/mocker';
21
22
  import '@vitest/utils/source-map';
22
23
  import 'vitest/browser';
23
- import './chunks/browser.d.CDvMh6F9.js';
24
24
  import '@vitest/pretty-format';
25
25
  import '@vitest/snapshot';
26
26
  import '@vitest/utils/diff';
package/dist/node.js CHANGED
@@ -1,9 +1,9 @@
1
1
  import * as vite from 'vite';
2
2
  import { resolveConfig as resolveConfig$1, mergeConfig } from 'vite';
3
3
  export { esbuildVersion, isCSSRequest, isFileServingAllowed, parseAst, parseAstAsync, rollupVersion, version as viteVersion } from 'vite';
4
- import { V as Vitest, a as VitestPlugin } from './chunks/cli-api.CdZ6wo9-.js';
5
- export { f as ForksPoolWorker, G as GitNotFoundError, F as TestsNotFoundError, T as ThreadsPoolWorker, h as TypecheckPoolWorker, b as VitestPackageInstaller, j as VmForksPoolWorker, k as VmThreadsPoolWorker, o as createDebugger, d as createMethodsRPC, n as createViteLogger, c as createVitest, e as escapeTestName, l as experimental_getRunnerTask, g as getFilePoolName, i as isValidApiRequest, m as registerConsoleShortcuts, r as resolveFsAllow, s as startVitest } from './chunks/cli-api.CdZ6wo9-.js';
6
- export { p as parseCLI } from './chunks/cac.L-UbQ_Ix.js';
4
+ import { V as Vitest, a as VitestPlugin } from './chunks/cli-api.C7sYjHmQ.js';
5
+ export { f as ForksPoolWorker, G as GitNotFoundError, F as TestsNotFoundError, T as ThreadsPoolWorker, h as TypecheckPoolWorker, b as VitestPackageInstaller, j as VmForksPoolWorker, k as VmThreadsPoolWorker, o as createDebugger, d as createMethodsRPC, n as createViteLogger, c as createVitest, e as escapeTestName, l as experimental_getRunnerTask, g as getFilePoolName, i as isValidApiRequest, m as registerConsoleShortcuts, r as resolveFsAllow, s as startVitest } from './chunks/cli-api.C7sYjHmQ.js';
6
+ export { p as parseCLI } from './chunks/cac.BNNpZQl7.js';
7
7
  import { r as resolveConfig$2 } from './chunks/coverage.CtyeYmKM.js';
8
8
  export { b as BaseSequencer, a as resolveApiServerConfig } from './chunks/coverage.CtyeYmKM.js';
9
9
  import { slash, deepClone } from '@vitest/utils/helpers';
@@ -19,7 +19,7 @@ import 'node:os';
19
19
  import '@vitest/snapshot/manager';
20
20
  import 'node:perf_hooks';
21
21
  import './chunks/index.0kCJoeWi.js';
22
- import './chunks/index.DWDW6mLz.js';
22
+ import './chunks/index.456_DGfR.js';
23
23
  import 'node:fs/promises';
24
24
  import '@vitest/utils/source-map';
25
25
  import 'tinyrainbow';
@@ -45,13 +45,14 @@ import 'buffer';
45
45
  import './chunks/_commonjsHelpers.D26ty3Ew.js';
46
46
  import 'node:crypto';
47
47
  import './chunks/traces.U4xDYhzZ.js';
48
- import 'debug';
48
+ import 'obug';
49
49
  import '#module-evaluator';
50
50
  import 'vite/module-runner';
51
51
  import '@vitest/utils/highlight';
52
52
  import 'node:url';
53
53
  import 'node:tty';
54
54
  import 'node:events';
55
+ import './chunks/modules.DJPjQW6m.js';
55
56
  import 'node:child_process';
56
57
  import 'node:worker_threads';
57
58
  import 'picomatch';
@@ -62,7 +63,7 @@ import './chunks/defaults.BOqNVLsY.js';
62
63
  import '@vitest/utils/constants';
63
64
  import '@vitest/utils/resolver';
64
65
  import 'es-module-lexer';
65
- import './chunks/index.CMvpbrsJ.js';
66
+ import './chunks/index.Drsj_6e7.js';
66
67
  import 'node:assert';
67
68
  import '@vitest/utils/serialize';
68
69
  import 'node:readline';
@@ -1,4 +1,4 @@
1
- export { aR as BaseReporter, aS as BenchmarkBuiltinReporters, aE as BenchmarkReporter, aF as BenchmarkReportsMap, aT as BuiltinReporterOptions, aU as BuiltinReporters, aG as DefaultReporter, aH as DotReporter, aI as GithubActionsReporter, aJ as HangingProcessReporter, aL as JUnitReporter, aV as JsonAssertionResult, aK as JsonReporter, aW as JsonTestResult, aX as JsonTestResults, aB as ReportedHookContext, aC as Reporter, aM as ReportersMap, aN as TapFlatReporter, aO as TapReporter, aD as TestRunEndReason, aP as VerboseBenchmarkReporter, aQ as VerboseReporter } from './chunks/reporters.d.J2RlBlp9.js';
1
+ export { aR as BaseReporter, aS as BenchmarkBuiltinReporters, aE as BenchmarkReporter, aF as BenchmarkReportsMap, aT as BuiltinReporterOptions, aU as BuiltinReporters, aG as DefaultReporter, aH as DotReporter, aI as GithubActionsReporter, aJ as HangingProcessReporter, aL as JUnitReporter, aV as JsonAssertionResult, aK as JsonReporter, aW as JsonTestResult, aX as JsonTestResults, aB as ReportedHookContext, aC as Reporter, aM as ReportersMap, aN as TapFlatReporter, aO as TapReporter, aD as TestRunEndReason, aP as VerboseBenchmarkReporter, aQ as VerboseReporter } from './chunks/reporters.d.OXEK7y4s.js';
2
2
  import '@vitest/runner';
3
3
  import '@vitest/utils';
4
4
  import './chunks/rpc.d.RH3apGEf.js';
@@ -7,15 +7,15 @@ import 'vite/module-runner';
7
7
  import './chunks/traces.d.402V_yFI.js';
8
8
  import 'node:stream';
9
9
  import 'vite';
10
- import '@vitest/mocker';
11
- import '@vitest/utils/source-map';
12
- import 'vitest/browser';
13
- import './chunks/config.d.g6OOauRt.js';
10
+ import './chunks/browser.d.DBzUq_Na.js';
11
+ import './chunks/worker.d.B4A26qg6.js';
12
+ import './chunks/config.d.CzIjkicf.js';
14
13
  import '@vitest/pretty-format';
15
14
  import '@vitest/utils/diff';
16
- import './chunks/browser.d.CDvMh6F9.js';
17
- import './chunks/worker.d.DCy61tzi.js';
18
15
  import './chunks/environment.d.CrsxCzP1.js';
16
+ import '@vitest/mocker';
17
+ import '@vitest/utils/source-map';
18
+ import 'vitest/browser';
19
19
  import '@vitest/expect';
20
20
  import 'vitest/optional-types.js';
21
21
  import './chunks/benchmark.d.DAaHLpsq.js';
package/dist/reporters.js CHANGED
@@ -1,5 +1,5 @@
1
- export { D as DefaultReporter, a as DotReporter, G as GithubActionsReporter, H as HangingProcessReporter, b as JUnitReporter, J as JsonReporter, R as ReportersMap, T as TapFlatReporter, c as TapReporter, V as VerboseReporter } from './chunks/index.DWDW6mLz.js';
2
- export { B as BenchmarkReporter, a as BenchmarkReportsMap, V as VerboseBenchmarkReporter } from './chunks/index.CMvpbrsJ.js';
1
+ export { D as DefaultReporter, a as DotReporter, G as GithubActionsReporter, H as HangingProcessReporter, b as JUnitReporter, J as JsonReporter, R as ReportersMap, T as TapFlatReporter, c as TapReporter, V as VerboseReporter } from './chunks/index.456_DGfR.js';
2
+ export { B as BenchmarkReporter, a as BenchmarkReportsMap, V as VerboseBenchmarkReporter } from './chunks/index.Drsj_6e7.js';
3
3
  import 'node:fs';
4
4
  import 'node:fs/promises';
5
5
  import 'pathe';
package/dist/runners.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import * as tinybench from 'tinybench';
2
2
  import { VitestRunner, VitestRunnerImportSource, Suite, File, Task, CancelReason, Test, TestContext, ImportDuration } from '@vitest/runner';
3
3
  export { VitestRunner } from '@vitest/runner';
4
- import { S as SerializedConfig } from './chunks/config.d.g6OOauRt.js';
4
+ import { S as SerializedConfig } from './chunks/config.d.CzIjkicf.js';
5
5
  import { T as Traces } from './chunks/traces.d.402V_yFI.js';
6
6
  import '@vitest/pretty-format';
7
7
  import '@vitest/snapshot';
@@ -26,6 +26,7 @@ declare class VitestTestRunner implements VitestRunner {
26
26
  private assertionsErrors;
27
27
  pool: string;
28
28
  private _otel;
29
+ viteEnvironment: string;
29
30
  constructor(config: SerializedConfig);
30
31
  importFile(filepath: string, source: VitestRunnerImportSource): unknown;
31
32
  onCollectStart(file: File): void;