vitest 2.0.0-beta.10 → 2.0.0-beta.11

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 (64) hide show
  1. package/dist/browser.d.ts +1 -1
  2. package/dist/browser.js +3 -3
  3. package/dist/chunks/{integrations-globals.C6Ah-pUW.js → integrations-globals.CC2ed6Py.js} +9 -9
  4. package/dist/chunks/{node-git.CCI8evVZ.js → node-git.ZtkbKc8u.js} +14 -15
  5. package/dist/chunks/{runtime-console.DiVMr5d4.js → runtime-console.Ckl0vEQr.js} +25 -10
  6. package/dist/chunks/{runtime-runBaseTests.Cukyr5-I.js → runtime-runBaseTests.BXW_BJeO.js} +40 -32
  7. package/dist/cli.js +3 -3
  8. package/dist/config.cjs +42 -19
  9. package/dist/config.d.ts +1 -1
  10. package/dist/config.js +42 -20
  11. package/dist/coverage.d.ts +4 -4
  12. package/dist/coverage.js +98 -36
  13. package/dist/environments.d.ts +1 -1
  14. package/dist/environments.js +1 -1
  15. package/dist/execute.d.ts +1 -1
  16. package/dist/execute.js +2 -2
  17. package/dist/index.d.ts +34 -8
  18. package/dist/index.js +9 -9
  19. package/dist/node.d.ts +19 -6
  20. package/dist/node.js +24 -16
  21. package/dist/path.js +4 -1
  22. package/dist/{reporters-CYVC6LOl.d.ts → reporters-fiIq_dT9.d.ts} +118 -179
  23. package/dist/reporters.d.ts +1 -1
  24. package/dist/reporters.js +7 -7
  25. package/dist/runners.d.ts +1 -1
  26. package/dist/runners.js +98 -60
  27. package/dist/{suite-Dpu9EC_k.d.ts → suite-D4aoU9rI.d.ts} +1 -1
  28. package/dist/suite.d.ts +2 -2
  29. package/dist/suite.js +2 -2
  30. package/dist/utils.d.ts +1 -5
  31. package/dist/utils.js +1 -6
  32. package/dist/vendor/{base.Dln9yllP.js → base.C2DbLEfT.js} +4 -3
  33. package/dist/vendor/{base._gnK9Slw.js → base.CTYV4Gnz.js} +24 -17
  34. package/dist/vendor/{benchmark.BNLebNi5.js → benchmark.CMp8QfyL.js} +13 -14
  35. package/dist/vendor/{cac.CtYFkoSJ.js → cac.BcJW7n2j.js} +71 -37
  36. package/dist/vendor/{cli-api.CUtJc4r3.js → cli-api.C8t8m4__.js} +4012 -4828
  37. package/dist/vendor/{constants.TCjCaw2D.js → constants.BWsVtsAj.js} +5 -22
  38. package/dist/vendor/{coverage.ChSqD-qS.js → coverage.BhYSDdTT.js} +27 -11
  39. package/dist/vendor/{date.BKM1wewY.js → date.W2xKR2qe.js} +5 -3
  40. package/dist/vendor/{execute.BHj6OMh4.js → execute.T3gg2ZK6.js} +174 -60
  41. package/dist/vendor/{index.B5SKBLvV.js → index.-dbR4KUi.js} +17 -9
  42. package/dist/vendor/{index.BOMEjpjj.js → index.BC5zhX9y.js} +960 -469
  43. package/dist/vendor/{index.CThipSqB.js → index.BMmMjLIQ.js} +2540 -2540
  44. package/dist/vendor/{index._7XLd8Kd.js → index.C9Thslzw.js} +2 -1
  45. package/dist/vendor/{index.D3hs2WiI.js → index.CQJ2m700.js} +3 -3
  46. package/dist/vendor/{index.kpsSqFiz.js → index.D4nqnQWz.js} +69 -73
  47. package/dist/vendor/{rpc.DRDE9Pu1.js → rpc.BGx7q_k2.js} +30 -19
  48. package/dist/vendor/{run-once.DLomgGUH.js → run-once.Db8Hgq9X.js} +2 -1
  49. package/dist/vendor/{setup-common.DAu7t7mY.js → setup-common.uqZOEWuR.js} +30 -15
  50. package/dist/vendor/{tasks.WC7M-K-v.js → tasks.DhVtQBtW.js} +3 -1
  51. package/dist/vendor/{utils.YuQ3LT2a.js → utils.DSO2UK15.js} +40 -25
  52. package/dist/vendor/{utils.CUjzkRH7.js → utils.DkxLWvS1.js} +12 -5
  53. package/dist/vendor/{vi.hATFzZbX.js → vi.BPjl8cAZ.js} +266 -137
  54. package/dist/vendor/{vm.Ow-X2mkS.js → vm.CycSoHnJ.js} +151 -86
  55. package/dist/worker.js +31 -15
  56. package/dist/workers/forks.js +4 -4
  57. package/dist/workers/runVmTests.js +14 -13
  58. package/dist/workers/threads.js +4 -4
  59. package/dist/workers/vmForks.js +6 -6
  60. package/dist/workers/vmThreads.js +6 -6
  61. package/dist/workers.d.ts +2 -2
  62. package/dist/workers.js +9 -9
  63. package/package.json +11 -11
  64. package/suppress-warnings.cjs +1 -4
