vitest 0.26.2 → 0.26.3

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 (35) hide show
  1. package/dist/browser.d.ts +3 -3
  2. package/dist/browser.js +10 -10
  3. package/dist/{chunk-api-setup.46ee0021.js → chunk-api-setup.47a09f0f.js} +7 -2
  4. package/dist/{chunk-install-pkg.31846bc1.js → chunk-install-pkg.6dd2bae6.js} +2 -2
  5. package/dist/{chunk-integrations-globals.5af12e76.js → chunk-integrations-globals.ee28730b.js} +7 -7
  6. package/dist/{chunk-node-git.43b341db.js → chunk-node-git.a90c0582.js} +3 -3
  7. package/dist/{chunk-runtime-chain.198631fd.js → chunk-runtime-chain.f51aa930.js} +8 -8
  8. package/dist/{chunk-runtime-error.12631a44.js → chunk-runtime-error.f5c8aaf2.js} +2 -2
  9. package/dist/{chunk-runtime-mocker.03096876.js → chunk-runtime-mocker.887bf8c8.js} +4 -4
  10. package/dist/{chunk-runtime-rpc.503623e9.js → chunk-runtime-rpc.54d72169.js} +2 -2
  11. package/dist/{chunk-runtime-setup.f79addc3.js → chunk-runtime-setup.a06d5c72.js} +12 -12
  12. package/dist/{chunk-snapshot-manager.8c94a052.js → chunk-snapshot-manager.70695b70.js} +35 -44
  13. package/dist/{chunk-typecheck-constants.e478eb98.js → chunk-typecheck-constants.06e1fe5b.js} +2 -2
  14. package/dist/{chunk-utils-env.4afc6329.js → chunk-utils-env.3fdc1793.js} +0 -0
  15. package/dist/{chunk-utils-import.dc87c88c.js → chunk-utils-import.e7f64637.js} +20 -9
  16. package/dist/{chunk-utils-source-map.95b8b3f0.js → chunk-utils-source-map.5278ee22.js} +10 -18
  17. package/dist/{chunk-utils-timers.54caa12a.js → chunk-utils-timers.715da787.js} +1 -1
  18. package/dist/cli-wrapper.js +3 -3
  19. package/dist/cli.js +8 -8
  20. package/dist/config.d.ts +1 -1
  21. package/dist/entry.js +9 -9
  22. package/dist/environments.d.ts +1 -1
  23. package/dist/{index-40ebba2b.d.ts → index-761e769b.d.ts} +1 -1
  24. package/dist/index.d.ts +6 -6
  25. package/dist/index.js +8 -8
  26. package/dist/loader.js +2 -2
  27. package/dist/node.d.ts +6 -6
  28. package/dist/node.js +9 -9
  29. package/dist/suite.js +6 -6
  30. package/dist/{types-2a26f28c.d.ts → types-bae746aa.d.ts} +5 -8
  31. package/dist/{vendor-index.62932580.js → vendor-index.7a2cebfe.js} +0 -0
  32. package/dist/{vendor-index.808a85a6.js → vendor-index.9c919048.js} +0 -0
  33. package/dist/{vendor-index.a323f2d0.js → vendor-index.b2fdde54.js} +1 -1
  34. package/dist/worker.js +6 -6
  35. package/package.json +3 -3
package/dist/browser.d.ts CHANGED
@@ -1,6 +1,6 @@
1
- export { A as AssertType, E as EnhancedSpy, q as ExpectTypeOf, x as Mock, y as MockContext, w as MockInstance, z as Mocked, B as MockedClass, u as MockedFunction, v as MockedObject, S as SpyInstance, j as afterAll, l as afterEach, r as assertType, h as beforeAll, k as beforeEach, n as createExpect, e as describe, m as expect, p as expectTypeOf, i as it, o as onTestFailed, d as suite, t as test } from './index-40ebba2b.js';
2
- import { b as ResolvedConfig } from './types-2a26f28c.js';
3
- export { a1 as AfterSuiteRunMeta, A as ApiConfig, a7 as ArgumentsType, a6 as Arrayable, a4 as Awaitable, ap as BaseCoverageOptions, av as BenchFunction, at as Benchmark, aw as BenchmarkAPI, au as BenchmarkResult, as as BenchmarkUserOptions, B as BuiltinEnvironment, i as CSSModuleScopeStrategy, C as CollectLineNumbers, f as CollectLines, ab as Constructable, h as Context, ar as CoverageC8Options, aq as CoverageIstanbulOptions, an as CoverageOptions, ak as CoverageProvider, al as CoverageProviderModule, am as CoverageReporter, a9 as DeepMerge, D as DoneCallback, ae as Environment, E as EnvironmentOptions, ad as EnvironmentReturn, ai as ErrorWithDiff, a as File, x as HookCleanupCallback, H as HookListener, I as InlineConfig, J as JSDOMOptions, a8 as MergeInsertions, ac as ModuleCache, M as ModuleGraphData, aa as MutableArray, a5 as Nullable, aj as OnServerRestartHandler, O as OnTestFailedHandler, ah as ParsedStack, ag as Position, d as RawErrsMap, c as Reporter, a0 as ResolveIdFunction, b as ResolvedConfig, ao as ResolvedCoverageOptions, g as RootAndTarget, l as RunMode, R as RuntimeConfig, K as RuntimeContext, S as SequenceHooks, P as SnapshotData, X as SnapshotMatchOptions, Y as SnapshotResult, W as SnapshotStateOptions, _ as SnapshotSummary, Q as SnapshotUpdateState, p as Suite, w as SuiteAPI, z as SuiteCollector, G as SuiteFactory, y as SuiteHooks, s as Task, n as TaskBase, o as TaskResult, T as TaskResultPack, m as TaskState, q as Test, v as TestAPI, L as TestContext, t as TestFunction, u as TestOptions, e as TscErrorInfo, r as TypeCheck, k as TypecheckConfig, Z as UncheckedSnapshot, U as UserConfig, af as UserConsoleLog, N as Vitest, V as VitestEnvironment, j as VitestRunMode, $ as WorkerContext, a3 as WorkerGlobalState, a2 as WorkerRPC } from './types-2a26f28c.js';
1
+ export { A as AssertType, E as EnhancedSpy, q as ExpectTypeOf, x as Mock, y as MockContext, w as MockInstance, z as Mocked, B as MockedClass, u as MockedFunction, v as MockedObject, S as SpyInstance, j as afterAll, l as afterEach, r as assertType, h as beforeAll, k as beforeEach, n as createExpect, e as describe, m as expect, p as expectTypeOf, i as it, o as onTestFailed, d as suite, t as test } from './index-761e769b.js';
2
+ import { b as ResolvedConfig } from './types-bae746aa.js';
3
+ export { a2 as AfterSuiteRunMeta, A as ApiConfig, a8 as ArgumentsType, a7 as Arrayable, a5 as Awaitable, ap as BaseCoverageOptions, av as BenchFunction, at as Benchmark, aw as BenchmarkAPI, au as BenchmarkResult, as as BenchmarkUserOptions, B as BuiltinEnvironment, j as CSSModuleScopeStrategy, C as CollectLineNumbers, g as CollectLines, ac as Constructable, i as Context, ar as CoverageC8Options, aq as CoverageIstanbulOptions, an as CoverageOptions, ak as CoverageProvider, al as CoverageProviderModule, am as CoverageReporter, aa as DeepMerge, D as DoneCallback, af as Environment, E as EnvironmentOptions, ae as EnvironmentReturn, ai as ErrorWithDiff, a as File, y as HookCleanupCallback, H as HookListener, I as InlineConfig, J as JSDOMOptions, a9 as MergeInsertions, ad as ModuleCache, c as ModuleGraphData, ab as MutableArray, a6 as Nullable, aj as OnServerRestartHandler, O as OnTestFailedHandler, ah as ParsedStack, e as RawErrsMap, d as Reporter, a1 as ResolveIdFunction, b as ResolvedConfig, ao as ResolvedCoverageOptions, h as RootAndTarget, m as RunMode, R as RuntimeConfig, L as RuntimeContext, S as SequenceHooks, Q as SnapshotData, Y as SnapshotMatchOptions, Z as SnapshotResult, X as SnapshotStateOptions, $ as SnapshotSummary, W as SnapshotUpdateState, q as Suite, x as SuiteAPI, G as SuiteCollector, K as SuiteFactory, z as SuiteHooks, t as Task, o as TaskBase, p as TaskResult, T as TaskResultPack, n as TaskState, r as Test, w as TestAPI, N as TestContext, u as TestFunction, v as TestOptions, f as TscErrorInfo, s as TypeCheck, l as TypecheckConfig, _ as UncheckedSnapshot, U as UserConfig, ag as UserConsoleLog, P as Vitest, V as VitestEnvironment, k as VitestRunMode, a0 as WorkerContext, a4 as WorkerGlobalState, a3 as WorkerRPC } from './types-bae746aa.js';
4
4
  import * as chai from 'chai';
5
5
  export { chai };
6
6
  export { assert, should } from 'chai';
package/dist/browser.js CHANGED
@@ -1,29 +1,29 @@
1
- export { c as createExpect, d as describe, e as expect, i as it, s as suite, t as test } from './chunk-runtime-chain.198631fd.js';
2
- import { e as dist } from './chunk-utils-import.dc87c88c.js';
3
- export { a as afterAll, d as afterEach, f as assertType, b as beforeAll, c as beforeEach, o as onTestFailed } from './chunk-utils-import.dc87c88c.js';
4
- export { a as setupGlobalEnv, s as startTests } from './chunk-runtime-setup.f79addc3.js';
1
+ export { c as createExpect, d as describe, e as expect, i as it, s as suite, t as test } from './chunk-runtime-chain.f51aa930.js';
2
+ import { e as dist } from './chunk-utils-import.e7f64637.js';
3
+ export { a as afterAll, d as afterEach, f as assertType, b as beforeAll, c as beforeEach, o as onTestFailed } from './chunk-utils-import.e7f64637.js';
4
+ export { a as setupGlobalEnv, s as startTests } from './chunk-runtime-setup.a06d5c72.js';
5
5
  import * as chai from 'chai';
6
6
  export { chai };
7
7
  export { assert, should } from 'chai';
8
8
  import 'util';
9
- import './chunk-typecheck-constants.e478eb98.js';
9
+ import './chunk-typecheck-constants.06e1fe5b.js';
10
10
  import 'node:path';
11
- import './chunk-utils-env.4afc6329.js';
11
+ import './chunk-utils-env.3fdc1793.js';
12
12
  import 'tty';
