vitest 2.1.3 → 2.1.4

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 (74) hide show
  1. package/LICENSE.md +1 -209
  2. package/dist/browser.d.ts +21 -21
  3. package/dist/browser.js +7 -7
  4. package/dist/chunks/{RandomSequencer.Bh5-tlNJ.js → RandomSequencer.CMRlh2v4.js} +143 -142
  5. package/dist/chunks/{base.BO5Jx7vw.js → base.C3xNdjV6.js} +3 -3
  6. package/dist/chunks/{benchmark.C8CRJYG4.js → benchmark.Cdu9hjj4.js} +2 -2
  7. package/dist/chunks/{benchmark.JVlTzojj.d.ts → benchmark.geERunq4.d.ts} +1 -1
  8. package/dist/chunks/{cac.BSMVokHR.js → cac.DrfPaMvZ.js} +11 -10
  9. package/dist/chunks/{cli-api.btGgw3PC.js → cli-api.CKrRYkw8.js} +732 -577
  10. package/dist/chunks/{console.CfT1Wjed.js → console.BYGVloWk.js} +2 -6
  11. package/dist/chunks/{coverage.zlNdAMHK.js → coverage.BoMDb1ip.js} +1 -1
  12. package/dist/chunks/{creator.CBPphXqR.js → creator.IIqd8RWT.js} +8 -8
  13. package/dist/chunks/{execute._eQQfgI8.js → execute.2pr0rHgK.js} +8 -6
  14. package/dist/chunks/{globals.Bdzt04Qm.js → globals.Bp645TTJ.js} +8 -13
  15. package/dist/chunks/{index.BpSiYbpB.js → index.68735LiX.js} +28 -5
  16. package/dist/chunks/{index.X0nbfr6-.js → index.BJDntFik.js} +7 -7
  17. package/dist/chunks/{index.Dz2opmmU.js → index.Bn81VaWg.js} +3808 -3787
  18. package/dist/chunks/{index.CPD77dLA.js → index.CqYx2Nsr.js} +7 -7
  19. package/dist/chunks/{index.4GFF2h22.js → index.D3d79vc8.js} +6 -6
  20. package/dist/chunks/index.Dqe5k2Rk.js +54 -0
  21. package/dist/chunks/{node.Bx4JZjMG.js → node.AKq966Jp.js} +1 -5
  22. package/dist/chunks/{reporters.C4ZHgdxQ.d.ts → reporters.anwo7Y6a.d.ts} +1328 -1313
  23. package/dist/chunks/{resolveConfig.Dha6ilPI.js → resolveConfig.DPmbhVlP.js} +3193 -3175
  24. package/dist/chunks/{rpc.B7Mfb-Yf.js → rpc.C3q9uwRX.js} +2 -2
  25. package/dist/chunks/{run-once.Sxe67Wng.js → run-once.2ogXb3JV.js} +1 -1
  26. package/dist/chunks/{runBaseTests.Cx4wXyTR.js → runBaseTests.Dm-659zB.js} +21 -25
  27. package/dist/chunks/{setup-common.BKyF15v_.js → setup-common.DDmVKp6O.js} +3 -3
  28. package/dist/chunks/{suite.BMWOKiTe.d.ts → suite.B2jumIFP.d.ts} +2 -2
  29. package/dist/chunks/{utils.CY6Spixo.js → utils.BB4zjzR8.js} +2 -2
  30. package/dist/chunks/utils.C8RiOc4B.js +77 -0
  31. package/dist/chunks/{vi.BskyZC5g.js → vi.JMQoNY_Z.js} +94 -141
  32. package/dist/chunks/{vite.YH7MrecS.d.ts → vite.BdBj-UWY.d.ts} +1 -1
  33. package/dist/chunks/{vm.DB_hLchi.js → vm.jpyrB0xy.js} +5 -8
  34. package/dist/chunks/{worker.B6RjTtbk.d.ts → worker.BAlI9hII.d.ts} +12 -3
  35. package/dist/chunks/{worker.CcJLfX8w.d.ts → worker.DHnGaO2M.d.ts} +1 -1
  36. package/dist/cli.js +3 -4
  37. package/dist/config.cjs +4 -4
  38. package/dist/config.d.ts +10 -10
  39. package/dist/config.js +4 -4
  40. package/dist/coverage.d.ts +9 -9
  41. package/dist/coverage.js +8 -11
  42. package/dist/environments.d.ts +2 -2
  43. package/dist/environments.js +1 -1
  44. package/dist/execute.d.ts +53 -53
  45. package/dist/execute.js +7 -6
  46. package/dist/index.d.ts +75 -1099
  47. package/dist/index.js +7 -18
  48. package/dist/node.d.ts +43 -41
  49. package/dist/node.js +22 -28
  50. package/dist/path.js +1 -1
  51. package/dist/reporters.d.ts +10 -10
  52. package/dist/reporters.js +12 -18
  53. package/dist/runners.d.ts +12 -19
  54. package/dist/runners.js +142 -148
  55. package/dist/snapshot.js +2 -6
  56. package/dist/suite.d.ts +2 -2
  57. package/dist/suite.js +2 -6
  58. package/dist/worker.js +5 -6
  59. package/dist/workers/forks.js +9 -8
  60. package/dist/workers/runVmTests.js +16 -20
  61. package/dist/workers/threads.js +9 -8
  62. package/dist/workers/vmForks.js +9 -12
  63. package/dist/workers/vmThreads.js +9 -12
  64. package/dist/workers.d.ts +13 -13
  65. package/dist/workers.js +14 -18
  66. package/package.json +26 -26
  67. package/dist/chunks/base.DwXGwWst.js +0 -89
  68. package/dist/chunks/env.CmHVDJnw.js +0 -7
  69. package/dist/chunks/index.-d_XpZEA.js +0 -140
  70. package/dist/chunks/index.CxRxs566.js +0 -23
  71. package/dist/chunks/tasks.BZnCS9aT.js +0 -18
  72. package/dist/chunks/utils.Ck2hJTRs.js +0 -23
  73. package/dist/chunks/{environment.CzISCQ7o.d.ts → environment.LoooBwUu.d.ts} +24 -24
  74. package/dist/chunks/{index.lVXYBqEP.js → index.BMoXz_-n.js} +186 -186
