vitest 0.26.0 → 0.26.2

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 (41) hide show
  1. package/browser.d.ts +1 -0
  2. package/dist/browser.d.ts +5 -5
  3. package/dist/browser.js +16 -14
  4. package/dist/{chunk-api-setup.08f3b356.js → chunk-api-setup.46ee0021.js} +7 -5
  5. package/dist/{chunk-env-node.67948209.js → chunk-env-node.b3664da2.js} +1 -1
  6. package/dist/{chunk-install-pkg.579a5a27.js → chunk-install-pkg.31846bc1.js} +20 -20
  7. package/dist/chunk-integrations-globals.5af12e76.js +27 -0
  8. package/dist/{chunk-node-git.5a1b1656.js → chunk-node-git.43b341db.js} +10 -6
  9. package/dist/{chunk-runtime-chain.e655f6cc.js → chunk-runtime-chain.198631fd.js} +8 -7
  10. package/dist/{chunk-runtime-error.dfbbf9be.js → chunk-runtime-error.12631a44.js} +6 -4
  11. package/dist/{chunk-runtime-mocker.35fabb8b.js → chunk-runtime-mocker.03096876.js} +11 -4
  12. package/dist/{chunk-runtime-rpc.7959fc79.js → chunk-runtime-rpc.503623e9.js} +2 -2
  13. package/dist/{chunk-runtime-setup.4c1b529e.js → chunk-runtime-setup.f79addc3.js} +17 -16
  14. package/dist/{chunk-snapshot-manager.7d978f79.js → chunk-snapshot-manager.8c94a052.js} +74 -47
  15. package/dist/{chunk-typecheck-constants.3f865d14.js → chunk-typecheck-constants.e478eb98.js} +3 -3
  16. package/dist/{chunk-utils-env.03f840f2.js → chunk-utils-env.4afc6329.js} +8 -8
  17. package/dist/{chunk-utils-import.ca62c9d7.js → chunk-utils-import.dc87c88c.js} +41 -40
  18. package/dist/{chunk-utils-source-map.5bbb50cd.js → chunk-utils-source-map.95b8b3f0.js} +2 -2
  19. package/dist/{chunk-utils-timers.793fd179.js → chunk-utils-timers.54caa12a.js} +31 -15
  20. package/dist/cli-wrapper.js +10 -5
  21. package/dist/cli.js +31 -19
  22. package/dist/config.d.ts +3 -3
  23. package/dist/entry.js +16 -14
  24. package/dist/environments.d.ts +3 -3
  25. package/dist/environments.js +2 -2
  26. package/dist/{index-c3f83a58.d.ts → index-40ebba2b.d.ts} +1 -1
  27. package/dist/index.d.ts +6 -6
  28. package/dist/index.js +12 -10
  29. package/dist/loader.js +10 -6
  30. package/dist/node.d.ts +5 -4
  31. package/dist/node.js +26 -18
  32. package/dist/suite.js +10 -8
  33. package/dist/{types-56bcd6c3.d.ts → types-2a26f28c.d.ts} +28 -6
  34. package/dist/{vendor-index.96e022fd.js → vendor-index.2e96c50b.js} +6 -2
  35. package/dist/{vendor-index.e1d4cf84.js → vendor-index.62932580.js} +16 -16
  36. package/dist/{vendor-index.9c919048.js → vendor-index.808a85a6.js} +0 -0
  37. package/dist/{vendor-index.737c3cff.js → vendor-index.a323f2d0.js} +9 -8
  38. package/dist/worker.js +14 -9
  39. package/environments.d.ts +1 -0
  40. package/package.json +4 -4
  41. package/dist/chunk-integrations-globals.cab94a09.js +0 -25
package/browser.d.ts ADDED
@@ -0,0 +1 @@
1
+ export * from './dist/browser'
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-c3f83a58.js';
2
- import { b as ResolvedConfig } from './types-56bcd6c3.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-56bcd6c3.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-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';
4
4
  import * as chai from 'chai';
5
5
  export { chai };
6
6
  export { assert, should } from 'chai';
@@ -10,8 +10,8 @@ import 'vite';
10
10
  import 'vite-node/client';
