vitest 4.0.0-beta.18 → 4.0.0-beta.19

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (52) hide show
  1. package/dist/browser.d.ts +3 -3
  2. package/dist/browser.js +1 -1
  3. package/dist/{worker-base.js → chunks/base.CtHM3ryk.js} +18 -91
  4. package/dist/chunks/{browser.d.CCG7W26I.d.ts → browser.d.B9iJzZyn.d.ts} +3 -2
  5. package/dist/chunks/{cac.DYnuYoJK.js → cac.DCrQhweU.js} +14 -61
  6. package/dist/chunks/{cli-api.xhe4uqTX.js → cli-api.BjHteKX0.js} +1312 -53
  7. package/dist/chunks/{config.d.C4PpNy7v.d.ts → config.d.u2CUDWwS.d.ts} +2 -16
  8. package/dist/chunks/{coverage.Ds84cgzV.js → coverage.FU3w4IrQ.js} +25 -1241
  9. package/dist/chunks/{defaults.CXFFjsi8.js → defaults.BOqNVLsY.js} +0 -1
  10. package/dist/chunks/evaluatedModules.Dg1zASAC.js +17 -0
  11. package/dist/chunks/{global.d.RTA0rbJI.d.ts → global.d.BgJSTpgQ.d.ts} +1 -1
  12. package/dist/chunks/{globals.CwYe1aG7.js → globals.BGT_RUsD.js} +4 -2
  13. package/dist/chunks/{index.eEkl9h8v.js → index.BdSLhLDZ.js} +1 -1
  14. package/dist/chunks/{index.D2gVI9Ck.js → index.CcRZ6fUh.js} +1506 -11
  15. package/dist/chunks/{index.Bcjk8TKX.js → index.RwjEGCQ0.js} +2 -2
  16. package/dist/chunks/init-forks.DSafeltJ.js +54 -0
  17. package/dist/chunks/init-threads.SUtZ-067.js +17 -0
  18. package/dist/chunks/{worker.CdzokOSx.js → init.B2EESLQM.js} +97 -80
  19. package/dist/chunks/{inspector.Br76Q2Mb.js → inspector.DLZxSeU3.js} +1 -2
  20. package/dist/chunks/{moduleRunner.d.aXWuQhZN.d.ts → moduleRunner.d.YtNsMIoJ.d.ts} +1 -1
  21. package/dist/chunks/{plugin.d.XtKKWlOO.d.ts → plugin.d.BB__S31E.d.ts} +1 -1
  22. package/dist/chunks/{reporters.d.BJ_OuJGZ.d.ts → reporters.d.C6nGyY9_.d.ts} +1113 -1152
  23. package/dist/chunks/{resolveSnapshotEnvironment.tw2a5ux8.js → resolveSnapshotEnvironment.DJJKMKxb.js} +1 -1
  24. package/dist/chunks/{setup-common.DgXU7Yho.js → setup-common.DR1sucx6.js} +1 -1
  25. package/dist/chunks/{startModuleRunner.DPBo3mme.js → startModuleRunner.C2tTvmF9.js} +3 -1
  26. package/dist/{worker-vm.js → chunks/vm.DBeOXrP9.js} +6 -66
  27. package/dist/chunks/{worker.d.DSgBAZPX.d.ts → worker.d.BFk-vvBU.d.ts} +79 -4
  28. package/dist/cli.js +8 -9
  29. package/dist/config.cjs +0 -1
  30. package/dist/config.d.ts +6 -7
  31. package/dist/config.js +1 -1
  32. package/dist/coverage.d.ts +4 -4
  33. package/dist/coverage.js +2 -13
  34. package/dist/index.d.ts +13 -9
  35. package/dist/index.js +4 -2
  36. package/dist/module-evaluator.d.ts +3 -3
  37. package/dist/module-runner.js +1 -1
  38. package/dist/node.d.ts +79 -15
  39. package/dist/node.js +25 -26
  40. package/dist/reporters.d.ts +4 -4
  41. package/dist/reporters.js +9 -10
  42. package/dist/runners.d.ts +1 -1
  43. package/dist/worker.d.ts +26 -0
  44. package/dist/worker.js +46 -0
  45. package/dist/workers/forks.js +50 -0
  46. package/dist/workers/runVmTests.js +6 -5
  47. package/dist/workers/threads.js +50 -0
  48. package/dist/workers/vmForks.js +35 -0
  49. package/dist/workers/vmThreads.js +35 -0
  50. package/package.json +16 -13
  51. package/worker.d.ts +1 -0
  52. package/dist/chunks/typechecker.DsKAhua5.js +0 -1522