13
13
  import 'node:url';
14
14
  import 'path';
15
15
  import 'local-pkg';
16
16
  import './vendor-_commonjsHelpers.addc3445.js';
17
- import './chunk-runtime-rpc.503623e9.js';
18
- import './chunk-utils-timers.54caa12a.js';
17
+ import './chunk-runtime-rpc.54d72169.js';
18
+ import './chunk-utils-timers.715da787.js';
19
19
  import 'node:fs';
20
- import './chunk-utils-source-map.95b8b3f0.js';
20
+ import './chunk-utils-source-map.5278ee22.js';
21
21
  import 'fs';
22
22
  import './spy.js';
23
23
  import 'tinyspy';
24
24
  import 'perf_hooks';
25
25
  import './chunk-integrations-coverage.befed097.js';
26
- import './chunk-runtime-error.12631a44.js';
26
+ import './chunk-runtime-error.f5c8aaf2.js';
27
27
  import 'vite-node/source-map';
28
28
  import './chunk-env-node.b3664da2.js';
29
29
  import 'node:console';
@@ -9,8 +9,9 @@ import require$$2 from 'events';
9
9
  import require$$1 from 'https';
10
10
  import require$$2$1 from 'http';
11
11
  import require$$7 from 'url';
12
- import { A as API_PATH } from './chunk-utils-env.4afc6329.js';
13
- import './chunk-typecheck-constants.e478eb98.js';
12
+ import { A as API_PATH } from './chunk-utils-env.3fdc1793.js';
13
+ import './chunk-typecheck-constants.06e1fe5b.js';
14
+ import { p as parseStacktrace } from './chunk-utils-source-map.5278ee22.js';
14
15
  import 'tty';
15
16
  import 'node:url';
16
17
  import 'path';