11
11
  import 'vite-node/server';
12
12
  import 'vite-node';
13
- import 'fs';
14
- import 'worker_threads';
13
+ import 'node:fs';
14
+ import 'node:worker_threads';
15
15
 
16
16
  declare function startTests(paths: string[], config: ResolvedConfig): Promise<void>;
17
17
 
package/dist/browser.js CHANGED
@@ -1,30 +1,32 @@
1
- export { c as createExpect, d as describe, e as expect, i as it, s as suite, t as test } from './chunk-runtime-chain.e655f6cc.js';
2
- import { e as dist } from './chunk-utils-import.ca62c9d7.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.ca62c9d7.js';
4
- export { a as setupGlobalEnv, s as startTests } from './chunk-runtime-setup.4c1b529e.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.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';
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.3f865d14.js';
10
- import 'path';
11
- import './chunk-utils-env.03f840f2.js';
9
+ import './chunk-typecheck-constants.e478eb98.js';
10
+ import 'node:path';
11
+ import './chunk-utils-env.4afc6329.js';
12
12
  import 'tty';
13
- import 'url';
13
+ import 'node:url';
14
+ import 'path';
14
15
  import 'local-pkg';
15
16
  import './vendor-_commonjsHelpers.addc3445.js';
16
- import './chunk-runtime-rpc.7959fc79.js';
17
- import './chunk-utils-timers.793fd179.js';
17
+ import './chunk-runtime-rpc.503623e9.js';
18
+ import './chunk-utils-timers.54caa12a.js';
19
+ import 'node:fs';
20
+ import './chunk-utils-source-map.95b8b3f0.js';
18
21
  import 'fs';
19
- import './chunk-utils-source-map.5bbb50cd.js';
20
22
  import './spy.js';
21
23
  import 'tinyspy';
22
24
  import 'perf_hooks';
23
25
  import './chunk-integrations-coverage.befed097.js';
24
- import './chunk-runtime-error.dfbbf9be.js';
26
+ import './chunk-runtime-error.12631a44.js';
25
27
  import 'vite-node/source-map';
26
- import './chunk-env-node.67948209.js';
27
- import 'console';
28
+ import './chunk-env-node.b3664da2.js';
29
+ import 'node:console';
28
30
 
29
31
 
30
32
 
@@ -1,4 +1,4 @@
1
- import { promises } from 'fs';
1
+ import { promises } from 'node:fs';
2
2
  import { c as createBirpc } from './vendor-index.783e7f3e.js';
3
3
  import require$$0$1 from 'stream';
4
4
  import require$$0 from 'zlib';
@@ -8,11 +8,13 @@ import require$$5 from 'crypto';
8
8
  import require$$2 from 'events';
9
9
  import require$$1 from 'https';
10
10
  import require$$2$1 from 'http';
11
- import url from 'url';
12
- import { A as API_PATH } from './chunk-utils-env.03f840f2.js';
13
- import './chunk-typecheck-constants.3f865d14.js';
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';
14
14
  import 'tty';
15
+ import 'node:url';
15
16
  import 'path';
17
+ import 'node:path';
16
18
  import 'local-pkg';
17
19
 
