vitest 2.2.0-beta.2 → 3.0.0-beta.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 (54) hide show
  1. package/LICENSE.md +75 -0
  2. package/dist/browser.d.ts +13 -10
  3. package/dist/browser.js +2 -2
  4. package/dist/chunks/{RandomSequencer.BPedXEug.js → RandomSequencer.gisBJ77r.js} +11 -4
  5. package/dist/chunks/{base.BS0HhLXd.js → base.CUgXReRN.js} +8 -3
  6. package/dist/chunks/{cac.Cs06pOqp.js → cac.Xzv7eNWw.js} +22 -17
  7. package/dist/chunks/{cli-api.CB-jIbYQ.js → cli-api.CETCDGgZ.js} +985 -498
  8. package/dist/chunks/{config.CPguQ7J1.d.ts → config.BTPBhmK5.d.ts} +1 -1
  9. package/dist/chunks/{coverage.BoMDb1ip.js → coverage.BWeNbfBa.js} +4 -4
  10. package/dist/chunks/{creator.IIqd8RWT.js → creator.DcAcUhMD.js} +1 -4
  11. package/dist/chunks/{environment.CT0jpO-1.d.ts → environment.d8YfPkTm.d.ts} +1 -3
  12. package/dist/chunks/{globals.BCGEw6ON.js → globals.BFncSRNA.js} +2 -2
  13. package/dist/chunks/{index.bzFpKeaq.js → index.9ZEBV_TJ.js} +992 -577
  14. package/dist/chunks/{index.DD5eTY2y.js → index.CkWmZCXU.js} +1 -1
  15. package/dist/chunks/{index.CqYx2Nsr.js → index.DQboAxJm.js} +23 -14
  16. package/dist/chunks/{index.BjjsHdBb.js → index.DoV7W5gc.js} +2 -2
  17. package/dist/chunks/{inspector.70d6emsh.js → inspector.DKLceBVD.js} +1 -1
  18. package/dist/chunks/{reporters.F9D2idOT.d.ts → reporters.DTtxC3KQ.d.ts} +588 -524
  19. package/dist/chunks/{resolveConfig.CLnvCvEs.js → resolveConfig.BA-_OKEx.js} +5599 -5570
  20. package/dist/chunks/{runBaseTests.B7hcVT-s.js → runBaseTests.D0dWpzZV.js} +13 -12
  21. package/dist/chunks/{setup-common.BfGt8K-K.js → setup-common.Cp_bu5q3.js} +1 -1
  22. package/dist/chunks/types.BOjykUpq.d.ts +27 -0
  23. package/dist/chunks/{utils.DJONn5B5.js → utils.CMUTX-p8.js} +5 -2
  24. package/dist/chunks/{vi.BlPttogV.js → vi.S4Fq8wSo.js} +20 -14
  25. package/dist/chunks/{vite.DonA4fvH.d.ts → vite.CXaetSK3.d.ts} +1 -1
  26. package/dist/chunks/{vm.Zr4qWzDJ.js → vm.DGhTouO3.js} +10 -1
  27. package/dist/chunks/{worker.Qz1UB4Fv.d.ts → worker.ClntunZp.d.ts} +1 -1
  28. package/dist/chunks/{worker.9VY11NZs.d.ts → worker.o1PBoDdo.d.ts} +4 -4
  29. package/dist/cli.js +1 -1
  30. package/dist/config.cjs +1 -10
  31. package/dist/config.d.ts +7 -10
  32. package/dist/config.js +1 -10
  33. package/dist/coverage.d.ts +5 -7
  34. package/dist/coverage.js +4 -4
  35. package/dist/environments.d.ts +2 -2
  36. package/dist/execute.d.ts +4 -4
  37. package/dist/index.d.ts +27 -22
  38. package/dist/index.js +2 -2
  39. package/dist/node.d.ts +25 -33
  40. package/dist/node.js +66 -32
  41. package/dist/reporters.d.ts +5 -7
  42. package/dist/reporters.js +5 -4
  43. package/dist/runners.d.ts +3 -4
  44. package/dist/runners.js +9 -14
  45. package/dist/suite.d.ts +1 -1
  46. package/dist/worker.js +1 -1
  47. package/dist/workers/forks.js +1 -1
  48. package/dist/workers/runVmTests.js +9 -9
  49. package/dist/workers/threads.js +1 -1
  50. package/dist/workers/vmForks.js +1 -1
  51. package/dist/workers/vmThreads.js +1 -1
  52. package/dist/workers.d.ts +4 -4
  53. package/dist/workers.js +3 -3
  54. package/package.json +23 -24
