vitest 5.0.0-beta.2 → 5.0.0-beta.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 (44) hide show
  1. package/dist/browser.d.ts +1 -1
  2. package/dist/browser.js +1 -1
  3. package/dist/chunks/{base.Opc_YHkk.js → base.BEGVMQrS.js} +6 -6
  4. package/dist/chunks/{browser.d.BUhkKcDl.d.ts → browser.d.BGxB4Xum.d.ts} +5 -26
  5. package/dist/chunks/{cac.8N4bOkkB.js → cac.CyXAEMkE.js} +26 -33
  6. package/dist/chunks/{cli-api.B0RFke2g.js → cli-api.DJMXq34b.js} +640 -615
  7. package/dist/chunks/{config.d.D91DHYaD.d.ts → config.d.DXq1aBpy.d.ts} +93 -89
  8. package/dist/chunks/{creator.BqL2U_x4.js → creator.D66cVXYh.js} +2 -2
  9. package/dist/chunks/{defaults.szbHWQun.js → defaults.CUUnbOrq.js} +6 -4
  10. package/dist/chunks/{env.D4Lgay0q.js → env.BKKtU2WC.js} +2 -1
  11. package/dist/chunks/global.d.BtKPuz2X.d.ts +194 -0
  12. package/dist/chunks/{globals.EHmmu0nC.js → globals.BuY-yD0m.js} +2 -1
  13. package/dist/chunks/{index.D_7-4CaB.js → index.CE58PZNH.js} +1660 -701
  14. package/dist/chunks/{index.CViWo__T.js → index.CcluKS59.js} +4 -4
  15. package/dist/chunks/{index.CbgUM9E5.js → index.nQFVd50u.js} +2 -1
  16. package/dist/chunks/{init-forks.DMge3WTt.js → init-forks.Ce3vGWgL.js} +1 -1
  17. package/dist/chunks/{init-threads.eIoyCTon.js → init-threads.8e1OLv5v.js} +1 -1
  18. package/dist/chunks/{init.BVd7SaCA.js → init.6qx-LaHs.js} +31 -3
  19. package/dist/chunks/{nativeModuleMocker.DKpFw0pk.js → nativeModuleMocker.DDZfQXLs.js} +1 -1
  20. package/dist/chunks/{plugin.d.cIKZEZ16.d.ts → plugin.d.B7MTG_Fe.d.ts} +103 -88
  21. package/dist/chunks/{rpc.d.7JZuxZ8u.d.ts → rpc.d.OQ_EZi1Z.d.ts} +18 -2
  22. package/dist/chunks/{setup-common.Hpq30zVk.js → setup-common.DdEF_hkE.js} +1 -1
  23. package/dist/chunks/{vm.2okbRRME.js → vm.Bu7mmcZq.js} +2 -2
  24. package/dist/chunks/{worker.d.Bu1kXGw4.d.ts → worker.d.yR22cs6X.d.ts} +3 -2
  25. package/dist/cli.js +2 -2
  26. package/dist/config.cjs +1 -1
  27. package/dist/config.d.ts +7 -10
  28. package/dist/config.js +2 -2
  29. package/dist/index.d.ts +24 -41
  30. package/dist/index.js +2 -1
  31. package/dist/module-evaluator.d.ts +4 -1
  32. package/dist/module-evaluator.js +15 -20
  33. package/dist/node.d.ts +20 -13
  34. package/dist/node.js +6 -6
  35. package/dist/runtime.js +2 -2
  36. package/dist/worker.d.ts +3 -3
  37. package/dist/worker.js +7 -6
  38. package/dist/workers/forks.js +8 -7
  39. package/dist/workers/runVmTests.js +4 -3
  40. package/dist/workers/threads.js +8 -7
  41. package/dist/workers/vmForks.js +4 -4
  42. package/dist/workers/vmThreads.js +4 -4
  43. package/package.json +20 -21
  44. package/dist/chunks/global.d.DhbKSQoV.d.ts +0 -99
@@ -1,11 +1,11 @@
1
- import { s as setupBaseEnvironment, r as runBaseTests } from '../chunks/base.Opc_YHkk.js';
2
- import { w as workerInit } from '../chunks/init-threads.eIoyCTon.js';
1
+ import { s as setupBaseEnvironment, r as runBaseTests } from '../chunks/base.BEGVMQrS.js';
2
+ import { w as workerInit } from '../chunks/init-threads.8e1OLv5v.js';
3
3
  import 'node:vm';