18
20
  async function getModuleGraph(ctx, id) {
@@ -2567,7 +2569,7 @@ const http$1 = require$$2$1;
2567
2569
  const net = require$$3;
2568
2570
  const tls = require$$4;
2569
2571
  const { randomBytes, createHash: createHash$1 } = require$$5;
2570
- const { URL: URL$1 } = url;
2572
+ const { URL: URL$1 } = require$$7;
2571
2573
 
2572
2574
  const PerMessageDeflate$1 = permessageDeflate;
2573
2575
  const Receiver = receiver;
@@ -1,4 +1,4 @@
1
- import { Console } from 'console';
1
+ import { Console } from 'node:console';
2
2
  import { importModule } from 'local-pkg';
3
3
 
4
4
  var node = {
@@ -1,10 +1,10 @@
1
- import fs$2 from 'fs';
2
- import path$2 from 'path';
1
+ import require$$0 from 'fs';
2
+ import g from 'path';
3
3
  import util from 'util';
4
- import childProcess$1 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.e1d4cf84.js';
6
- import { o as onetime$1 } from './vendor-index.9c919048.js';
7
- import require$$0 from 'os';
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';
7
+ import require$$0$1 from 'os';
8
8
  import './vendor-_commonjsHelpers.addc3445.js';
9
9
  import 'assert';
10
10
  import 'events';
@@ -205,8 +205,8 @@ const pLocate$1 = async (iterable, tester, options) => {
205
205
 
206
206
  var pLocate_1 = pLocate$1;
207
207
 
208
- const path$1 = path$2;
209
- const fs$1 = fs$2;
208
+ const path$1 = g;
209
+ const fs$1 = require$$0;
210
210
  const {promisify: promisify$1} = util;
211
211
  const pLocate = pLocate_1;
212
212
 
@@ -275,7 +275,7 @@ locatePath.exports.sync = (paths, options) => {
275
275
 
276
276
  var pathExists = {exports: {}};
277
277
 
278
- const fs = fs$2;
278
+ const fs = require$$0;
279
279
  const {promisify} = util;
280
280
 
281
281
  const pAccess = promisify(fs.access);
@@ -299,7 +299,7 @@ pathExists.exports.sync = path => {
299
299
  };
300
300
 
301
301
  (function (module) {
302
- const path = path$2;
302
+ const path = g;
303
303
  const locatePath$1 = locatePath.exports;
304
304
  const pathExists$1 = pathExists.exports;
305
305
 
@@ -411,7 +411,7 @@ var stripFinalNewline$1 = input => {
411
411
  var npmRunPath$1 = {exports: {}};
412
412
 
413
413
  (function (module) {
414
- const path = path$2;
414
+ const path = g;
415
415
  const pathKey$1 = pathKey.exports;
416
416
 
417
417
  const npmRunPath = options => {
@@ -759,7 +759,7 @@ standard:"posix"};
759
759
  const SIGRTMIN=34;
760
760
  const SIGRTMAX=64;realtime.SIGRTMAX=SIGRTMAX;
761
761
 
762
- Object.defineProperty(signals,"__esModule",{value:true});signals.getSignals=void 0;var _os$1=require$$0;
762
+ Object.defineProperty(signals,"__esModule",{value:true});signals.getSignals=void 0;var _os$1=require$$0$1;
763
763
 
764
764
  var _core=core;
765
765
  var _realtime$1=realtime;
@@ -794,7 +794,7 @@ const number=supported?constantSignal:defaultNumber;
794
794
  return {name,number,description,supported,action,forced,standard};
795
795
  };
796
796
 
797
- Object.defineProperty(main,"__esModule",{value:true});main.signalsByNumber=main.signalsByName=void 0;var _os=require$$0;
797
+ Object.defineProperty(main,"__esModule",{value:true});main.signalsByNumber=main.signalsByName=void 0;var _os=require$$0$1;
798
798
 
799
799
  var _signals=signals;
800
800
  var _realtime=realtime;
@@ -1007,7 +1007,7 @@ stdio.exports.node = options => {
1007
1007
  return [...stdio, 'ipc'];
1008
1008
  };
1009
1009
 
1010
- const os = require$$0;
1010
+ const os = require$$0$1;
1011
1011
  const onExit = signalExit.exports;
1012
1012
 
1013
1013
  const DEFAULT_FORCE_KILL_TIMEOUT = 1000 * 5;
@@ -1341,8 +1341,8 @@ var command = {
1341
1341
  parseCommand: parseCommand$1
1342
1342
  };
1343
1343
 
1344
- const path = path$2;
1345
- const childProcess = childProcess$1;
1344
+ const path = g;
1345
+ const childProcess = require$$0$2;
1346
1346
  const crossSpawn = crossSpawn$1.exports;
1347
1347
  const stripFinalNewline = stripFinalNewline$1;
1348
1348
  const npmRunPath = npmRunPath$1.exports;
@@ -1623,12 +1623,12 @@ async function detectPackageManager(cwd = process.cwd()) {
1623
1623
  const lockPath = await findUp(Object.keys(LOCKS), { cwd });
1624
1624
  let packageJsonPath;
1625
1625
  if (lockPath)
1626
- packageJsonPath = path$2.resolve(lockPath, "../package.json");
1626
+ packageJsonPath = g.resolve(lockPath, "../package.json");
1627
1627
  else
1628
1628
  packageJsonPath = await findUp("package.json", { cwd });
1629
- if (packageJsonPath && fs$2.existsSync(packageJsonPath)) {
1629
+ if (packageJsonPath && require$$0.existsSync(packageJsonPath)) {
1630
1630
  try {
1631
- const pkg = JSON.parse(fs$2.readFileSync(packageJsonPath, "utf8"));
1631
+ const pkg = JSON.parse(require$$0.readFileSync(packageJsonPath, "utf8"));
1632
1632
  if (typeof pkg.packageManager === "string") {
1633
1633
  const [name, version] = pkg.packageManager.split("@");
1634
1634
  if (name === "yarn" && parseInt(version) > 1)
@@ -1644,7 +1644,7 @@ async function detectPackageManager(cwd = process.cwd()) {
1644
1644
  }
1645
1645
  }
1646
1646
  if (!agent && lockPath)
1647
- agent = LOCKS[path$2.basename(lockPath)];
1647
+ agent = LOCKS[g.basename(lockPath)];
1648
1648
  return agent;
1649
1649
  }
1650
1650
  async function installPackage(names, options = {}) {
@@ -0,0 +1,27 @@
1
+ import { m as globalApis } from './chunk-utils-env.4afc6329.js';
2
+ import { i as index } from './chunk-utils-import.dc87c88c.js';
3
+ import 'tty';
4
+ import 'node:url';
5
+ import 'path';
6
+ import './chunk-runtime-chain.198631fd.js';
7
+ import 'util';
8
+ import 'chai';
9
+ import './chunk-typecheck-constants.e478eb98.js';
10
+ import 'node:path';
11
+ import 'local-pkg';
12
+ import './vendor-_commonjsHelpers.addc3445.js';
13
+ import './chunk-runtime-rpc.503623e9.js';
14
+ import './chunk-utils-timers.54caa12a.js';
15
+ import 'node:fs';
16
+ import './chunk-utils-source-map.95b8b3f0.js';
17
+ import 'fs';
18
+ import './spy.js';
19
+ import 'tinyspy';
20
+
21
+ function registerApiGlobally() {
22
+ globalApis.forEach((api) => {
23
+ globalThis[api] = index[api];
24
+ });
25
+ }
26
+
27
+ export { registerApiGlobally };
@@ -1,19 +1,23 @@
1
- import { b as resolve } from './chunk-utils-env.03f840f2.js';
2
- import { e as execa } from './vendor-index.737c3cff.js';
1
+ import { b as resolve } from './chunk-utils-env.4afc6329.js';
2
+ import { e as execa } from './vendor-index.a323f2d0.js';
3
3
  import 'tty';
4
- import 'url';
4
+ import 'node:url';
5
5
  import 'path';
6
- import 'buffer';
6
+ import 'node:buffer';
7
+ import 'node:path';
8
+ import 'node:child_process';
9
+ import 'node:process';
10
+ import './vendor-index.62932580.js';
7
11
  import 'child_process';
8
- import 'process';
9
- import './vendor-index.e1d4cf84.js';
10
12
  import './vendor-_commonjsHelpers.addc3445.js';
11
13
  import 'fs';
12
14
  import 'assert';
13
15
  import 'events';
16
+ import 'buffer';
14
17
  import 'stream';
15
18
  import 'util';
16
19
  import 'os';
20
+ import 'node:os';
17
21
 
18
22
  class VitestGit {
19
23
  constructor(cwd) {
@@ -1,13 +1,14 @@
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.3f865d14.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.e478eb98.js';
5
5
  import { c as commonjsGlobal } from './vendor-_commonjsHelpers.addc3445.js';
6
- import { r as rpc } from './chunk-runtime-rpc.7959fc79.js';
7
- import fs, { promises } from 'fs';
8
- import { j as join, d as dirname, p as picocolors } from './chunk-utils-env.03f840f2.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.793fd179.js';
10
- import { a as posToNumber, n as numberToPos, l as lineSplitRE, p as parseStacktrace } from './chunk-utils-source-map.5bbb50cd.js';
6
+ import { r as rpc } from './chunk-runtime-rpc.503623e9.js';
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';
11
+ import { promises } from 'fs';
11
12
  import { isMockFunction } from './spy.js';
12
13
 
13
14
  function createChainable(keys, fn) {
@@ -2191,7 +2192,7 @@ function createTestContext(test) {
2191
2192
  }
2192
2193
  function makeTimeoutMsg(isHook, timeout) {
2193
2194
  return `${isHook ? "Hook" : "Test"} timed out in ${timeout}ms.
2194
- If this is a long-running test, pass a timeout value as the last argument or configure it globally with "${isHook ? "hookTimeout" : "testTimeout"}".`;
2195
+ If this is a long-running ${isHook ? "hook" : "test"}, pass a timeout value as the last argument or configure it globally with "${isHook ? "hookTimeout" : "testTimeout"}".`;
2195
2196
  }
2196
2197
 
2197
2198
  const fnMap = /* @__PURE__ */ new WeakMap();
@@ -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.793fd179.js';
4
- import { x as deepClone, y as getType } from './chunk-typecheck-constants.3f865d14.js';
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';
5
5
 
6
6
  const IS_RECORD_SYMBOL = "@@__IMMUTABLE_RECORD__@@";
7
7
  const IS_COLLECTION_SYMBOL = "@@__IMMUTABLE_ITERABLE__@@";
@@ -79,10 +79,12 @@ function processError(err) {
79
79
  const { replacedActual, replacedExpected } = replaceAsymmetricMatcher(clonedActual, clonedExpected);
80
80
  err.actual = replacedActual;
81
81
  err.expected = replacedExpected;
82
+ const workerState = getWorkerState();
83
+ const maxDiffSize = workerState.config.outputDiffMaxSize;
82
84
  if (typeof err.expected !== "string")
83
- err.expected = stringify(err.expected);
85
+ err.expected = stringify(err.expected, 10, { maxLength: maxDiffSize });
84
86
  if (typeof err.actual !== "string")
85
- err.actual = stringify(err.actual);
87
+ err.actual = stringify(err.actual, 10, { maxLength: maxDiffSize });
86
88
  try {
87
89
  if (typeof err.message === "string")
88
90
  err.message = normalizeErrorMessage(err.message);
@@ -1,9 +1,10 @@
1
1
  import { ViteNodeRunner } from 'vite-node/client';
2
+ import { isInternalRequest } from 'vite-node/utils';
2
3
  import { normalizePath } from 'vite';
3
- import { g as getWorkerState, y as getType, K as getAllMockableProperties, e as getCurrentEnvironment } from './chunk-typecheck-constants.3f865d14.js';
4
- import { existsSync, readdirSync } from 'fs';
5
- import { i as isNodeBuiltin } from './vendor-index.96e022fd.js';
6
- 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.03f840f2.js';
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';
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
8
 
8
9
  class RefTracker {
9
10
  constructor() {
@@ -309,6 +310,12 @@ class VitestRunner extends ViteNodeRunner {
309
310
  this.options = options;
310
311
  this.mocker = new VitestMocker(this);
311
312
  }
313
+ shouldResolveId(id, _importee) {
314
+ if (isInternalRequest(id))
315
+ return false;
316
+ const environment = getCurrentEnvironment();
317
+ return environment === "node" ? !isNodeBuiltin(id) : true;
318
+ }
312
319
  async resolveUrl(id, importee) {
313
320
  if (importee && importee.startsWith("mock:"))
314
321
  importee = importee.slice(5);
@@ -1,5 +1,5 @@
1
- import { g as getWorkerState } from './chunk-typecheck-constants.3f865d14.js';
2
- import { s as safeSetTimeout } from './chunk-utils-timers.793fd179.js';
1
+ import { g as getWorkerState } from './chunk-typecheck-constants.e478eb98.js';
2
+ import { s as safeSetTimeout } from './chunk-utils-timers.54caa12a.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.ca62c9d7.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.3f865d14.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.e655f6cc.js';
6
- import { r as rpc } from './chunk-runtime-rpc.7959fc79.js';
7
- import { p as processError } from './chunk-runtime-error.dfbbf9be.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';
8
8
  import { installSourcemapsSupport } from 'vite-node/source-map';
9
- import { e as environments } from './chunk-env-node.67948209.js';
10
- import { i as isNode, a as isBrowser } from './chunk-utils-env.03f840f2.js';
11
- import { b as safeClearTimeout, s as safeSetTimeout } from './chunk-utils-timers.793fd179.js';
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';
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.cab94a09.js')).registerApiGlobally();
32
+ (await import('./chunk-integrations-globals.5af12e76.js')).registerApiGlobally();
33
33
  }
34
34
  function setupDefines(defines) {
35
35
  for (const key in defines)
@@ -40,8 +40,8 @@ async function setupConsoleLogSpy() {
40
40
  const stderrBuffer = /* @__PURE__ */ new Map();
41
41
  const timers = /* @__PURE__ */ new Map();
42
42
  const unknownTestId = "__vitest__unknown_test__";
43
- const { Writable } = await import('stream');
44
- const { Console } = await import('console');
43
+ const { Writable } = await import('node:stream');
44
+ const { Console } = await import('node:console');
45
45
  function schedule(taskId) {
46
46
  const timer = timers.get(taskId);
47
47
  const { stdoutTime, stderrTime } = timer;
@@ -200,7 +200,8 @@ async function collectTests(paths, config) {
200
200
  type: "suite",
201
201
  mode: "run",
202
202
  filepath,
203
- tasks: []
203
+ tasks: [],
204
+ projectName: config.name
204
205
  };
205
206
  clearCollectorContext();
206
207
  try {
@@ -329,7 +330,7 @@ const callCleanupHooks = async (cleanups) => {
329
330
  async function runTest(test) {
330
331
  var _a, _b, _c;
331
332
  if (test.mode !== "run") {
332
- const { getSnapshotClient } = await import('./chunk-runtime-chain.e655f6cc.js').then(function (n) { return n.r; });
333
+ const { getSnapshotClient } = await import('./chunk-runtime-chain.198631fd.js').then(function (n) { return n.r; });
333
334
  getSnapshotClient().skipTestSnapshots(test);
334
335
  return;
335
336
  }
@@ -346,7 +347,7 @@ async function runTest(test) {
346
347
  clearModuleMocks();
347
348
  setCurrentTest(test);
348
349
  if (isNode) {
349
- const { getSnapshotClient } = await import('./chunk-runtime-chain.e655f6cc.js').then(function (n) { return n.r; });
350
+ const { getSnapshotClient } = await import('./chunk-runtime-chain.198631fd.js').then(function (n) { return n.r; });
350
351
  await getSnapshotClient().setTest(test);
351
352
  }
352
353
  const workerState = getWorkerState();
@@ -409,7 +410,7 @@ async function runTest(test) {
409
410
  console.error(test.result.error.message, test.result.error.stackStr);
410
411
  setCurrentTest(void 0);
411
412
  if (isNode) {
412
- const { getSnapshotClient } = await import('./chunk-runtime-chain.e655f6cc.js').then(function (n) { return n.r; });
413
+ const { getSnapshotClient } = await import('./chunk-runtime-chain.198631fd.js').then(function (n) { return n.r; });
413
414
  getSnapshotClient().clearTest();
414
415
  }
415
416
  test.result.duration = now() - start;
@@ -615,7 +616,7 @@ async function startTestsBrowser(paths, config) {
615
616
  async function startTestsNode(paths, config) {
616
617
  const files = await collectTests(paths, config);
617
618
  rpc().onCollected(files);
618
- const { getSnapshotClient } = await import('./chunk-runtime-chain.e655f6cc.js').then(function (n) { return n.r; });
619
+ const { getSnapshotClient } = await import('./chunk-runtime-chain.198631fd.js').then(function (n) { return n.r; });
619
620
  getSnapshotClient().clear();
620
621
  await runFiles(files, config);
621
622
  const coverage = await takeCoverageInsideWorker(config.coverage);