@@ -33,7 +33,7 @@ interface FakeTimerInstallOpts {
33
33
  /**
34
34
  * An array with names of global methods and APIs to fake.
35
35
  * For instance, `vi.useFakeTimer({ toFake: ['setTimeout', 'performance'] })` will fake only `setTimeout()` and `performance.now()`
36
- * @default ['setTimeout', 'clearTimeout', 'setImmediate', 'clearImmediate', 'setInterval', 'clearInterval', 'Date']
36
+ * @default everything available globally except `nextTick`
37
37
  */
38
38
  toFake?: FakeMethod[] | undefined;
39
39
 
@@ -43,10 +43,10 @@ async function getCoverageProvider(options, loader) {
43
43
  }
44
44
  return null;
45
45
  }
46
- async function startCoverageInsideWorker(options, loader) {
46
+ async function startCoverageInsideWorker(options, loader, runtimeOptions) {
47
47
  const coverageModule = await resolveCoverageProviderModule(options, loader);
48
48
  if (coverageModule) {
49
- return coverageModule.startCoverage?.();
49
+ return coverageModule.startCoverage?.(runtimeOptions);
50
50
  }
51
51
  return null;
52
52
  }
@@ -57,10 +57,10 @@ async function takeCoverageInsideWorker(options, loader) {
57
57
  }
58
58
  return null;
59
59
  }
60
- async function stopCoverageInsideWorker(options, loader) {
60
+ async function stopCoverageInsideWorker(options, loader, runtimeOptions) {
61
61
  const coverageModule = await resolveCoverageProviderModule(options, loader);
62
62
  if (coverageModule) {
63
- return coverageModule.stopCoverage?.();
63
+ return coverageModule.stopCoverage?.(runtimeOptions);
64
64
  }
65
65
  return null;
66
66
  }
@@ -1,15 +1,12 @@
1
1
  import { existsSync, writeFileSync, readFileSync } from 'node:fs';
2
2
  import { mkdir, writeFile } from 'node:fs/promises';
3
3
  import { resolve, dirname, relative } from 'node:path';
4
- import { detectPackageManager, installPackage } from './index.CqYx2Nsr.js';
4
+ import { detectPackageManager, installPackage } from './index.DQboAxJm.js';
5
5
  import { p as prompt, f as findUp } from './index.BJDntFik.js';
6
6
  import { x } from 'tinyexec';
7
7
  import c from 'tinyrainbow';
8
8
  import { c as configFiles } from './constants.fzPh7AOq.js';
9
- import 'process';
10
9
  import 'node:process';
11
- import 'fs';
12
- import 'path';
13
10
  import 'node:url';
14
11
  import './_commonjsHelpers.BFTU3MAI.js';
15
12
  import 'readline';
@@ -35,8 +35,6 @@ interface ModuleGraphData {
35
35
  externalized: string[];
36
36
  inlined: string[];
37
37
  }
38
- type OnServerRestartHandler = (reason?: string) => Promise<void> | void;
39
- type OnTestsRerunHandler = (testFiles: string[]) => Promise<void> | void;
40
38
  interface ProvidedContext {
41
39
  }
42
40
 
@@ -172,4 +170,4 @@ interface ResolvedTestEnvironment {
172
170
  options: Record<string, any> | null;
173
171
  }
174
172
 
175
- export type { AfterSuiteRunMeta as A, Constructable as C, Environment as E, HappyDOMOptions as H, JSDOMOptions as J, ModuleGraphData as M, Nullable as N, OnServerRestartHandler as O, ProvidedContext as P, ResolvedTestEnvironment as R, TransformMode as T, UserConsoleLog as U, VmEnvironmentReturn as V, EnvironmentReturn as a, Awaitable as b, Arrayable as c, ArgumentsType as d, MutableArray as e, EnvironmentOptions as f, ModuleCache as g, OnTestsRerunHandler as h };
173
+ export type { AfterSuiteRunMeta as A, Constructable as C, Environment as E, HappyDOMOptions as H, JSDOMOptions as J, ModuleGraphData as M, Nullable as N, ProvidedContext as P, ResolvedTestEnvironment as R, TransformMode as T, UserConsoleLog as U, VmEnvironmentReturn as V, EnvironmentReturn as a, Awaitable as b, Arrayable as c, ArgumentsType as d, MutableArray as e, EnvironmentOptions as f, ModuleCache as g };
@@ -1,6 +1,6 @@
1
1
  import { g as globalApis } from './constants.fzPh7AOq.js';
2
- import { V as VitestIndex } from './index.DD5eTY2y.js';
3
- import './vi.BlPttogV.js';
2
+ import { V as VitestIndex } from './index.CkWmZCXU.js';
3
+ import './vi.S4Fq8wSo.js';
4
4
  import '@vitest/expect';
5
5
  import '@vitest/runner';
6
6
  import '@vitest/runner/utils';