@@ -1,7 +1,7 @@
1
1
  import process$1 from 'process';
2
2
  import fs from 'node:fs';
3
3
  import fsp from 'node:fs/promises';
4
- import path from 'node:path';
4
+ import a from 'node:path';
5
5
  import process from 'node:process';
6
6
  import { existsSync } from 'fs';
7
7
  import { resolve } from 'path';
@@ -26,27 +26,27 @@ const LOCKS = {
26
26
  async function detect({ cwd, onUnknown } = {}) {
27
27
  for (const directory of lookup(cwd)) {
28
28
  for (const lock of Object.keys(LOCKS)) {
29
- if (await fileExists(path.join(directory, lock))) {
29
+ if (await fileExists(a.join(directory, lock))) {
30
30
  const name = LOCKS[lock];
31
- const result2 = await parsePackageJson(path.join(directory, "package.json"), onUnknown);
31
+ const result2 = await parsePackageJson(a.join(directory, "package.json"), onUnknown);
32
32
  if (result2)
33
33
  return result2;
34
34
  else
35
35
  return { name, agent: name };
36
36
  }
37
37
  }
38
- const result = await parsePackageJson(path.join(directory, "package.json"), onUnknown);
38
+ const result = await parsePackageJson(a.join(directory, "package.json"), onUnknown);
39
39
  if (result)
40
40
  return result;
41
41
  }
42
42
  return null;
43
43
  }
44
44
  function* lookup(cwd = process.cwd()) {
45
- let directory = path.resolve(cwd);
46
- const { root } = path.parse(directory);
45
+ let directory = a.resolve(cwd);
46
+ const { root } = a.parse(directory);
47
47
  while (directory && directory !== root) {
48
48
  yield directory;
49
- directory = path.dirname(directory);
49
+ directory = a.dirname(directory);
50
50
  }
51
51
  }
52
52
  async function parsePackageJson(filepath, onUnknown) {
@@ -1,10 +1,10 @@
1
1
  import * as chai from 'chai';
2
- import { resolve } from 'pathe';
2
+ import { resolve } from 'node:path';
3
+ import { t as takeCoverageInsideWorker } from './coverage.BoMDb1ip.js';
3
4
  import { distDir } from '../path.js';
4
- import { g as getWorkerState } from './utils.Ck2hJTRs.js';
5
- import { r as rpc } from './rpc.B7Mfb-Yf.js';
6
- import { t as takeCoverageInsideWorker } from './coverage.zlNdAMHK.js';
7
- import { l as loadDiffConfig, a as loadSnapshotSerializers } from './setup-common.BKyF15v_.js';
5
+ import { r as rpc } from './rpc.C3q9uwRX.js';
6
+ import { l as loadDiffConfig, a as loadSnapshotSerializers } from './setup-common.DDmVKp6O.js';
7
+ import { g as getWorkerState } from './utils.C8RiOc4B.js';
8
8
 
9
9
  function setupChaiConfig(config) {
10
10
  Object.assign(chai.config, config);
@@ -12,7 +12,7 @@ function setupChaiConfig(config) {
12
12
 
13
13
  async function resolveSnapshotEnvironment(config, executor) {
14
14
  if (!config.snapshotEnvironment) {
15
- const { VitestNodeSnapshotEnvironment } = await import('./node.Bx4JZjMG.js');
15
+ const { VitestNodeSnapshotEnvironment } = await import('./node.AKq966Jp.js');
16
16
  return new VitestNodeSnapshotEnvironment();
17
17
  }
18
18
  const mod = await executor.executeId(config.snapshotEnvironment);
@@ -0,0 +1,54 @@
1
+ import { c as createExpect, a as globalExpect, v as vi, b as vitest } from './vi.JMQoNY_Z.js';
2
+ import { g as getWorkerState } from './utils.C8RiOc4B.js';
3
+ import { i as isFirstRun, a as runOnce } from './run-once.2ogXb3JV.js';
4
+ import { b as bench } from './benchmark.Cdu9hjj4.js';
5
+ import { expectTypeOf } from 'expect-type';
6
+ import { afterAll, afterEach, beforeAll, beforeEach, describe, it, onTestFailed, onTestFinished, suite, test } from '@vitest/runner';
7
+ import * as chai from 'chai';
8
+ import { assert, should } from 'chai';
9
+
10
+ function inject(key) {
11
+ const workerState = getWorkerState();
12
+ return workerState.providedContext[key];
13
+ }
14
+
15
+ function getRunningMode() {
16
+ return process.env.VITEST_MODE === "WATCH" ? "watch" : "run";
17
+ }
18
+ function isWatchMode() {
19
+ return getRunningMode() === "watch";
20
+ }
21
+
22
+ const assertType = function assertType2() {
23
+ };
24
+
25
+ var VitestIndex = /*#__PURE__*/Object.freeze({
26
+ __proto__: null,
27
+ afterAll: afterAll,
28
+ afterEach: afterEach,
29
+ assert: assert,
30
+ assertType: assertType,
31
+ beforeAll: beforeAll,
32
+ beforeEach: beforeEach,
33
+ bench: bench,
34
+ chai: chai,
35
+ createExpect: createExpect,
36
+ describe: describe,
37
+ expect: globalExpect,
38
+ expectTypeOf: expectTypeOf,
39
+ getRunningMode: getRunningMode,
40
+ inject: inject,
41
+ isFirstRun: isFirstRun,
42
+ isWatchMode: isWatchMode,
43
+ it: it,
44
+ onTestFailed: onTestFailed,
45
+ onTestFinished: onTestFinished,
46
+ runOnce: runOnce,
47
+ should: should,
48
+ suite: suite,
49
+ test: test,
50
+ vi: vi,
51
+ vitest: vitest
52
+ });
53
+
54
+ export { VitestIndex as V, isWatchMode as a, assertType as b, getRunningMode as g, inject as i };
@@ -1,10 +1,6 @@
1
1
  import { NodeSnapshotEnvironment } from '@vitest/snapshot/environment';
2
- import 'pathe';
3
- import '@vitest/runner/utils';
2
+ import { g as getWorkerState } from './utils.C8RiOc4B.js';
4
3
  import '@vitest/utils';
5
- import { g as getWorkerState } from './utils.Ck2hJTRs.js';
6
- import './env.CmHVDJnw.js';
7
- import 'std-env';
8
4
 
9
5
  class VitestNodeSnapshotEnvironment extends NodeSnapshotEnvironment {
10
6
  getHeader() {