@@ -4557,6 +4558,10 @@ class WebSocketReporter {
4557
4558
  async onTaskUpdate(packs) {
4558
4559
  if (this.clients.size === 0)
4559
4560
  return;
4561
+ packs.forEach(([, result]) => {
4562
+ if (result == null ? void 0 : result.error)
4563
+ result.error.stacks = parseStacktrace(result.error);
4564
+ });
4560
4565
  this.clients.forEach((client) => {
4561
4566
  var _a;
4562
4567
  (_a = client.onTaskUpdate) == null ? void 0 : _a.call(client, packs);
@@ -2,8 +2,8 @@ import require$$0 from 'fs';
2
2
  import g from 'path';
3
3
  import util from 'util';
4
4
  import require$$0$2 from 'child_process';
5
- import { p as pathKey, s as signalExit, m as mergeStream$1, g as getStream$1, c as crossSpawn$1 } from './vendor-index.62932580.js';
6
- import { o as onetime$1 } from './vendor-index.808a85a6.js';
5
+ import { p as pathKey, s as signalExit, m as mergeStream$1, g as getStream$1, c as crossSpawn$1 } from './vendor-index.7a2cebfe.js';
6
+ import { o as onetime$1 } from './vendor-index.9c919048.js';
7
7
  import require$$0$1 from 'os';
8
8
  import './vendor-_commonjsHelpers.addc3445.js';
9
9
  import 'assert';
@@ -1,19 +1,19 @@
1
- import { m as globalApis } from './chunk-utils-env.4afc6329.js';
2
- import { i as index } from './chunk-utils-import.dc87c88c.js';
1
+ import { m as globalApis } from './chunk-utils-env.3fdc1793.js';
2
+ import { i as index } from './chunk-utils-import.e7f64637.js';
3
3
  import 'tty';
4
4
  import 'node:url';
5
5
  import 'path';
6
- import './chunk-runtime-chain.198631fd.js';
6
+ import './chunk-runtime-chain.f51aa930.js';
7
7
  import 'util';
8
8
  import 'chai';
9
- import './chunk-typecheck-constants.e478eb98.js';
9
+ import './chunk-typecheck-constants.06e1fe5b.js';
10
10
  import 'node:path';
11
11
  import 'local-pkg';
12
12
  import './vendor-_commonjsHelpers.addc3445.js';
13
- import './chunk-runtime-rpc.503623e9.js';
14
- import './chunk-utils-timers.54caa12a.js';
13
+ import './chunk-runtime-rpc.54d72169.js';
14
+ import './chunk-utils-timers.715da787.js';
15
15
  import 'node:fs';
16
- import './chunk-utils-source-map.95b8b3f0.js';
16
+ import './chunk-utils-source-map.5278ee22.js';
17
17
  import 'fs';
18
18
  import './spy.js';
19
19
  import 'tinyspy';
@@ -1,5 +1,5 @@
1
- import { b as resolve } from './chunk-utils-env.4afc6329.js';
2
- import { e as execa } from './vendor-index.a323f2d0.js';
1
+ import { b as resolve } from './chunk-utils-env.3fdc1793.js';
2
+ import { e as execa } from './vendor-index.b2fdde54.js';
3
3
  import 'tty';
4
4
  import 'node:url';
5
5
  import 'path';
@@ -7,7 +7,7 @@ import 'node:buffer';
7
7
  import 'node:path';
8
8
  import 'node:child_process';
9
9
  import 'node:process';
10
- import './vendor-index.62932580.js';
10
+ import './vendor-index.7a2cebfe.js';
11
11
  import 'child_process';
12
12
  import './vendor-_commonjsHelpers.addc3445.js';
13
13
  import 'fs';
@@ -1,13 +1,13 @@
1
1
  import util$1 from 'util';
2
2
  import * as chai$2 from 'chai';
3
3
  import { expect, AssertionError, util } from 'chai';
4
- import { i as isObject, b as getCallLastIndex, s as slash, g as getWorkerState, c as getNames, d as assertTypes, e as getCurrentEnvironment, f as getFullName, o as objectAttr, n as noop, h as isRunningInTest, j as isRunningInBenchmark } from './chunk-typecheck-constants.e478eb98.js';
4
+ import { i as isObject, b as getCallLastIndex, s as slash, g as getWorkerState, c as getNames, d as assertTypes, e as getCurrentEnvironment, f as getFullName, o as objectAttr, n as noop, h as isRunningInTest, j as isRunningInBenchmark } from './chunk-typecheck-constants.06e1fe5b.js';
5
5
  import { c as commonjsGlobal } from './vendor-_commonjsHelpers.addc3445.js';
6
- import { r as rpc } from './chunk-runtime-rpc.503623e9.js';
6
+ import { r as rpc } from './chunk-runtime-rpc.54d72169.js';
7
7
  import fs from 'node:fs';
8
- import { j as join, d as dirname, p as picocolors } from './chunk-utils-env.4afc6329.js';
9
- import { p as plugins_1, f as format_1, u as unifiedDiff, a as stringify, m as matcherUtils, s as safeSetTimeout, b as safeClearTimeout } from './chunk-utils-timers.54caa12a.js';
10
- import { a as posToNumber, n as numberToPos, l as lineSplitRE, p as parseStacktrace } from './chunk-utils-source-map.95b8b3f0.js';
8
+ import { j as join, d as dirname, p as picocolors } from './chunk-utils-env.3fdc1793.js';
9
+ import { p as plugins_1, f as format_1, u as unifiedDiff, a as stringify, m as matcherUtils, s as safeSetTimeout, b as safeClearTimeout } from './chunk-utils-timers.715da787.js';
10
+ import { a as positionToOffset, o as offsetToLineNumber, l as lineSplitRE, p as parseStacktrace } from './chunk-utils-source-map.5278ee22.js';
11
11
  import { promises } from 'fs';
12
12
  import { isMockFunction } from './spy.js';
13
13
 
@@ -608,7 +608,7 @@ async function saveInlineSnapshots(snapshots) {
608
608
  const code = await promises.readFile(file, "utf8");
609
609
  const s = new MagicString(code);
610
610
  for (const snap of snaps) {
611
- const index = posToNumber(code, snap);
611
+ const index = positionToOffset(code, snap.line, snap.column);
612
612
  replaceInlineSnap(code, s, index, snap.snapshot);
613
613
  }
614
614
  const transformed = s.toString();
@@ -630,8 +630,8 @@ function replaceObjectSnap(code, s, index, newSnap) {
630
630
  return true;
631
631
  }
632
632
  function prepareSnapString(snap, source, index) {
633
- const lineIndex = numberToPos(source, index).line;
634
- const line = source.split(lineSplitRE)[lineIndex - 1];
633
+ const lineNumber = offsetToLineNumber(source, index);
634
+ const line = source.split(lineSplitRE)[lineNumber - 1];
635
635
  const indent = line.match(/^\s*/)[0] || "";
636
636
  const indentNext = indent.includes(" ") ? `${indent} ` : `${indent} `;
637
637
  const lines = snap.trim().replace(/\\/g, "\\\\").split(/\n/g);
@@ -1,7 +1,7 @@
1
1
  import util$1 from 'util';
2
2
  import { util } from 'chai';
3
- import { a as stringify } from './chunk-utils-timers.54caa12a.js';
4
- import { x as deepClone, g as getWorkerState, y as getType } from './chunk-typecheck-constants.e478eb98.js';
3
+ import { a as stringify } from './chunk-utils-timers.715da787.js';
4
+ import { x as deepClone, g as getWorkerState, y as getType } from './chunk-typecheck-constants.06e1fe5b.js';
5
5
 
6
6
  const IS_RECORD_SYMBOL = "@@__IMMUTABLE_RECORD__@@";
7
7
  const IS_COLLECTION_SYMBOL = "@@__IMMUTABLE_ITERABLE__@@";
@@ -2,9 +2,9 @@ import { ViteNodeRunner } from 'vite-node/client';
2
2
  import { isInternalRequest } from 'vite-node/utils';
3
3
  import { normalizePath } from 'vite';
4
4
  import { i as isNodeBuiltin } from './vendor-index.2e96c50b.js';
5
- import { g as getWorkerState, y as getType, K as getAllMockableProperties, e as getCurrentEnvironment } from './chunk-typecheck-constants.e478eb98.js';
5
+ import { g as getWorkerState, y as getType, K as getAllMockableProperties, e as getCurrentEnvironment } from './chunk-typecheck-constants.06e1fe5b.js';
6
6
  import { existsSync, readdirSync } from 'node:fs';
7
- import { b as resolve, e as distDir, g as isAbsolute, p as picocolors, d as dirname, j as join, c as basename, l as extname } from './chunk-utils-env.4afc6329.js';
7
+ import { b as resolve, e as distDir, g as isAbsolute, p as picocolors, d as dirname, j as join, c as basename, l as extname } from './chunk-utils-env.3fdc1793.js';
8
8
 
9
9
  class RefTracker {
10
10
  constructor() {
@@ -265,11 +265,11 @@ ${picocolors.exports.green(`vi.mock("${mockpath}", async () => {
265
265
  const mockPath = this.getMockPath(id);
266
266
  if (mock === null) {
267
267
  const cache = this.moduleCache.get(mockPath);
268
- if (cache == null ? void 0 : cache.exports)
268
+ if (cache.exports)
269
269
  return cache.exports;
270
270
  const exports = {};
271
271
  this.moduleCache.set(mockPath, { exports });
272
- const mod = await this.runner.directRequest(url, url, []);
272
+ const mod = await this.runner.directRequest(url, url, callstack);
273
273
  this.mockObject(mod, exports);
274
274
  return exports;
275
275
  }
@@ -1,5 +1,5 @@
1
- import { g as getWorkerState } from './chunk-typecheck-constants.e478eb98.js';
2
- import { s as safeSetTimeout } from './chunk-utils-timers.54caa12a.js';
1
+ import { g as getWorkerState } from './chunk-typecheck-constants.06e1fe5b.js';
2
+ import { s as safeSetTimeout } from './chunk-utils-timers.715da787.js';
3
3
 
4
4
  const safeRandom = Math.random;
5
5
  function withSafeTimers(fn) {
@@ -1,14 +1,14 @@
1
1
  import { performance } from 'perf_hooks';
2
2
  import { s as someTasksAreOnly, i as interpretTaskModes, t as takeCoverageInsideWorker, p as pLimit } from './chunk-integrations-coverage.befed097.js';
3
- import { r as resetRunOnceCounter, i as index, v as vi, s as setCurrentTest } from './chunk-utils-import.dc87c88c.js';
4
- import { g as getWorkerState, R as RealDate, t as toArray, l as relativePath, j as isRunningInBenchmark, p as partitionSuiteChildren, q as shuffle, u as hasTests, v as hasFailed, w as createDefer, f as getFullName } from './chunk-typecheck-constants.e478eb98.js';
5
- import { f as clearCollectorContext, h as defaultSuite, j as setHooks, k as getHooks, l as collectorContext, m as getBenchOptions, n as getFn, o as setState, G as GLOBAL_EXPECT, p as getState } from './chunk-runtime-chain.198631fd.js';
6
- import { r as rpc } from './chunk-runtime-rpc.503623e9.js';
7
- import { p as processError } from './chunk-runtime-error.12631a44.js';
3
+ import { r as resetRunOnceCounter, i as index, v as vi, s as setCurrentTest } from './chunk-utils-import.e7f64637.js';
4
+ import { g as getWorkerState, R as RealDate, t as toArray, l as relativePath, j as isRunningInBenchmark, p as partitionSuiteChildren, q as shuffle, u as hasTests, v as hasFailed, w as createDefer, f as getFullName } from './chunk-typecheck-constants.06e1fe5b.js';
5
+ import { f as clearCollectorContext, h as defaultSuite, j as setHooks, k as getHooks, l as collectorContext, m as getBenchOptions, n as getFn, o as setState, G as GLOBAL_EXPECT, p as getState } from './chunk-runtime-chain.f51aa930.js';
6
+ import { r as rpc } from './chunk-runtime-rpc.54d72169.js';
7
+ import { p as processError } from './chunk-runtime-error.f5c8aaf2.js';
8
8
  import { installSourcemapsSupport } from 'vite-node/source-map';
9
9
  import { e as environments } from './chunk-env-node.b3664da2.js';
10
- import { i as isNode, a as isBrowser } from './chunk-utils-env.4afc6329.js';
11
- import { b as safeClearTimeout, s as safeSetTimeout } from './chunk-utils-timers.54caa12a.js';
10
+ import { i as isNode, a as isBrowser } from './chunk-utils-env.3fdc1793.js';
11
+ import { b as safeClearTimeout, s as safeSetTimeout } from './chunk-utils-timers.715da787.js';
12
12
 
13
13
  let globalSetup = false;
14
14
  async function setupGlobalEnv(config) {
@@ -29,7 +29,7 @@ async function setupGlobalEnv(config) {
29
29
  await setupConsoleLogSpy();
30
30
  }
31
31
  if (config.globals)
32
- (await import('./chunk-integrations-globals.5af12e76.js')).registerApiGlobally();
32
+ (await import('./chunk-integrations-globals.ee28730b.js')).registerApiGlobally();
33
33
  }
34
34
  function setupDefines(defines) {
35
35
  for (const key in defines)
@@ -330,7 +330,7 @@ const callCleanupHooks = async (cleanups) => {
330
330
  async function runTest(test) {
331
331
  var _a, _b, _c;
332
332
  if (test.mode !== "run") {
333
- const { getSnapshotClient } = await import('./chunk-runtime-chain.198631fd.js').then(function (n) { return n.r; });
333
+ const { getSnapshotClient } = await import('./chunk-runtime-chain.f51aa930.js').then(function (n) { return n.r; });
334
334
  getSnapshotClient().skipTestSnapshots(test);
335
335
  return;
336
336
  }
@@ -347,7 +347,7 @@ async function runTest(test) {
347
347
  clearModuleMocks();
348
348
  setCurrentTest(test);
349
349
  if (isNode) {
350
- const { getSnapshotClient } = await import('./chunk-runtime-chain.198631fd.js').then(function (n) { return n.r; });
350
+ const { getSnapshotClient } = await import('./chunk-runtime-chain.f51aa930.js').then(function (n) { return n.r; });
351
351
  await getSnapshotClient().setTest(test);
352
352
  }
353
353
  const workerState = getWorkerState();
@@ -410,7 +410,7 @@ async function runTest(test) {
410
410
  console.error(test.result.error.message, test.result.error.stackStr);
411
411
  setCurrentTest(void 0);
412
412
  if (isNode) {
413
- const { getSnapshotClient } = await import('./chunk-runtime-chain.198631fd.js').then(function (n) { return n.r; });
413
+ const { getSnapshotClient } = await import('./chunk-runtime-chain.f51aa930.js').then(function (n) { return n.r; });
414
414
  getSnapshotClient().clearTest();
415
415
  }
416
416
  test.result.duration = now() - start;
@@ -616,7 +616,7 @@ async function startTestsBrowser(paths, config) {
616
616
  async function startTestsNode(paths, config) {
617
617
  const files = await collectTests(paths, config);
618
618
  rpc().onCollected(files);
619
- const { getSnapshotClient } = await import('./chunk-runtime-chain.198631fd.js').then(function (n) { return n.r; });
619
+ const { getSnapshotClient } = await import('./chunk-runtime-chain.f51aa930.js').then(function (n) { return n.r; });
620
620
  getSnapshotClient().clear();
621
621
  await runFiles(files, config);
622
622
  const coverage = await takeCoverageInsideWorker(config.coverage);
@@ -1,7 +1,7 @@
1
- import { j as join, c as basename, d as dirname, r as relative, b as resolve, e as distDir, f as rootDir, p as picocolors, g as isAbsolute, i as isNode, h as configFiles, k as defaultPort, n as normalize, t as toNamespacedPath, E as EXIT_CODE_RESTART } from './chunk-utils-env.4afc6329.js';
1
+ import { j as join, c as basename, d as dirname, r as relative, b as resolve, e as distDir, f as rootDir, p as picocolors, g as isAbsolute, i as isNode, h as configFiles, k as defaultPort, n as normalize, t as toNamespacedPath, E as EXIT_CODE_RESTART } from './chunk-utils-env.3fdc1793.js';
2
2
  import { p as pLimit, s as someTasksAreOnly, i as interpretTaskModes, g as getCoverageProvider, C as CoverageProviderMap } from './chunk-integrations-coverage.befed097.js';
3
3
  import { g as getEnvPackageName } from './chunk-env-node.b3664da2.js';
4
- import { T as TYPECHECK_SUITE, z as ensurePackageInstalled, A as AggregateErrorPonyfill, s as slash$1, l as relativePath, B as getTests, f as getFullName, v as hasFailed, C as hasFailedSnapshot, D as getTypecheckTests, E as getSuites, F as isTypecheckTest, k as notNullish, q as shuffle, t as toArray, n as noop$1, G as deepMerge, b as getCallLastIndex, H as removeUndefinedValues, I as isWindows, J as stdout } from './chunk-typecheck-constants.e478eb98.js';
4
+ import { T as TYPECHECK_SUITE, z as ensurePackageInstalled, A as AggregateErrorPonyfill, s as slash$1, l as relativePath, B as getTests, f as getFullName, v as hasFailed, C as hasFailedSnapshot, D as getTypecheckTests, E as getSuites, F as isTypecheckTest, k as notNullish, q as shuffle, t as toArray, n as noop$1, G as deepMerge, b as getCallLastIndex, H as removeUndefinedValues, I as isWindows, J as stdout } from './chunk-typecheck-constants.06e1fe5b.js';
5
5
  import { loadConfigFromFile, normalizePath, createServer, mergeConfig } from 'vite';
6
6
  import path$a from 'node:path';
7
7
  import url, { fileURLToPath } from 'node:url';
@@ -17,7 +17,7 @@ import { c as commonjsGlobal } from './vendor-_commonjsHelpers.addc3445.js';
17
17
  import { ViteNodeRunner } from 'vite-node/client';
18
18
  import { ViteNodeServer } from 'vite-node/server';
19
19
  import { writeFile, rm } from 'node:fs/promises';
20
- import { e as execa } from './vendor-index.a323f2d0.js';
20
+ import { e as execa } from './vendor-index.b2fdde54.js';
21
21
  import { SourceMapConsumer } from 'source-map';
22
22
  import H from 'module';
23
23
  import { parse as parse$4 } from 'acorn';
@@ -27,20 +27,20 @@ import { cpus, hostname } from 'node:os';
27
27
  import { Tinypool } from 'tinypool';
28
28
  import { c as createBirpc } from './vendor-index.783e7f3e.js';
29
29
  import { performance } from 'perf_hooks';
30
- import { c as stripAnsi, d as safeSetInterval, e as safeClearInterval, g as cliTruncate, s as safeSetTimeout, h as stringWidth, i as ansiStyles, j as sliceAnsi, a as stringify$5, u as unifiedDiff, b as safeClearTimeout } from './chunk-utils-timers.54caa12a.js';
31
- import { p as parseStacktrace, a as posToNumber, l as lineSplitRE } from './chunk-utils-source-map.95b8b3f0.js';
30
+ import { c as stripAnsi, d as safeSetInterval, e as safeClearInterval, g as cliTruncate, s as safeSetTimeout, h as stringWidth, i as ansiStyles, j as sliceAnsi, a as stringify$5, u as unifiedDiff, b as safeClearTimeout } from './chunk-utils-timers.715da787.js';
31
+ import { p as parseStacktrace, a as positionToOffset, l as lineSplitRE } from './chunk-utils-source-map.5278ee22.js';
32
32
  import { resolveModule } from 'local-pkg';
33
33
  import { createHash } from 'crypto';
34
- import { slash as slash$2 } from 'vite-node/utils';
35
- import { o as onetime } from './vendor-index.808a85a6.js';
36
- import { s as signalExit } from './vendor-index.62932580.js';
34
+ import { slash as slash$2, cleanUrl } from 'vite-node/utils';
35
+ import { o as onetime } from './vendor-index.9c919048.js';
36
+ import { s as signalExit } from './vendor-index.7a2cebfe.js';
37
37
  import { createHash as createHash$1 } from 'node:crypto';
38
38
  import MagicString from './chunk-magic-string.3a794426.js';
39
39
  import { stripLiteral } from 'strip-literal';
40
40
  import require$$0$3 from 'readline';
41
41
  import { p as prompts } from './vendor-index.9f20a9be.js';
42
42
 
43
- var version$1 = "0.26.2";
43
+ var version$1 = "0.26.3";
44
44
 
45
45
  class EndError extends Error {
46
46
  constructor(value) {
@@ -6969,7 +6969,7 @@ async function collectTests(ctx, filepath) {
6969
6969
  const file = {
6970
6970
  filepath,
6971
6971
  type: "suite",
6972
- id: "-1",
6972
+ id: filepath,
6973
6973
  name: relative(ctx.config.root, filepath),
6974
6974
  mode: "run",
6975
6975
  tasks: [],
@@ -7138,7 +7138,7 @@ class Typechecker {
7138
7138
  const state = suite.mode === "run" || suite.mode === "only" ? "fail" : suite.mode;
7139
7139
  const task = {
7140
7140
  type: "typecheck",
7141
- id: idx.toString(),
7141
+ id: `${path}${idx.toString()}`,
7142
7142
  name: `error expect ${idx + 1}`,
7143
7143
  mode: suite.mode,
7144
7144
  file,
@@ -7175,11 +7175,7 @@ class Typechecker {
7175
7175
  file: filepath,
7176
7176
  line: info.line,
7177
7177
  column: info.column,
7178
- method: "",
7179
- sourcePos: {
7180
- line: info.line,
7181
- column: info.column
7182
- }
7178
+ method: ""
7183
7179
  }
7184
7180
  ]);
7185
7181
  Error.stackTraceLimit = limit;
@@ -7261,6 +7257,9 @@ class Typechecker {
7261
7257
  getTestFiles() {
7262
7258
  return Object.values(this._tests || {}).map((i) => i.file);
7263
7259
  }
7260
+ getTestPacks() {
7261
+ return Object.values(this._tests || {}).map((i) => [i.file.id, void 0]);
7262
+ }
7264
7263
  }
7265
7264
 
7266
7265
  const workerPath = url.pathToFileURL(resolve(distDir, "./worker.js")).href;
@@ -8311,8 +8310,7 @@ class JsonReporter$1 {
8311
8310
  const frame = stack[stack.length - 1];
8312
8311
  if (!frame)
8313
8312
  return;
8314
- const pos = frame.sourcePos || frame;
8315
- return { line: pos.line, column: pos.column };
8313
+ return { line: frame.line, column: frame.column };
8316
8314
  }
8317
8315
  }
8318
8316
 
@@ -8505,9 +8503,8 @@ class JUnitReporter {
8505
8503
  await this.baseLog(escapeXML(errorDetails));
8506
8504
  const stack = parseStacktrace(error);
8507
8505
  for (const frame of stack) {
8508
- const pos = frame.sourcePos ?? frame;
8509
8506
  const path = relative(this.ctx.config.root, frame.file);
8510
- await this.baseLog(` ${F_POINTER} ${[frame.method, `${path}:${pos.line}:${pos.column}`].filter(Boolean).join(" ")}`);
8507
+ await this.baseLog(` ${F_POINTER} ${[frame.method, `${path}:${frame.line}:${frame.column}`].filter(Boolean).join(" ")}`);
8511
8508
  if (frame.file in this.ctx.state.filesMap)
8512
8509
  break;
8513
8510
  }
@@ -9941,14 +9938,8 @@ createLogUpdate(process$1.stdout);
9941
9938
 
9942
9939
  createLogUpdate(process$1.stderr);
9943
9940
 
9944
- var version = "0.26.2";
9941
+ var version = "0.26.3";
9945
9942
 
9946
- function fileFromParsedStack(stack) {
9947
- var _a, _b;
9948
- if ((_b = (_a = stack == null ? void 0 : stack.sourcePos) == null ? void 0 : _a.source) == null ? void 0 : _b.startsWith(".."))
9949
- return join(stack.file, "../", stack.sourcePos.source);
9950
- return stack.file;
9951
- }
9952
9943
  async function printError(error, ctx, options = {}) {
9953
9944
  const { showCodeFrame = true, fullStack = false, type } = options;
9954
9945
  let e = error;
@@ -9976,13 +9967,10 @@ async function printError(error, ctx, options = {}) {
9976
9967
  if (e.frame) {
9977
9968
  ctx.logger.error(picocolors.exports.yellow(e.frame));
9978
9969
  } else {
9979
- printStack(ctx, stacks, nearest, errorProperties, (s, pos) => {
9970
+ printStack(ctx, stacks, nearest, errorProperties, (s) => {
9980
9971
  if (showCodeFrame && s === nearest && nearest) {
9981
- const file = fileFromParsedStack(nearest);
9982
- if (nearest.file === file || existsSync$1(file)) {
9983
- const sourceCode = readFileSync(file, "utf-8");
9984
- ctx.logger.error(picocolors.exports.yellow(generateCodeFrame(sourceCode, 4, pos)));
9985
- }
9972
+ const sourceCode = readFileSync(nearest.file, "utf-8");
9973
+ ctx.logger.error(picocolors.exports.yellow(generateCodeFrame(sourceCode, 4, s.line, s.column)));
9986
9974
  }
9987
9975
  });
9988
9976
  }
@@ -10074,12 +10062,10 @@ function printStack(ctx, stack, highlight, errorProperties, onStack) {
10074
10062
  return;
10075
10063
  const logger = ctx.logger;
10076
10064
  for (const frame of stack) {
10077
- const pos = frame.sourcePos || frame;
10078
10065
  const color = frame === highlight ? picocolors.exports.yellow : picocolors.exports.gray;
10079
- const file = fileFromParsedStack(frame);
10080
- const path = relative(ctx.config.root, file);
10081
- logger.error(color(` ${picocolors.exports.dim(F_POINTER)} ${[frame.method, picocolors.exports.dim(`${path}:${pos.line}:${pos.column}`)].filter(Boolean).join(" ")}`));
10082
- onStack == null ? void 0 : onStack(frame, pos);
10066
+ const path = relative(ctx.config.root, frame.file);
10067
+ logger.error(color(` ${picocolors.exports.dim(F_POINTER)} ${[frame.method, picocolors.exports.dim(`${path}:${frame.line}:${frame.column}`)].filter(Boolean).join(" ")}`));
10068
+ onStack == null ? void 0 : onStack(frame);
10083
10069
  if (frame.file in ctx.state.filesMap)
10084
10070
  break;
10085
10071
  }
@@ -10091,10 +10077,10 @@ function printStack(ctx, stack, highlight, errorProperties, onStack) {
10091
10077
  logger.error(picocolors.exports.red(picocolors.exports.bold("Serialized Error:")), picocolors.exports.gray(propertiesString));
10092
10078
  }
10093
10079
  }
10094
- function generateCodeFrame(source, indent = 0, start = 0, end, range = 2) {
10080
+ function generateCodeFrame(source, indent = 0, lineNumber, columnNumber, range = 2) {
10095
10081
  var _a;
10096
- start = posToNumber(source, start);
10097
- end = end || start;
10082
+ const start = positionToOffset(source, lineNumber, columnNumber);
10083
+ const end = start;
10098
10084
  const lines = source.split(lineSplitRE);
10099
10085
  let count = 0;
10100
10086
  let res = [];
@@ -10353,6 +10339,7 @@ class Vitest {
10353
10339
  this.typechecker = checker;
10354
10340
  checker.onParseEnd(async ({ files, sourceErrors }) => {
10355
10341
  this.state.collectFiles(checker.getTestFiles());
10342
+ await this.report("onTaskUpdate", checker.getTestPacks());
10356
10343
  await this.report("onCollected");
10357
10344
  if (!files.length) {
10358
10345
  this.logger.printNoTestFound();
@@ -10385,6 +10372,7 @@ class Vitest {
10385
10372
  await this.report("onWatcherRerun", testsFilesList, "File change detected. Triggering rerun.");
10386
10373
  await checker.collectTests();
10387
10374
  this.state.collectFiles(checker.getTestFiles());
10375
+ await this.report("onTaskUpdate", checker.getTestPacks());
10388
10376
  await this.report("onCollected");
10389
10377
  });
10390
10378
  await checker.collectTests();
@@ -10442,7 +10430,7 @@ class Vitest {
10442
10430
  }
10443
10431
  async filterTestsBySource(tests) {
10444
10432
  if (this.config.changed && !this.config.related) {
10445
- const { VitestGit } = await import('./chunk-node-git.43b341db.js');
10433
+ const { VitestGit } = await import('./chunk-node-git.a90c0582.js');
10446
10434
  const vitestGit = new VitestGit(this.config.root);
10447
10435
  const related2 = await vitestGit.findChangedFiles({
10448
10436
  changedSince: this.config.changed
@@ -10751,7 +10739,10 @@ const EnvReplacerPlugin = () => {
10751
10739
  if (s) {
10752
10740
  return {
10753
10741
  code: s.toString(),
10754
- map: s.generateMap({ hires: true, source: id })
10742
+ map: s.generateMap({
10743
+ hires: true,
10744
+ source: cleanUrl(id)
10745
+ })
10755
10746
  };
10756
10747
  }
10757
10748
  }
@@ -11133,7 +11124,7 @@ async function VitestPlugin(options = {}, ctx = new Vitest("test")) {
11133
11124
  try {
11134
11125
  await ctx.setServer(options, server);
11135
11126
  if (options.api && options.watch)
11136
- (await import('./chunk-api-setup.46ee0021.js')).setup(ctx);
11127
+ (await import('./chunk-api-setup.47a09f0f.js')).setup(ctx);
11137
11128
  } catch (err) {
11138
11129
  ctx.logger.printError(err, true);
11139
11130
  process.exit(1);
@@ -1,5 +1,5 @@
1
1
  import { relative } from 'node:path';
2
- import { i as isNode, a as isBrowser, r as relative$1, p as picocolors, E as EXIT_CODE_RESTART } from './chunk-utils-env.4afc6329.js';
2
+ import { i as isNode, a as isBrowser, r as relative$1, p as picocolors, E as EXIT_CODE_RESTART } from './chunk-utils-env.3fdc1793.js';
3
3
  import { isPackageExists } from 'local-pkg';
4
4
 
5
5
  const TYPECHECK_SUITE = Symbol("vitest:typecheck-suite");
@@ -290,7 +290,7 @@ async function ensurePackageInstalled(dependency, root) {
290
290
  message: picocolors.exports.reset(`Do you want to install ${picocolors.exports.green(dependency)}?`)
291
291
  });
292
292
  if (install) {
293
- await (await import('./chunk-install-pkg.31846bc1.js')).installPackage(dependency, { dev: true });
293
+ await (await import('./chunk-install-pkg.6dd2bae6.js')).installPackage(dependency, { dev: true });
294
294
  process.stderr.write(picocolors.exports.yellow(`
295
295
  Package ${dependency} installed, re-run the command to start.
296
296
  `));
@@ -1,25 +1,31 @@
1
- import { g as getCurrentSuite, w as withTimeout, a as getDefaultHookTimeout, s as suite, t as test, d as describe, i as it, b as bench, c as createExpect, e as globalExpect } from './chunk-runtime-chain.198631fd.js';
2
- import { g as getWorkerState, R as RealDate, r as resetDate, m as mockDate, a as resetModules } from './chunk-typecheck-constants.e478eb98.js';
3
- import { p as parseStacktrace } from './chunk-utils-source-map.95b8b3f0.js';
1
+ import { g as getCurrentSuite, w as withTimeout, a as getDefaultHookTimeout, s as suite, t as test, d as describe, i as it, b as bench, c as createExpect, e as globalExpect } from './chunk-runtime-chain.f51aa930.js';
2
+ import { g as getWorkerState, R as RealDate, r as resetDate, m as mockDate, a as resetModules } from './chunk-typecheck-constants.06e1fe5b.js';
3
+ import { p as parseStacktrace } from './chunk-utils-source-map.5278ee22.js';
4
4
  import { c as commonjsGlobal } from './vendor-_commonjsHelpers.addc3445.js';
5
5
  import util from 'util';
6
6
  import { spyOn, fn, isMockFunction, spies } from './spy.js';
7
- import { s as safeSetTimeout } from './chunk-utils-timers.54caa12a.js';
7
+ import { s as safeSetTimeout } from './chunk-utils-timers.715da787.js';
8
8
  import * as chai from 'chai';
9
9
  import { assert, should } from 'chai';
10
10
 
11
- async function waitForImportsToResolve(tries = 0) {
12
- await new Promise((resolve) => safeSetTimeout(resolve, 0));
11
+ function waitNextTick() {
12
+ return new Promise((resolve) => safeSetTimeout(resolve, 0));
13
+ }
14
+ async function waitForImportsToResolve() {
15
+ await waitNextTick();
13
16
  const state = getWorkerState();
14
17
  const promises = [];
18
+ let resolvingCount = 0;
15
19
  for (const mod of state.moduleCache.values()) {
16
20
  if (mod.promise && !mod.evaluated)
17
21
  promises.push(mod.promise);
22
+ if (mod.resolving)
23
+ resolvingCount++;
18
24
  }
19
- if (!promises.length && tries >= 3)
25
+ if (!promises.length && !resolvingCount)
20
26
  return;
21
27
  await Promise.allSettled(promises);
22
- await new Promise((resolve) => safeSetTimeout(resolve, 1)).then(() => Promise.resolve()).then(() => waitForImportsToResolve(tries + 1));
28
+ await waitForImportsToResolve();
23
29
  }
24
30
 
25
31
  let _test;
@@ -2810,7 +2816,12 @@ class VitestUtils {
2810
2816
  return importer.file;
2811
2817
  }
2812
2818
  mock(path, factory) {
2813
- this._mocker.queueMock(path, this.getImporter(), factory);
2819
+ const importer = this.getImporter();
2820
+ this._mocker.queueMock(
2821
+ path,
2822
+ importer,
2823
+ factory ? () => factory(() => this._mocker.importActual(path, importer)) : void 0
2824
+ );
2814
2825
  }
2815
2826
  unmock(path) {
2816
2827
  this._mocker.queueUnmock(path, this.getImporter());
@@ -1,5 +1,5 @@
1
- import { b as resolve } from './chunk-utils-env.4afc6329.js';
2
- import { k as notNullish } from './chunk-typecheck-constants.e478eb98.js';
1
+ import { b as resolve } from './chunk-utils-env.3fdc1793.js';
2
+ import { k as notNullish } from './chunk-typecheck-constants.06e1fe5b.js';
3
3
 
4
4
  const lineSplitRE = /\r?\n/;
5
5
  const stackIgnorePatterns = [
@@ -56,21 +56,16 @@ function parseStacktrace(e, full = false) {
56
56
  e.stacks = stackFrames;
57
57
  return stackFrames;
58
58
  }
59
- function posToNumber(source, pos) {
60
- if (typeof pos === "number")
61
- return pos;
59
+ function positionToOffset(source, lineNumber, columnNumber) {
62
60
  const lines = source.split(lineSplitRE);
63
- const { line, column } = pos;
64
61
  let start = 0;
65
- if (line > lines.length)
62
+ if (lineNumber > lines.length)
66
63
  return source.length;
67
- for (let i = 0; i < line - 1; i++)
64
+ for (let i = 0; i < lineNumber - 1; i++)
68
65
  start += lines[i].length + 1;
69
- return start + column;
66
+ return start + columnNumber;
70
67
  }
71
- function numberToPos(source, offset) {
72
- if (typeof offset !== "number")
73
- return offset;
68
+ function offsetToLineNumber(source, offset) {
74
69
  if (offset > source.length) {
75
70
  throw new Error(
76
71
  `offset is longer than source length! offset ${offset} > length ${source.length}`
@@ -79,16 +74,13 @@ function numberToPos(source, offset) {
79
74
  const lines = source.split(lineSplitRE);
80
75
  let counted = 0;
81
76
  let line = 0;
82
- let column = 0;
83
77
  for (; line < lines.length; line++) {
84
78
  const lineLength = lines[line].length + 1;
85
- if (counted + lineLength >= offset) {
86
- column = offset - counted + 1;
79
+ if (counted + lineLength >= offset)
87
80
  break;
88
- }
89
81
  counted += lineLength;
90
82
  }
91
- return { line: line + 1, column };
83
+ return line + 1;
92
84
  }
93
85
 
94
- export { posToNumber as a, lineSplitRE as l, numberToPos as n, parseStacktrace as p };
86
+ export { positionToOffset as a, lineSplitRE as l, offsetToLineNumber as o, parseStacktrace as p };
@@ -1,4 +1,4 @@
1
- import { p as picocolors } from './chunk-utils-env.4afc6329.js';
1
+ import { p as picocolors } from './chunk-utils-env.3fdc1793.js';
2
2
 
3
3
  const {
4
4
  setTimeout: safeSetTimeout,
@@ -1,6 +1,6 @@
1
1
  import { fileURLToPath } from 'url';
2
- import { p as picocolors, E as EXIT_CODE_RESTART } from './chunk-utils-env.4afc6329.js';
3
- import { e as execa } from './vendor-index.a323f2d0.js';
2
+ import { p as picocolors, E as EXIT_CODE_RESTART } from './chunk-utils-env.3fdc1793.js';
3
+ import { e as execa } from './vendor-index.b2fdde54.js';
4
4
  import 'tty';
5
5
  import 'node:url';
6
6
  import 'path';
@@ -8,7 +8,7 @@ import 'node:buffer';
8
8
  import 'node:path';
9
9
  import 'node:child_process';
10
10
  import 'node:process';
11
- import './vendor-index.62932580.js';
11
+ import './vendor-index.7a2cebfe.js';
12
12
  import 'child_process';
13
13
  import './vendor-_commonjsHelpers.addc3445.js';
14
14
  import 'fs';
package/dist/cli.js CHANGED
@@ -1,6 +1,6 @@
1
- import { p as picocolors, n as normalize } from './chunk-utils-env.4afc6329.js';
1
+ import { p as picocolors, n as normalize } from './chunk-utils-env.3fdc1793.js';
2
2
  import { EventEmitter } from 'events';
3
- import { v as version, s as startVitest, d as divider } from './chunk-snapshot-manager.8c94a052.js';
3
+ import { v as version, s as startVitest, d as divider } from './chunk-snapshot-manager.70695b70.js';
4
4
  import 'tty';
5
5
  import 'node:url';
6
6
  import 'path';
@@ -8,7 +8,7 @@ import './chunk-integrations-coverage.befed097.js';
8
8
  import 'local-pkg';
9
9
  import './chunk-env-node.b3664da2.js';
10
10
  import 'node:console';
11
- import './chunk-typecheck-constants.e478eb98.js';
11
+ import './chunk-typecheck-constants.06e1fe5b.js';
12
12
  import 'node:path';
13
13
  import 'vite';
14
14
  import 'node:process';
@@ -21,10 +21,10 @@ import './vendor-_commonjsHelpers.addc3445.js';
21
21
  import 'vite-node/client';
22
22
  import 'vite-node/server';
23
23
  import 'node:fs/promises';
24
- import './vendor-index.a323f2d0.js';
24
+ import './vendor-index.b2fdde54.js';
25
25
  import 'node:buffer';
26
26
  import 'node:child_process';
27
- import './vendor-index.62932580.js';
27
+ import './vendor-index.7a2cebfe.js';
28
28
  import 'child_process';
29
29
  import 'assert';
30
30
  import 'buffer';
@@ -37,11 +37,11 @@ import 'node:worker_threads';
37
37
  import 'tinypool';
38
38
  import './vendor-index.783e7f3e.js';
39
39
  import 'perf_hooks';
40
- import './chunk-utils-timers.54caa12a.js';
41
- import './chunk-utils-source-map.95b8b3f0.js';
40
+ import './chunk-utils-timers.715da787.js';
41
+ import './chunk-utils-source-map.5278ee22.js';
42
42
  import 'crypto';
43
43
  import 'vite-node/utils';
44
- import './vendor-index.808a85a6.js';
44
+ import './vendor-index.9c919048.js';
45
45
  import 'node:crypto';
46
46
  import './chunk-magic-string.3a794426.js';
47
47
  import 'strip-literal';
package/dist/config.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { UserConfig as UserConfig$2, ConfigEnv } from 'vite';
2
2
  export { ConfigEnv } from 'vite';
3
- import { U as UserConfig$1, ao as ResolvedCoverageOptions, F as FakeTimerInstallOpts } from './types-2a26f28c.js';
3
+ import { U as UserConfig$1, ao as ResolvedCoverageOptions, F as FakeTimerInstallOpts } from './types-bae746aa.js';
4
4
  import 'tinybench';
5
5
  import 'vite-node/client';
6
6
  import 'vite-node/server';
package/dist/entry.js CHANGED
@@ -1,28 +1,28 @@
1
1
  import { promises } from 'node:fs';
2
- import { g as getWorkerState, a as resetModules } from './chunk-typecheck-constants.e478eb98.js';
3
- import { v as vi } from './chunk-utils-import.dc87c88c.js';
2
+ import { g as getWorkerState, a as resetModules } from './chunk-typecheck-constants.06e1fe5b.js';
3
+ import { v as vi } from './chunk-utils-import.e7f64637.js';
4
4
  import { a as envs } from './chunk-env-node.b3664da2.js';
5
- import { a as setupGlobalEnv, s as startTests, w as withEnv } from './chunk-runtime-setup.f79addc3.js';
5
+ import { a as setupGlobalEnv, s as startTests, w as withEnv } from './chunk-runtime-setup.a06d5c72.js';
6
6
  import 'node:path';
7
- import './chunk-utils-env.4afc6329.js';
7
+ import './chunk-utils-env.3fdc1793.js';
8
8
  import 'tty';
9
9
  import 'node:url';
10
10
  import 'path';
11
11
  import 'local-pkg';
12
- import './chunk-runtime-chain.198631fd.js';
12
+ import './chunk-runtime-chain.f51aa930.js';
13
13
  import 'util';
14
14
  import 'chai';
15
15
  import './vendor-_commonjsHelpers.addc3445.js';
16
- import './chunk-runtime-rpc.503623e9.js';
17
- import './chunk-utils-timers.54caa12a.js';
18
- import './chunk-utils-source-map.95b8b3f0.js';
16
+ import './chunk-runtime-rpc.54d72169.js';
17
+ import './chunk-utils-timers.715da787.js';
18
+ import './chunk-utils-source-map.5278ee22.js';
19
19
  import 'fs';
20
20
  import './spy.js';
21
21
  import 'tinyspy';
22
22
  import 'node:console';
23
23
  import 'perf_hooks';
24
24
  import './chunk-integrations-coverage.befed097.js';
25
- import './chunk-runtime-error.12631a44.js';
25
+ import './chunk-runtime-error.f5c8aaf2.js';
26
26
  import 'vite-node/source-map';
27
27
 
28
28
  function groupBy(collection, iteratee) {
@@ -1,4 +1,4 @@
1
- import { ae as Environment } from './types-2a26f28c.js';
1
+ import { af as Environment } from './types-bae746aa.js';
2
2
  import 'vite';
3
3
  import 'tinybench';
4
4
  import 'vite-node/client';
@@ -1,5 +1,5 @@
1
1
  import { SpyImpl } from 'tinyspy';
2
- import { w as SuiteAPI, v as TestAPI, aw as BenchmarkAPI, y as SuiteHooks, H as HookListener, L as TestContext, p as Suite, x as HookCleanupCallback, O as OnTestFailedHandler, q as Test } from './types-2a26f28c.js';
2
+ import { x as SuiteAPI, w as TestAPI, aw as BenchmarkAPI, z as SuiteHooks, H as HookListener, N as TestContext, q as Suite, y as HookCleanupCallback, O as OnTestFailedHandler, r as Test } from './types-bae746aa.js';
3
3
 
4
4
  declare type Not<T extends boolean> = T extends true ? false : true;
5
5
  declare type And<Types extends boolean[]> = Types[number] extends true ? true : false;
package/dist/index.d.ts CHANGED
@@ -1,7 +1,7 @@
1
- import { s as spyOn, f as fn, M as MaybeMockedDeep, a as MaybeMocked, b as MaybePartiallyMocked, c as MaybePartiallyMockedDeep, E as EnhancedSpy } from './index-40ebba2b.js';
2
- export { A as AssertType, E as EnhancedSpy, q as ExpectTypeOf, x as Mock, y as MockContext, w as MockInstance, z as Mocked, B as MockedClass, u as MockedFunction, v as MockedObject, S as SpyInstance, j as afterAll, l as afterEach, r as assertType, h as beforeAll, k as beforeEach, g as bench, n as createExpect, e as describe, m as expect, p as expectTypeOf, i as it, o as onTestFailed, d as suite, t as test } from './index-40ebba2b.js';
3
- import { D as DoneCallback, F as FakeTimerInstallOpts, R as RuntimeConfig, a as File, T as TaskResultPack, b as ResolvedConfig, M as ModuleGraphData, c as Reporter } from './types-2a26f28c.js';
4
- export { a1 as AfterSuiteRunMeta, A as ApiConfig, a7 as ArgumentsType, a6 as Arrayable, a4 as Awaitable, ap as BaseCoverageOptions, av as BenchFunction, at as Benchmark, aw as BenchmarkAPI, au as BenchmarkResult, as as BenchmarkUserOptions, B as BuiltinEnvironment, i as CSSModuleScopeStrategy, C as CollectLineNumbers, f as CollectLines, ab as Constructable, h as Context, ar as CoverageC8Options, aq as CoverageIstanbulOptions, an as CoverageOptions, ak as CoverageProvider, al as CoverageProviderModule, am as CoverageReporter, a9 as DeepMerge, D as DoneCallback, ae as Environment, E as EnvironmentOptions, ad as EnvironmentReturn, ai as ErrorWithDiff, a as File, x as HookCleanupCallback, H as HookListener, I as InlineConfig, J as JSDOMOptions, a8 as MergeInsertions, ac as ModuleCache, M as ModuleGraphData, aa as MutableArray, a5 as Nullable, aj as OnServerRestartHandler, O as OnTestFailedHandler, ah as ParsedStack, ag as Position, d as RawErrsMap, c as Reporter, a0 as ResolveIdFunction, b as ResolvedConfig, ao as ResolvedCoverageOptions, g as RootAndTarget, l as RunMode, R as RuntimeConfig, K as RuntimeContext, S as SequenceHooks, P as SnapshotData, X as SnapshotMatchOptions, Y as SnapshotResult, W as SnapshotStateOptions, _ as SnapshotSummary, Q as SnapshotUpdateState, p as Suite, w as SuiteAPI, z as SuiteCollector, G as SuiteFactory, y as SuiteHooks, s as Task, n as TaskBase, o as TaskResult, T as TaskResultPack, m as TaskState, q as Test, v as TestAPI, L as TestContext, t as TestFunction, u as TestOptions, e as TscErrorInfo, r as TypeCheck, k as TypecheckConfig, Z as UncheckedSnapshot, U as UserConfig, af as UserConsoleLog, N as Vitest, V as VitestEnvironment, j as VitestRunMode, $ as WorkerContext, a3 as WorkerGlobalState, a2 as WorkerRPC } from './types-2a26f28c.js';
1
+ import { s as spyOn, f as fn, M as MaybeMockedDeep, a as MaybeMocked, b as MaybePartiallyMocked, c as MaybePartiallyMockedDeep, E as EnhancedSpy } from './index-761e769b.js';
2
+ export { A as AssertType, E as EnhancedSpy, q as ExpectTypeOf, x as Mock, y as MockContext, w as MockInstance, z as Mocked, B as MockedClass, u as MockedFunction, v as MockedObject, S as SpyInstance, j as afterAll, l as afterEach, r as assertType, h as beforeAll, k as beforeEach, g as bench, n as createExpect, e as describe, m as expect, p as expectTypeOf, i as it, o as onTestFailed, d as suite, t as test } from './index-761e769b.js';
3
+ import { D as DoneCallback, F as FakeTimerInstallOpts, M as MockFactoryWithHelper, R as RuntimeConfig, a as File, T as TaskResultPack, b as ResolvedConfig, c as ModuleGraphData, d as Reporter } from './types-bae746aa.js';
4
+ export { a2 as AfterSuiteRunMeta, A as ApiConfig, a8 as ArgumentsType, a7 as Arrayable, a5 as Awaitable, ap as BaseCoverageOptions, av as BenchFunction, at as Benchmark, aw as BenchmarkAPI, au as BenchmarkResult, as as BenchmarkUserOptions, B as BuiltinEnvironment, j as CSSModuleScopeStrategy, C as CollectLineNumbers, g as CollectLines, ac as Constructable, i as Context, ar as CoverageC8Options, aq as CoverageIstanbulOptions, an as CoverageOptions, ak as CoverageProvider, al as CoverageProviderModule, am as CoverageReporter, aa as DeepMerge, D as DoneCallback, af as Environment, E as EnvironmentOptions, ae as EnvironmentReturn, ai as ErrorWithDiff, a as File, y as HookCleanupCallback, H as HookListener, I as InlineConfig, J as JSDOMOptions, a9 as MergeInsertions, ad as ModuleCache, c as ModuleGraphData, ab as MutableArray, a6 as Nullable, aj as OnServerRestartHandler, O as OnTestFailedHandler, ah as ParsedStack, e as RawErrsMap, d as Reporter, a1 as ResolveIdFunction, b as ResolvedConfig, ao as ResolvedCoverageOptions, h as RootAndTarget, m as RunMode, R as RuntimeConfig, L as RuntimeContext, S as SequenceHooks, Q as SnapshotData, Y as SnapshotMatchOptions, Z as SnapshotResult, X as SnapshotStateOptions, $ as SnapshotSummary, W as SnapshotUpdateState, q as Suite, x as SuiteAPI, G as SuiteCollector, K as SuiteFactory, z as SuiteHooks, t as Task, o as TaskBase, p as TaskResult, T as TaskResultPack, n as TaskState, r as Test, w as TestAPI, N as TestContext, u as TestFunction, v as TestOptions, f as TscErrorInfo, s as TypeCheck, l as TypecheckConfig, _ as UncheckedSnapshot, U as UserConfig, ag as UserConsoleLog, P as Vitest, V as VitestEnvironment, k as VitestRunMode, a0 as WorkerContext, a4 as WorkerGlobalState, a3 as WorkerRPC } from './types-bae746aa.js';
5
5
  import { TransformResult } from 'vite';
6
6
  import * as chai from 'chai';
7
7
  export { chai };
@@ -69,7 +69,7 @@ declare class VitestUtils {
69
69
  * @param path Path to the module. Can be aliased, if your config supports it
70
70
  * @param factory Factory for the mocked module. Has the highest priority.
71
71
  */
72
- mock(path: string, factory?: () => any): void;
72
+ mock(path: string, factory?: MockFactoryWithHelper): void;
73
73
  /**
74
74
  * Removes module from mocked registry. All subsequent calls to import will
75
75
  * return original module even if it was mocked.
@@ -90,7 +90,7 @@ declare class VitestUtils {
90
90
  * @param path Path to the module. Can be aliased, if your config supports it
91
91
  * @returns Actual module without spies
92
92
  */
93
- importActual<T>(path: string): Promise<T>;
93
+ importActual<T = unknown>(path: string): Promise<T>;
94
94
  /**
95
95
  * Imports a module with all of its properties and nested properties mocked.
96
96
  * For the rules applied, see docs.
package/dist/index.js CHANGED
@@ -1,22 +1,22 @@
1
- export { b as bench, c as createExpect, d as describe, e as expect, i as it, s as suite, t as test } from './chunk-runtime-chain.198631fd.js';
2
- import { e as dist } from './chunk-utils-import.dc87c88c.js';
3
- export { a as afterAll, d as afterEach, f as assertType, b as beforeAll, c as beforeEach, k as getRunningMode, h as isFirstRun, l as isWatchMode, o as onTestFailed, g as runOnce, v as vi, j as vitest, w as withCallback } from './chunk-utils-import.dc87c88c.js';
1
+ export { b as bench, c as createExpect, d as describe, e as expect, i as it, s as suite, t as test } from './chunk-runtime-chain.f51aa930.js';
2
+ import { e as dist } from './chunk-utils-import.e7f64637.js';
3
+ export { a as afterAll, d as afterEach, f as assertType, b as beforeAll, c as beforeEach, k as getRunningMode, h as isFirstRun, l as isWatchMode, o as onTestFailed, g as runOnce, v as vi, j as vitest, w as withCallback } from './chunk-utils-import.e7f64637.js';
4
4
  import * as chai from 'chai';
5
5
  export { chai };
6
6
  export { assert, should } from 'chai';
7
7
  import 'util';
8
- import './chunk-typecheck-constants.e478eb98.js';
8
+ import './chunk-typecheck-constants.06e1fe5b.js';
9
9
  import 'node:path';
10
- import './chunk-utils-env.4afc6329.js';
10
+ import './chunk-utils-env.3fdc1793.js';
11
11
  import 'tty';
12
12
  import 'node:url';
13
13
  import 'path';
14
14
  import 'local-pkg';
15
15
  import './vendor-_commonjsHelpers.addc3445.js';
16
- import './chunk-runtime-rpc.503623e9.js';
17
- import './chunk-utils-timers.54caa12a.js';
16
+ import './chunk-runtime-rpc.54d72169.js';
17
+ import './chunk-utils-timers.715da787.js';
18
18
  import 'node:fs';
19
- import './chunk-utils-source-map.95b8b3f0.js';
19
+ import './chunk-utils-source-map.5278ee22.js';
20
20
  import 'fs';
21
21
  import './spy.js';
22
22
  import 'tinyspy';
package/dist/loader.js CHANGED
@@ -2,7 +2,7 @@ import { pathToFileURL } from 'node:url';
2
2
  import { readFile } from 'node:fs/promises';
3
3
  import { i as isNodeBuiltin, h as hasCJSSyntax } from './vendor-index.2e96c50b.js';
4
4
  import { normalizeModuleId } from 'vite-node/utils';
5
- import { g as getWorkerState } from './chunk-typecheck-constants.e478eb98.js';
5
+ import { g as getWorkerState } from './chunk-typecheck-constants.06e1fe5b.js';
6
6
  import 'acorn';
7
7
  import 'node:module';
8
8
  import 'node:fs';
@@ -13,7 +13,7 @@ import 'module';
13
13
  import 'assert';
14
14
  import 'util';
15
15
  import 'node:path';
16
- import './chunk-utils-env.4afc6329.js';
16
+ import './chunk-utils-env.3fdc1793.js';
17
17
  import 'tty';
18
18
  import 'local-pkg';
19
19
 
package/dist/node.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { j as VitestRunMode, U as UserConfig, N as Vitest, ax as MockMap, ay as TestSequencer } from './types-2a26f28c.js';
2
- export { ay as TestSequencer, aA as TestSequencerConstructor, N as Vitest, az as startVitest } from './types-2a26f28c.js';
1
+ import { k as VitestRunMode, U as UserConfig, P as Vitest, ax as MockFactory, ay as MockMap, az as TestSequencer } from './types-bae746aa.js';
2
+ export { az as TestSequencer, aB as TestSequencerConstructor, P as Vitest, aA as startVitest } from './types-bae746aa.js';
3
3
  import { UserConfig as UserConfig$1, Plugin } from 'vite';
4
4
  import { ViteNodeRunner } from 'vite-node/client';
5
5
  import { ViteNodeRunnerOptions } from 'vite-node';
@@ -26,23 +26,23 @@ declare class VitestMocker {
26
26
  private get moduleCache();
27
27
  getSuiteFilepath(): string;
28
28
  getMocks(): {
29
- [x: string]: string | (() => unknown) | null;
29
+ [x: string]: string | MockFactory | null;
30
30
  };
31
31
  private resolvePath;
32
32
  private resolveMocks;
33
33
  private callFunctionMock;
34
34
  getMockPath(dep: string): string;
35
- getDependencyMock(id: string): string | (() => unknown) | null;
35
+ getDependencyMock(id: string): string | MockFactory | null;
36
36
  normalizePath(path: string): string;
37
37
  resolveMockPath(mockPath: string, external: string | null): string | null;
38
38
  mockObject(object: Record<Key, any>, mockExports?: Record<Key, any>): Record<Key, any>;
39
39
  unmockPath(path: string): void;
40
- mockPath(originalId: string, path: string, external: string | null, factory?: () => any): void;
40
+ mockPath(originalId: string, path: string, external: string | null, factory?: MockFactory): void;
41
41
  importActual<T>(rawId: string, importee: string): Promise<T>;
42
42
  importMock(rawId: string, importee: string): Promise<any>;
43
43
  initializeSpyModule(): Promise<void>;
44
44
  requestWithMock(url: string, callstack: string[]): Promise<any>;
45
- queueMock(id: string, importer: string, factory?: () => unknown): void;
45
+ queueMock(id: string, importer: string, factory?: MockFactory): void;
46
46
  queueUnmock(id: string, importer: string): void;
47
47
  }
48
48
 
package/dist/node.js CHANGED
@@ -1,6 +1,6 @@
1
- export { B as BaseSequencer, V as VitestPlugin, c as createVitest, s as startVitest } from './chunk-snapshot-manager.8c94a052.js';
2
- export { V as VitestRunner } from './chunk-runtime-mocker.03096876.js';
3
- import './chunk-utils-env.4afc6329.js';
1
+ export { B as BaseSequencer, V as VitestPlugin, c as createVitest, s as startVitest } from './chunk-snapshot-manager.70695b70.js';
2
+ export { V as VitestRunner } from './chunk-runtime-mocker.887bf8c8.js';
3
+ import './chunk-utils-env.3fdc1793.js';
4
4
  import 'tty';
5
5
  import 'node:url';
6
6
  import 'path';
@@ -8,7 +8,7 @@ import './chunk-integrations-coverage.befed097.js';
8
8
  import 'local-pkg';
9
9
  import './chunk-env-node.b3664da2.js';
10
10
  import 'node:console';
11
- import './chunk-typecheck-constants.e478eb98.js';
11
+ import './chunk-typecheck-constants.06e1fe5b.js';
12
12
  import 'node:path';
13
13
  import 'vite';
14
14
  import 'node:process';
@@ -22,10 +22,10 @@ import './vendor-_commonjsHelpers.addc3445.js';
22
22
  import 'vite-node/client';
23
23
  import 'vite-node/server';
24
24
  import 'node:fs/promises';
25
- import './vendor-index.a323f2d0.js';
25
+ import './vendor-index.b2fdde54.js';
26
26
  import 'node:buffer';
27
27
  import 'node:child_process';
28
- import './vendor-index.62932580.js';
28
+ import './vendor-index.7a2cebfe.js';
29
29
  import 'child_process';
30
30
  import 'assert';
31
31
  import 'buffer';
@@ -38,11 +38,11 @@ import 'node:worker_threads';
38
38
  import 'tinypool';
39
39
  import './vendor-index.783e7f3e.js';
40
40
  import 'perf_hooks';
41
- import './chunk-utils-timers.54caa12a.js';
42
- import './chunk-utils-source-map.95b8b3f0.js';
41
+ import './chunk-utils-timers.715da787.js';
42
+ import './chunk-utils-source-map.5278ee22.js';
43
43
  import 'crypto';
44
44
  import 'vite-node/utils';
45
- import './vendor-index.808a85a6.js';
45
+ import './vendor-index.9c919048.js';
46
46
  import 'node:crypto';
47
47
  import './chunk-magic-string.3a794426.js';
48
48
  import 'strip-literal';
package/dist/suite.js CHANGED
@@ -1,18 +1,18 @@
1
1
  import 'util';
2
2
  import 'chai';
3
- import './chunk-typecheck-constants.e478eb98.js';
4
- export { b as bench, f as clearCollectorContext, q as createSuiteHooks, h as defaultSuite, d as describe, g as getCurrentSuite, i as it, s as suite, t as test } from './chunk-runtime-chain.198631fd.js';
3
+ import './chunk-typecheck-constants.06e1fe5b.js';
4
+ export { b as bench, f as clearCollectorContext, q as createSuiteHooks, h as defaultSuite, d as describe, g as getCurrentSuite, i as it, s as suite, t as test } from './chunk-runtime-chain.f51aa930.js';
5
5
  import 'node:path';
6
- import './chunk-utils-env.4afc6329.js';
6
+ import './chunk-utils-env.3fdc1793.js';
7
7
  import 'tty';
8
8
  import 'node:url';
9
9
  import 'path';
10
10
  import 'local-pkg';
11
11
  import './vendor-_commonjsHelpers.addc3445.js';
12
- import './chunk-runtime-rpc.503623e9.js';
13
- import './chunk-utils-timers.54caa12a.js';
12
+ import './chunk-runtime-rpc.54d72169.js';
13
+ import './chunk-utils-timers.715da787.js';
14
14
  import 'node:fs';
15
- import './chunk-utils-source-map.95b8b3f0.js';
15
+ import './chunk-utils-source-map.5278ee22.js';
16
16
  import 'fs';
17
17
  import './spy.js';
18
18
  import 'tinyspy';
@@ -234,6 +234,7 @@ declare class Typechecker {
234
234
  start(): Promise<void>;
235
235
  getResult(): ErrorsCache;
236
236
  getTestFiles(): File[];
237
+ getTestPacks(): TaskResultPack[];
237
238
  }
238
239
 
239
240
  type RunWithFiles = (files: string[], invalidates?: string[]) => Promise<void>;
@@ -409,7 +410,9 @@ declare class Vitest {
409
410
  onAfterSetServer(fn: OnServerRestartHandler): void;
410
411
  }
411
412
 
412
- type MockMap = Map<string, Record<string, string | null | (() => unknown)>>;
413
+ type MockFactoryWithHelper = (importOriginal: <T = unknown>() => Promise<T>) => any;
414
+ type MockFactory = () => any;
415
+ type MockMap = Map<string, Record<string, string | null | MockFactory>>;
413
416
 
414
417
  interface TestSequencer {
415
418
  /**
@@ -838,17 +841,11 @@ interface UserConsoleLog {
838
841
  time: number;
839
842
  size: number;
840
843
  }
841
- interface Position {
842
- source?: string;
843
- line: number;
844
- column: number;
845
- }
846
844
  interface ParsedStack {
847
845
  method: string;
848
846
  file: string;
849
847
  line: number;
850
848
  column: number;
851
- sourcePos?: Position;
852
849
  }
853
850
  interface ErrorWithDiff extends Error {
854
851
  name: string;
@@ -2248,4 +2245,4 @@ type Context = RootAndTarget & {
2248
2245
  lastActivePath?: string;
2249
2246
  };
2250
2247
 
2251
- export { WorkerContext as $, ApiConfig as A, BuiltinEnvironment as B, CollectLineNumbers as C, DoneCallback as D, EnvironmentOptions as E, FakeTimerInstallOpts as F, SuiteFactory as G, HookListener as H, InlineConfig as I, JSDOMOptions as J, RuntimeContext as K, TestContext as L, ModuleGraphData as M, Vitest as N, OnTestFailedHandler as O, SnapshotData as P, SnapshotUpdateState as Q, RuntimeConfig as R, SequenceHooks as S, TaskResultPack as T, UserConfig as U, VitestEnvironment as V, SnapshotStateOptions as W, SnapshotMatchOptions as X, SnapshotResult as Y, UncheckedSnapshot as Z, SnapshotSummary as _, File as a, ResolveIdFunction as a0, AfterSuiteRunMeta as a1, WorkerRPC as a2, WorkerGlobalState as a3, Awaitable as a4, Nullable as a5, Arrayable as a6, ArgumentsType$1 as a7, MergeInsertions as a8, DeepMerge as a9, TestSequencerConstructor as aA, MutableArray as aa, Constructable as ab, ModuleCache as ac, EnvironmentReturn as ad, Environment as ae, UserConsoleLog as af, Position as ag, ParsedStack as ah, ErrorWithDiff as ai, OnServerRestartHandler as aj, CoverageProvider as ak, CoverageProviderModule as al, CoverageReporter as am, CoverageOptions as an, ResolvedCoverageOptions as ao, BaseCoverageOptions as ap, CoverageIstanbulOptions as aq, CoverageC8Options as ar, BenchmarkUserOptions as as, Benchmark as at, BenchmarkResult as au, BenchFunction as av, BenchmarkAPI as aw, MockMap as ax, TestSequencer as ay, startVitest as az, ResolvedConfig as b, Reporter as c, RawErrsMap as d, TscErrorInfo as e, CollectLines as f, RootAndTarget as g, Context as h, CSSModuleScopeStrategy as i, VitestRunMode as j, TypecheckConfig as k, RunMode as l, TaskState as m, TaskBase as n, TaskResult as o, Suite as p, Test as q, TypeCheck as r, Task as s, TestFunction as t, TestOptions as u, TestAPI as v, SuiteAPI as w, HookCleanupCallback as x, SuiteHooks as y, SuiteCollector as z };
2248
+ export { SnapshotSummary as $, ApiConfig as A, BuiltinEnvironment as B, CollectLineNumbers as C, DoneCallback as D, EnvironmentOptions as E, FakeTimerInstallOpts as F, SuiteCollector as G, HookListener as H, InlineConfig as I, JSDOMOptions as J, SuiteFactory as K, RuntimeContext as L, MockFactoryWithHelper as M, TestContext as N, OnTestFailedHandler as O, Vitest as P, SnapshotData as Q, RuntimeConfig as R, SequenceHooks as S, TaskResultPack as T, UserConfig as U, VitestEnvironment as V, SnapshotUpdateState as W, SnapshotStateOptions as X, SnapshotMatchOptions as Y, SnapshotResult as Z, UncheckedSnapshot as _, File as a, WorkerContext as a0, ResolveIdFunction as a1, AfterSuiteRunMeta as a2, WorkerRPC as a3, WorkerGlobalState as a4, Awaitable as a5, Nullable as a6, Arrayable as a7, ArgumentsType$1 as a8, MergeInsertions as a9, startVitest as aA, TestSequencerConstructor as aB, DeepMerge as aa, MutableArray as ab, Constructable as ac, ModuleCache as ad, EnvironmentReturn as ae, Environment as af, UserConsoleLog as ag, ParsedStack as ah, ErrorWithDiff as ai, OnServerRestartHandler as aj, CoverageProvider as ak, CoverageProviderModule as al, CoverageReporter as am, CoverageOptions as an, ResolvedCoverageOptions as ao, BaseCoverageOptions as ap, CoverageIstanbulOptions as aq, CoverageC8Options as ar, BenchmarkUserOptions as as, Benchmark as at, BenchmarkResult as au, BenchFunction as av, BenchmarkAPI as aw, MockFactory as ax, MockMap as ay, TestSequencer as az, ResolvedConfig as b, ModuleGraphData as c, Reporter as d, RawErrsMap as e, TscErrorInfo as f, CollectLines as g, RootAndTarget as h, Context as i, CSSModuleScopeStrategy as j, VitestRunMode as k, TypecheckConfig as l, RunMode as m, TaskState as n, TaskBase as o, TaskResult as p, Suite as q, Test as r, TypeCheck as s, Task as t, TestFunction as u, TestOptions as v, TestAPI as w, SuiteAPI as x, HookCleanupCallback as y, SuiteHooks as z };
@@ -2,7 +2,7 @@ import { Buffer } from 'node:buffer';
2
2
  import path from 'node:path';
3
3
  import childProcess from 'node:child_process';
4
4
  import process$1 from 'node:process';
5
- import { s as signalExit, m as mergeStream, g as getStream, c as crossSpawn } from './vendor-index.62932580.js';
5
+ import { s as signalExit, m as mergeStream, g as getStream, c as crossSpawn } from './vendor-index.7a2cebfe.js';
6
6
  import url from 'node:url';
7
7
  import { constants } from 'os';
8
8
  import os from 'node:os';
package/dist/worker.js CHANGED
@@ -1,11 +1,11 @@
1
- import { b as resolve, e as distDir } from './chunk-utils-env.4afc6329.js';
1
+ import { b as resolve, e as distDir } from './chunk-utils-env.3fdc1793.js';
2
2
  import { c as createBirpc } from './vendor-index.783e7f3e.js';
3
3
  import { workerId } from 'tinypool';
4
4
  import { ModuleCacheMap } from 'vite-node/client';
5
- import { g as getWorkerState } from './chunk-typecheck-constants.e478eb98.js';
6
- import { e as executeInViteNode } from './chunk-runtime-mocker.03096876.js';
7
- import { r as rpc } from './chunk-runtime-rpc.503623e9.js';
8
- import { p as processError } from './chunk-runtime-error.12631a44.js';
5
+ import { g as getWorkerState } from './chunk-typecheck-constants.06e1fe5b.js';
6
+ import { e as executeInViteNode } from './chunk-runtime-mocker.887bf8c8.js';
7
+ import { r as rpc } from './chunk-runtime-rpc.54d72169.js';
8
+ import { p as processError } from './chunk-runtime-error.f5c8aaf2.js';
9
9
  import 'tty';
10
10
  import 'node:url';
11
11
  import 'path';
@@ -22,7 +22,7 @@ import 'fs';
22
22
  import 'module';
23
23
  import 'assert';
24
24
  import 'util';
25
- import './chunk-utils-timers.54caa12a.js';
25
+ import './chunk-utils-timers.715da787.js';
26
26
  import 'chai';
27
27
 
28
28
  let _viteNode;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "vitest",
3
3
  "type": "module",
4
- "version": "0.26.2",
4
+ "version": "0.26.3",
5
5
  "description": "A blazing fast unit test framework powered by Vite",
6
6
  "author": "Anthony Fu <anthonyfu117@hotmail.com>",
7
7
  "license": "MIT",
@@ -114,7 +114,7 @@
114
114
  "tinypool": "^0.3.0",
115
115
  "tinyspy": "^1.0.2",
116
116
  "vite": "^3.0.0 || ^4.0.0",
117
- "vite-node": "0.26.2"
117
+ "vite-node": "0.26.3"
118
118
  },
119
119
  "devDependencies": {
120
120
  "@antfu/install-pkg": "^0.1.1",
@@ -155,7 +155,7 @@
155
155
  "strip-ansi": "^7.0.1",
156
156
  "typescript": "^4.9.4",
157
157
  "ws": "^8.11.0",
158
- "@vitest/ui": "0.26.2"
158
+ "@vitest/ui": "0.26.3"
159
159
  },
160
160
  "scripts": {
161
161
  "build": "rimraf dist && rollup -c",