4
4
  import '@vitest/spy';
5
- import '../chunks/index.CViWo__T.js';
5
+ import '../chunks/index.CcluKS59.js';
6
6
  import 'chai';
7
7
  import 'node:async_hooks';
8
- import '../chunks/setup-common.Hpq30zVk.js';
8
+ import '../chunks/setup-common.DdEF_hkE.js';
9
9
  import '../chunks/coverage.CTzCuANN.js';
10
10
  import '@vitest/utils/timers';
11
11
  import '../chunks/utils.BX5Fg8C4.js';
@@ -15,7 +15,7 @@ import '../chunks/rpc.DFRWVnRh.js';
15
15
  import 'pathe';
16
16
  import 'vite/module-runner';
17
17
  import '../chunks/index.Chj8NDwU.js';
18
- import '../chunks/index.D_7-4CaB.js';
18
+ import '../chunks/index.CE58PZNH.js';
19
19
  import '@vitest/runner';
20
20
  import '@vitest/utils/helpers';
21
21
  import '@vitest/utils/offset';
@@ -26,12 +26,13 @@ import '@vitest/utils/error';
26
26
  import '@vitest/utils/diff';
27
27
  import '@vitest/utils/display';
28
28
  import 'tinyrainbow';
29
+ import 'tinybench';
29
30
  import 'expect-type';
30
- import '../chunks/init.BVd7SaCA.js';
31
+ import '../chunks/init.6qx-LaHs.js';
31
32
  import 'node:fs';
32
33
  import 'node:module';
33
34
  import 'node:url';
34
- import '../chunks/index.CbgUM9E5.js';
35
+ import '../chunks/index.nQFVd50u.js';
35
36
  import '../chunks/modules.BJuCwlRJ.js';
36
37
  import '../path.js';
37
38
  import 'node:path';
@@ -1,12 +1,12 @@
1
- import { w as workerInit } from '../chunks/init-forks.DMge3WTt.js';
2
- import { r as runVmTests, s as setupVmWorker } from '../chunks/vm.2okbRRME.js';
3
- import '../chunks/init.BVd7SaCA.js';
1
+ import { w as workerInit } from '../chunks/init-forks.Ce3vGWgL.js';
2
+ import { r as runVmTests, s as setupVmWorker } from '../chunks/vm.Bu7mmcZq.js';
3
+ import '../chunks/init.6qx-LaHs.js';
4
4
  import 'node:fs';
5
5
  import 'node:module';
6
6
  import 'node:url';
7
7
  import 'pathe';
8
8
  import 'vite/module-runner';
9
- import '../chunks/index.CbgUM9E5.js';
9
+ import '../chunks/index.nQFVd50u.js';
10
10
  import '@vitest/utils/helpers';
11
11
  import '../chunks/modules.BJuCwlRJ.js';
12
12
  import '../chunks/utils.BX5Fg8C4.js';
@@ -1,13 +1,13 @@
1
- import { w as workerInit } from '../chunks/init-threads.eIoyCTon.js';
2
- import { s as setupVmWorker, r as runVmTests } from '../chunks/vm.2okbRRME.js';
1
+ import { w as workerInit } from '../chunks/init-threads.8e1OLv5v.js';
2
+ import { s as setupVmWorker, r as runVmTests } from '../chunks/vm.Bu7mmcZq.js';
3
3
  import 'node:worker_threads';
4
- import '../chunks/init.BVd7SaCA.js';
4
+ import '../chunks/init.6qx-LaHs.js';
5
5
  import 'node:fs';
6
6
  import 'node:module';
7
7
  import 'node:url';
8
8
  import 'pathe';
9
9
  import 'vite/module-runner';
10
- import '../chunks/index.CbgUM9E5.js';
10
+ import '../chunks/index.nQFVd50u.js';
11
11
  import '@vitest/utils/helpers';
12
12
  import '../chunks/modules.BJuCwlRJ.js';
13
13
  import '../chunks/utils.BX5Fg8C4.js';
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "vitest",
3
3
  "type": "module",
4
- "version": "5.0.0-beta.2",
4
+ "version": "5.0.0-beta.4",
5
5
  "description": "Next generation testing framework powered by Vite",
6
6
  "author": "Anthony Fu <anthonyfu117@hotmail.com>",
7
7
  "license": "MIT",
@@ -107,21 +107,21 @@
107
107
  "dist"
108
108
  ],
