vitest 3.2.4 → 4.0.0-beta.10

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 (88) hide show
  1. package/LICENSE.md +2 -2
  2. package/dist/browser.d.ts +13 -16
  3. package/dist/browser.js +6 -5
  4. package/dist/chunks/base.Cjha6usc.js +129 -0
  5. package/dist/chunks/{benchmark.CYdenmiT.js → benchmark.CJUa-Hsa.js} +6 -8
  6. package/dist/chunks/{benchmark.d.BwvBVTda.d.ts → benchmark.d.DAaHLpsq.d.ts} +4 -4
  7. package/dist/chunks/browser.d.yFAklsD1.d.ts +18 -0
  8. package/dist/chunks/{cac.Cb-PYCCB.js → cac.DCxo_nSu.js} +72 -163
  9. package/dist/chunks/{cli-api.BkDphVBG.js → cli-api.BJJXh9BV.js} +1331 -1678
  10. package/dist/chunks/{config.d.D2ROskhv.d.ts → config.d.B_LthbQq.d.ts} +59 -65
  11. package/dist/chunks/{console.CtFJOzRO.js → console.7h5kHUIf.js} +34 -70
  12. package/dist/chunks/{constants.DnKduX2e.js → constants.D_Q9UYh-.js} +1 -9
  13. package/dist/chunks/{coverage.DL5VHqXY.js → coverage.BCU-r2QL.js} +538 -765
  14. package/dist/chunks/{coverage.DVF1vEu8.js → coverage.D_JHT54q.js} +2 -2
  15. package/dist/chunks/{coverage.d.S9RMNXIe.d.ts → coverage.d.BZtK59WP.d.ts} +10 -8
  16. package/dist/chunks/{creator.GK6I-cL4.js → creator.08Gi-vCA.js} +93 -77
  17. package/dist/chunks/{date.Bq6ZW5rf.js → date.-jtEtIeV.js} +6 -17
  18. package/dist/chunks/{defaults.B7q_naMc.js → defaults.CXFFjsi8.js} +2 -42
  19. package/dist/chunks/environment.d.BsToaxti.d.ts +65 -0
  20. package/dist/chunks/{git.BVQ8w_Sw.js → git.BFNcloKD.js} +1 -2
  21. package/dist/chunks/{global.d.MAmajcmJ.d.ts → global.d.BK3X7FW1.d.ts} +7 -32
  22. package/dist/chunks/{globals.DEHgCU4V.js → globals.DG-S3xFe.js} +8 -8
  23. package/dist/chunks/{index.VByaPkjc.js → index.BIP7prJq.js} +472 -803
  24. package/dist/chunks/{index.B521nVV-.js → index.Bgo3tNWt.js} +23 -4
  25. package/dist/chunks/{index.BCWujgDG.js → index.BjKEiSn0.js} +14 -24
  26. package/dist/chunks/{index.CdQS2e2Q.js → index.CMfqw92x.js} +7 -8
  27. package/dist/chunks/{index.CmSc2RE5.js → index.DIWhzsUh.js} +72 -118
  28. package/dist/chunks/{inspector.C914Efll.js → inspector.CvQD-Nie.js} +10 -25
  29. package/dist/chunks/moduleRunner.d.D9nBoC4p.d.ts +201 -0
  30. package/dist/chunks/moduleTransport.I-bgQy0S.js +19 -0
  31. package/dist/chunks/{node.fjCdwEIl.js → node.CyipiPvJ.js} +1 -1
  32. package/dist/chunks/plugin.d.BMVSnsGV.d.ts +9 -0
  33. package/dist/chunks/{reporters.d.BFLkQcL6.d.ts → reporters.d.BUWjmRYq.d.ts} +2086 -2146
  34. package/dist/chunks/resolveSnapshotEnvironment.Bkht6Yor.js +81 -0
  35. package/dist/chunks/resolver.Bx6lE0iq.js +119 -0
  36. package/dist/chunks/rpc.BKr6mtxz.js +65 -0
  37. package/dist/chunks/{setup-common.Dd054P77.js → setup-common.uiMcU3cv.js} +17 -29
  38. package/dist/chunks/startModuleRunner.p67gbNo9.js +665 -0
  39. package/dist/chunks/{suite.d.FvehnV49.d.ts → suite.d.BJWk38HB.d.ts} +1 -1
  40. package/dist/chunks/test.BiqSKISg.js +214 -0
  41. package/dist/chunks/{typechecker.DRKU1-1g.js → typechecker.DB-fIMaH.js} +165 -234
  42. package/dist/chunks/{utils.CAioKnHs.js → utils.C2YI6McM.js} +5 -14
  43. package/dist/chunks/{utils.XdZDrNZV.js → utils.D2R2NiOH.js} +8 -27
  44. package/dist/chunks/{vi.bdSIJ99Y.js → vi.ZPgvtBao.js} +156 -305
  45. package/dist/chunks/{vm.BThCzidc.js → vm.Ca0Y0W5f.js} +116 -226
  46. package/dist/chunks/{worker.d.1GmBbd7G.d.ts → worker.d.BDsXGkwh.d.ts} +31 -32
  47. package/dist/chunks/{worker.d.CKwWzBSj.d.ts → worker.d.BNcX_2mH.d.ts} +1 -1
  48. package/dist/cli.js +10 -10
  49. package/dist/config.cjs +5 -58
  50. package/dist/config.d.ts +72 -71
  51. package/dist/config.js +3 -9
  52. package/dist/coverage.d.ts +31 -24
  53. package/dist/coverage.js +9 -9
  54. package/dist/environments.d.ts +9 -14
  55. package/dist/environments.js +1 -1
  56. package/dist/index.d.ts +52 -213
  57. package/dist/index.js +7 -9
  58. package/dist/module-evaluator.d.ts +13 -0
  59. package/dist/module-evaluator.js +276 -0
  60. package/dist/module-runner.js +15 -0
  61. package/dist/node.d.ts +62 -51
  62. package/dist/node.js +26 -42
  63. package/dist/reporters.d.ts +11 -12
  64. package/dist/reporters.js +12 -12
  65. package/dist/runners.d.ts +3 -4
  66. package/dist/runners.js +13 -231
  67. package/dist/snapshot.js +2 -2
  68. package/dist/suite.d.ts +2 -2
  69. package/dist/suite.js +2 -2
  70. package/dist/worker.js +90 -47
  71. package/dist/workers/forks.js +34 -10
  72. package/dist/workers/runVmTests.js +36 -56
  73. package/dist/workers/threads.js +34 -10
  74. package/dist/workers/vmForks.js +11 -10
  75. package/dist/workers/vmThreads.js +11 -10
  76. package/dist/workers.d.ts +5 -7
  77. package/dist/workers.js +35 -17
  78. package/globals.d.ts +17 -17
  79. package/package.json +32 -31
  80. package/dist/chunks/base.DfmxU-tU.js +0 -38
  81. package/dist/chunks/environment.d.cL3nLXbE.d.ts +0 -119
  82. package/dist/chunks/execute.B7h3T_Hc.js +0 -708
  83. package/dist/chunks/index.CwejwG0H.js +0 -105
  84. package/dist/chunks/rpc.-pEldfrD.js +0 -83
  85. package/dist/chunks/runBaseTests.9Ij9_de-.js +0 -129
  86. package/dist/chunks/vite.d.CMLlLIFP.d.ts +0 -25
  87. package/dist/execute.d.ts +0 -150
  88. package/dist/execute.js +0 -13