@@ -2,9 +2,9 @@ import * as chai from 'chai';
2
2
  import { resolve } from 'pathe';
3
3
  import { distDir } from '../path.js';
4
4
  import { g as getWorkerState } from './global.7bFbnyXl.js';
5
- import { r as rpc } from './rpc.DRDE9Pu1.js';
6
- import { t as takeCoverageInsideWorker } from './coverage.ChSqD-qS.js';
7
- import { l as loadDiffConfig, a as loadSnapshotSerializers } from './setup-common.DAu7t7mY.js';
5
+ import { r as rpc } from './rpc.BGx7q_k2.js';
6
+ import { t as takeCoverageInsideWorker } from './coverage.BhYSDdTT.js';
7
+ import { l as loadDiffConfig, a as loadSnapshotSerializers } from './setup-common.uqZOEWuR.js';
8
8
 
9
9
  function setupChaiConfig(config) {
10
10
  Object.assign(chai.config, config);
@@ -16,8 +16,11 @@ async function resolveSnapshotEnvironment(config, executor) {
16
16
  return new VitestNodeSnapshotEnvironment();
17
17
  }
18
18
  const mod = await executor.executeId(config.snapshotEnvironment);
19
- if (typeof mod.default !== "object" || !mod.default)
20
- throw new Error("Snapshot environment module must have a default export object with a shape of `SnapshotEnvironment`");
19
+ if (typeof mod.default !== "object" || !mod.default) {
20
+ throw new Error(
21
+ "Snapshot environment module must have a default export object with a shape of `SnapshotEnvironment`"
22
+ );
23
+ }
21
24
  return mod.default;
22
25
  }
23
26
 
@@ -28,8 +31,11 @@ async function getTestRunnerConstructor(config, executor) {
28
31
  return config.mode === "test" ? VitestTestRunner : NodeBenchmarkRunner;
29
32
  }
30
33
  const mod = await executor.executeId(config.runner);
31
- if (!mod.default && typeof mod.default !== "function")
32
- throw new Error(`Runner must export a default function, but got ${typeof mod.default} imported from ${config.runner}`);
34
+ if (!mod.default && typeof mod.default !== "function") {
35
+ throw new Error(
36
+ `Runner must export a default function, but got ${typeof mod.default} imported from ${config.runner}`
37
+ );
38
+ }
33
39
  return mod.default;
34
40
  }
35
41
  async function resolveTestRunner(config, executor) {
@@ -40,10 +46,12 @@ async function resolveTestRunner(config, executor) {
40
46
  enumerable: false,
41
47
  configurable: false
42
48
  });
43
- if (!testRunner.config)
49
+ if (!testRunner.config) {
44
50
  testRunner.config = config;
45
- if (!testRunner.importFile)
51
+ }
52
+ if (!testRunner.importFile) {
46
53
  throw new Error('Runner must implement "importFile" method.');
54
+ }
47
55
  const [diffOptions] = await Promise.all([
48
56
  loadDiffConfig(config, executor),
49
57
  loadSnapshotSerializers(config, executor)