109
109
  "engines": {
110
- "node": "^20.0.0 || ^22.0.0 || >=24.0.0"
110
+ "node": "^22.12.0 || ^24.0.0 || >=26.0.0"
111
111
  },
112
112
  "peerDependencies": {
113
113
  "@edge-runtime/vm": "*",
114
114
  "@opentelemetry/api": "^1.9.0",
115
- "@types/node": "^20.0.0 || ^22.0.0 || >=24.0.0",
115
+ "@types/node": "^22.0.0 || >=24.0.0",
116
116
  "happy-dom": "*",
117
117
  "jsdom": "*",
118
- "vite": "^6.0.0 || ^7.0.0 || ^8.0.0",
119
- "@vitest/browser-playwright": "5.0.0-beta.2",
120
- "@vitest/browser-preview": "5.0.0-beta.2",
121
- "@vitest/coverage-istanbul": "5.0.0-beta.2",
122
- "@vitest/ui": "5.0.0-beta.2",
123
- "@vitest/coverage-v8": "5.0.0-beta.2",
124
- "@vitest/browser-webdriverio": "5.0.0-beta.2"
118
+ "vite": "^6.4.0 || ^7.0.0 || ^8.0.0",
119
+ "@vitest/browser-playwright": "5.0.0-beta.4",
120
+ "@vitest/browser-webdriverio": "5.0.0-beta.4",
121
+ "@vitest/browser-preview": "5.0.0-beta.4",
122
+ "@vitest/coverage-istanbul": "5.0.0-beta.4",
123
+ "@vitest/coverage-v8": "5.0.0-beta.4",
124
+ "@vitest/ui": "5.0.0-beta.4"
125
125
  },