@@ -40,7 +40,6 @@ const configDefaults = Object.freeze({
40
40
  watch: !isCI && process.stdin.isTTY,
41
41
  globals: false,
42
42
  environment: "node",
43
- pool: "forks",
44
43
  clearMocks: false,
45
44
  restoreMocks: false,
46
45
  mockReset: false,
@@ -0,0 +1,17 @@
1
+ import { dirname, resolve } from 'pathe';
2
+ import { EvaluatedModules } from 'vite/module-runner';
3
+
4
+ // TODO: this is not needed in Vite 7.2+
5
+ class VitestEvaluatedModules extends EvaluatedModules {
6
+ getModuleSourceMapById(id) {
7
+ const map = super.getModuleSourceMapById(id);
8
+ if (map != null && !("_patched" in map)) {
9
+ map._patched = true;
10
+ const dir = dirname(map.url);
11
+ map.resolvedSources = (map.map.sources || []).map((s) => resolve(dir, s || ""));
12
+ }
13
+ return map;
14
+ }
15
+ }
16
+
17
+ export { VitestEvaluatedModules as V };
@@ -2,7 +2,7 @@ import { PromisifyAssertion, Tester, ExpectStatic } from '@vitest/expect';
2
2
  import { Plugin } from '@vitest/pretty-format';
3
3
  import { SnapshotState } from '@vitest/snapshot';
4
4
  import { B as BenchmarkResult } from './benchmark.d.DAaHLpsq.js';
5
- import { U as UserConsoleLog } from './worker.d.DSgBAZPX.js';
5
+ import { U as UserConsoleLog } from './worker.d.BFk-vvBU.js';
6
6
 
7
7
  interface SnapshotMatcher<T> {
8
8
  <U extends { [P in keyof T] : any }>(snapshot: Partial<U>, hint?: string): void;
@@ -1,5 +1,5 @@
1
1
  import { g as globalApis } from './constants.D_Q9UYh-.js';
2
- import { i as index } from './index.Bcjk8TKX.js';
2
+ import { i as index } from './index.RwjEGCQ0.js';
3
3
  import './vi.BZvkKVkM.js';
4
4
  import '@vitest/expect';
5
5
  import '@vitest/runner';
@@ -15,8 +15,10 @@ import '@vitest/utils/source-map';
15
15
  import './_commonjsHelpers.BFTU3MAI.js';
16
16
  import './date.-jtEtIeV.js';
17
17
  import './benchmark.DHKMYAts.js';
18
- import 'expect-type';
18
+ import './evaluatedModules.Dg1zASAC.js';
19
+ import 'pathe';
19
20
  import 'vite/module-runner';
21
+ import 'expect-type';
20
22
 
21
23
  function registerApiGlobally() {
22
24
  globalApis.forEach((api) => {
@@ -2,7 +2,7 @@ import fs from 'node:fs';
2
2
  import { getTasks, getFullName, getTests } from '@vitest/runner/utils';
3
3
  import * as pathe from 'pathe';
4
4
  import c from 'tinyrainbow';
5
- import { g as getStateSymbol, t as truncateString, F as F_RIGHT, D as DefaultReporter, f as formatProjectName, s as separator } from './index.D2gVI9Ck.js';
5
+ import { g as getStateSymbol, t as truncateString, F as F_RIGHT, D as DefaultReporter, f as formatProjectName, s as separator } from './index.CcRZ6fUh.js';
6
6
  import { stripVTControlCharacters } from 'node:util';
7
7
  import { notNullish } from '@vitest/utils/helpers';
8
8