@@ -1,119 +0,0 @@
1
- import { happyDomTypes, jsdomTypes } from 'vitest/optional-types.js';
2
-
3
- type Awaitable<T> = T | PromiseLike<T>;
4
- type Nullable<T> = T | null | undefined;
5
- type Arrayable<T> = T | Array<T>;
6
- type ArgumentsType<T> = T extends (...args: infer U) => any ? U : never;
7
- type MutableArray<T extends readonly any[]> = { -readonly [k in keyof T] : T[k] };
8
- interface Constructable {
9
- new (...args: any[]): any;
10
- }
11
- type TransformMode = "web" | "ssr";
12
- /** @deprecated not used */
13
- interface ModuleCache {
14
- promise?: Promise<any>;
15
- exports?: any;
16
- code?: string;
17
- }
18
- interface AfterSuiteRunMeta {
19
- coverage?: unknown;
20
- testFiles: string[];
21
- transformMode: TransformMode | "browser";
22
- projectName?: string;
23
- }
24
- interface UserConsoleLog {
25
- content: string;
26
- origin?: string;
27
- browser?: boolean;
28
- type: "stdout" | "stderr";
29
- taskId?: string;
30
- time: number;
31
- size: number;
32
- }
33
- interface ModuleGraphData {
34
- graph: Record<string, string[]>;
35
- externalized: string[];
36
- inlined: string[];
37
- }
38
- interface ProvidedContext {}
39
- // These need to be compatible with Tinyrainbow's bg-colors, and CSS's background-color
40
- type LabelColor = "black" | "red" | "green" | "yellow" | "blue" | "magenta" | "cyan" | "white";
41
-
42
- type HappyDOMOptions = Omit<NonNullable<ConstructorParameters<typeof happyDomTypes.Window>[0]>, "console">;
43
-
44
- type JSDOMOptions = ConstructorOptionsOverride & Omit<jsdomTypes.ConstructorOptions, keyof ConstructorOptionsOverride>;
45
- interface ConstructorOptionsOverride {
46
- /**
47
- * The html content for the test.
48
- *
49
- * @default '<!DOCTYPE html>'
50
- */
51
- html?: string | ArrayBufferLike;
52
- /**
53
- * userAgent affects the value read from navigator.userAgent, as well as the User-Agent header sent while fetching subresources.
54
- *
55
- * @default `Mozilla/5.0 (${process.platform}) AppleWebKit/537.36 (KHTML, like Gecko) jsdom/${jsdomVersion}`
56
- */
57
- userAgent?: string;
58
- /**
59
- * url sets the value returned by window.location, document.URL, and document.documentURI,
60
- * and affects things like resolution of relative URLs within the document
61
- * and the same-origin restrictions and referrer used while fetching subresources.
62
- *
63
- * @default 'http://localhost:3000'.
64
- */
65
- url?: string;
66
- /**
67
- * Enable console?
68
- *
69
- * @default false
70
- */
71
- console?: boolean;
72
- /**
73
- * jsdom does not have the capability to render visual content, and will act like a headless browser by default.
74
- * It provides hints to web pages through APIs such as document.hidden that their content is not visible.
75
- *
76
- * When the `pretendToBeVisual` option is set to `true`, jsdom will pretend that it is rendering and displaying
77
- * content.
78
- *
79
- * @default true
80
- */
81
- pretendToBeVisual?: boolean;
82
- /**
83
- * Enable CookieJar
84
- *
85
- * @default false
86
- */
87
- cookieJar?: boolean;
88
- resources?: "usable";
89
- }
90
-
91
- interface EnvironmentReturn {
92
- teardown: (global: any) => Awaitable<void>;
93
- }
94
- interface VmEnvironmentReturn {
95
- getVmContext: () => {
96
- [key: string]: any
97
- };
98
- teardown: () => Awaitable<void>;
99
- }
100
- interface Environment {
101
- name: string;
102
- transformMode: "web" | "ssr";
103
- setupVM?: (options: Record<string, any>) => Awaitable<VmEnvironmentReturn>;
104
- setup: (global: any, options: Record<string, any>) => Awaitable<EnvironmentReturn>;
105
- }
106
- interface EnvironmentOptions {
107
- /**
108
- * jsdom options.
109
- */
110
- jsdom?: JSDOMOptions;
111
- happyDOM?: HappyDOMOptions;
112
- [x: string]: unknown;
113
- }
114
- interface ResolvedTestEnvironment {
115
- environment: Environment;
116
- options: Record<string, any> | null;
117
- }
118
-
119
- export type { AfterSuiteRunMeta as A, Constructable as C, Environment as E, HappyDOMOptions as H, JSDOMOptions as J, LabelColor as L, 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 };