126
126
  "peerDependenciesMeta": {
127
127
  "@edge-runtime/vm": {
@@ -171,17 +171,16 @@
171
171
  "pathe": "^2.0.3",
172
172
  "picomatch": "^4.0.3",
173
173
  "std-env": "^4.0.0-rc.1",
174
- "tinybench": "^2.9.0",
174
+ "tinybench": "^6.0.1",
175
175
  "tinyexec": "^1.0.2",
176
176
  "tinyglobby": "^0.2.15",
177
177
  "tinyrainbow": "^3.1.0",
178
- "vite": "^6.0.0 || ^7.0.0 || ^8.0.0",
179
178
  "why-is-node-running": "^2.3.0",
180
- "@vitest/mocker": "5.0.0-beta.2",
181
- "@vitest/pretty-format": "5.0.0-beta.2",
182
- "@vitest/spy": "5.0.0-beta.2",
183
- "@vitest/utils": "5.0.0-beta.2",
184
- "@vitest/runner": "5.0.0-beta.2"
179
+ "@vitest/mocker": "5.0.0-beta.4",
180
+ "@vitest/runner": "5.0.0-beta.4",
181
+ "@vitest/spy": "5.0.0-beta.4",
182
+ "@vitest/utils": "5.0.0-beta.4",
183
+ "@vitest/pretty-format": "5.0.0-beta.4"
185
184
  },
186
185
  "devDependencies": {
187
186
  "@antfu/install-pkg": "^1.1.0",
@@ -189,7 +188,7 @@
189
188
  "@edge-runtime/vm": "^5.0.0",
190
189
  "@jridgewell/trace-mapping": "0.3.31",
191
190
  "@opentelemetry/api": "^1.9.0",
192
- "@sinonjs/fake-timers": "15.0.0",
191
+ "@sinonjs/fake-timers": "15.3.2",
193
192
  "@types/estree": "^1.0.8",
194
193
  "@types/istanbul-lib-coverage": "^2.0.6",
195
194
  "@types/istanbul-reports": "^3.0.4",
@@ -197,7 +196,6 @@
197
196
  "@types/node": "^24.12.0",
198
197
  "@types/picomatch": "^4.0.2",
199
198
  "@types/prompts": "^2.4.9",
200
- "@types/sinonjs__fake-timers": "^15.0.1",
201
199
  "acorn": "8.11.3",
202
200
  "acorn-walk": "^8.3.5",
203
201
  "birpc": "^4.0.0",
@@ -211,9 +209,10 @@
211
209
  "prompts": "^2.4.2",
212
210
  "strip-literal": "^3.1.0",
213
211
  "tinyhighlight": "^0.3.2",
212
+ "vite": "^6.4.0 || ^7.0.0 || ^8.0.0",
214
213
  "ws": "^8.19.0",
215
- "@vitest/expect": "5.0.0-beta.2",
216
- "@vitest/snapshot": "5.0.0-beta.2"
214
+ "@vitest/snapshot": "5.0.0-beta.4",
215
+ "@vitest/expect": "5.0.0-beta.4"
217
216
  },
218
217
  "scripts": {
219
218
  "build": "premove dist && rollup -c",
@@ -1,99 +0,0 @@
1
- import { P as PromisifyAssertion, T as Tester, E as ExpectStatic, l as BenchmarkResult } from './browser.d.BUhkKcDl.js';
2
- import { Plugin } from '@vitest/pretty-format';
3
- import { Test } from '@vitest/runner';
4
- import { i as SnapshotState, U as UserConsoleLog } from './general.d.DFAHgpC2.js';
5
-
6
- interface SnapshotMatcher<T> {
7
- <U extends { [P in keyof T] : any }>(snapshot: Partial<U>, hint?: string): void;
8
- (hint?: string): void;
9
- }
10
- interface InlineSnapshotMatcher<T> {
11
- <U extends { [P in keyof T] : any }>(properties: Partial<U>, snapshot?: string, hint?: string): void;
12
- (hint?: string): void;
13
- }
14
- declare module "vitest" {
15
- interface MatcherState {
16
- environment: string;
17
- snapshotState: SnapshotState;
18
- task?: Readonly<Test>;
19
- }
20
- interface ExpectPollOptions {
21
- interval?: number;
22
- timeout?: number;
23
- message?: string;
24
- }
25
- interface ExpectStatic {
26
- assert: Chai.AssertStatic;
27
- unreachable: (message?: string) => never;
28
- soft: <T>(actual: T, message?: string) => Assertion<T>;
29
- poll: <T>(actual: () => T, options?: ExpectPollOptions) => PromisifyAssertion<Awaited<T>>;
30
- addEqualityTesters: (testers: Array<Tester>) => void;
31
- assertions: (expected: number) => void;
32
- hasAssertions: () => void;
33
- addSnapshotSerializer: (plugin: Plugin) => void;
34
- }
35
- interface Assertion<T> {
36
- matchSnapshot: SnapshotMatcher<T>;
37
- toMatchSnapshot: SnapshotMatcher<T>;
38
- toMatchInlineSnapshot: InlineSnapshotMatcher<T>;
39
- /**
40
- * Checks that an error thrown by a function matches a previously recorded snapshot.
41
- *
42
- * @param hint - Optional custom error message.
43
- *
44
- * @example
45
- * expect(functionWithError).toThrowErrorMatchingSnapshot();
46
- */
47
- toThrowErrorMatchingSnapshot: (hint?: string) => void;
48
- /**
49
- * Checks that an error thrown by a function matches an inline snapshot within the test file.
50
- * Useful for keeping snapshots close to the test code.
51
- *
52
- * @param snapshot - Optional inline snapshot string to match.
53
- * @param hint - Optional custom error message.
54
- *
55
- * @example
56
- * const throwError = () => { throw new Error('Error occurred') };
57
- * expect(throwError).toThrowErrorMatchingInlineSnapshot(`"Error occurred"`);
58
- */
59
- toThrowErrorMatchingInlineSnapshot: (snapshot?: string, hint?: string) => void;
60
- /**
61
- * Compares the received value to a snapshot saved in a specified file.
62
- * Useful for cases where snapshot content is large or needs to be shared across tests.
63
- *
64
- * @param filepath - Path to the snapshot file.
65
- * @param hint - Optional custom error message.
66
- *
67
- * @example
68
- * await expect(largeData).toMatchFileSnapshot('path/to/snapshot.json');
69
- */
70
- toMatchFileSnapshot: (filepath: string, hint?: string) => Promise<void>;
71
- }
72
- }
73
- declare module "@vitest/runner" {
74
- interface TestContext {
75
- /**
76
- * `expect` instance bound to the current test.
77
- *
78
- * This API is useful for running snapshot tests concurrently because global expect cannot track them.
79
- */
80
- readonly expect: ExpectStatic;
81
- /** @internal */
82
- _local: boolean;
83
- }
84
- interface TaskMeta {
85
- typecheck?: boolean;
86
- benchmark?: boolean;
87
- __vitest_label__?: string;
88
- }
89
- interface File {
90
- prepareDuration?: number;
91
- environmentLoad?: number;
92
- }
93
- interface TaskBase {
94
- logs?: UserConsoleLog[];
95
- }
96
- interface TaskResult {
97
- benchmark?: BenchmarkResult;
98
- }
99
- }