vitest 3.1.3 → 3.2.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.
- package/LICENSE.md +0 -232
- package/dist/browser.d.ts +4 -2
- package/dist/browser.js +3 -4
- package/dist/chunks/{base.DslwPSCy.js → base.DwtwORaC.js} +2 -2
- package/dist/chunks/{cac.BN2e7cE1.js → cac.I9MLYfT-.js} +14 -10
- package/dist/chunks/{cli-api.Bti1vevt.js → cli-api.d6IK1pnk.js} +945 -852
- package/dist/chunks/{coverage.87S59-Sl.js → coverage.OGU09Jbh.js} +129 -4216
- package/dist/chunks/{creator.CuL7xDWI.js → creator.DGAdZ4Hj.js} +18 -39
- package/dist/chunks/{environment.d.Dmw5ulng.d.ts → environment.d.D8YDy2v5.d.ts} +2 -1
- package/dist/chunks/{execute.BpmIjFTD.js → execute.JlGHLJZT.js} +3 -5
- package/dist/chunks/{global.d.CXRAxnWc.d.ts → global.d.BPa1eL3O.d.ts} +17 -12
- package/dist/chunks/{globals.CZAEe_Gf.js → globals.CpxW8ccg.js} +2 -3
- package/dist/chunks/{index.Bw6JxgX8.js → index.CK1YOQaa.js} +7 -7
- package/dist/chunks/{index.De2FqGmR.js → index.CV36oG_L.js} +896 -957
- package/dist/chunks/{index.B0uVAVvx.js → index.CfXMNXHg.js} +2 -14
- package/dist/chunks/index.CmC5OK9L.js +275 -0
- package/dist/chunks/{index.Cu2UlluP.js → index.DswW_LEs.js} +2 -2
- package/dist/chunks/{index.DBIGubLC.js → index.X0nbfr6-.js} +7 -7
- package/dist/chunks/{reporters.d.DG9VKi4m.d.ts → reporters.d.CLC9rhKy.d.ts} +68 -11
- package/dist/chunks/{runBaseTests.BV8m0B-u.js → runBaseTests.Dn2vyej_.js} +5 -6
- package/dist/chunks/{setup-common.AQcDs321.js → setup-common.CYo3Y0dD.js} +1 -3
- package/dist/chunks/typechecker.DnTrplSJ.js +897 -0
- package/dist/chunks/{vi.ClIskdbk.js → vi.BFR5YIgu.js} +3 -0
- package/dist/chunks/{vite.d.D3ndlJcw.d.ts → vite.d.CBZ3M_ru.d.ts} +1 -1
- package/dist/chunks/{vm.CuLHT1BG.js → vm.C1HHjtNS.js} +1 -1
- package/dist/chunks/{worker.d.CHGSOG0s.d.ts → worker.d.CoCI7hzP.d.ts} +1 -1
- package/dist/chunks/{worker.d.C-KN07Ls.d.ts → worker.d.D5Xdi-Zr.d.ts} +1 -1
- package/dist/cli.js +20 -1
- package/dist/config.cjs +3 -0
- package/dist/config.d.ts +8 -5
- package/dist/config.js +3 -0
- package/dist/coverage.d.ts +3 -3
- package/dist/coverage.js +4 -7
- package/dist/environments.d.ts +2 -2
- package/dist/execute.d.ts +2 -2
- package/dist/execute.js +1 -1
- package/dist/index.d.ts +45 -32
- package/dist/index.js +2 -3
- package/dist/node.d.ts +8 -8
- package/dist/node.js +16 -18
- package/dist/reporters.d.ts +3 -3
- package/dist/reporters.js +14 -14
- package/dist/runners.d.ts +1 -1
- package/dist/runners.js +2 -2
- package/dist/workers/forks.js +2 -2
- package/dist/workers/runVmTests.js +5 -6
- package/dist/workers/threads.js +2 -2
- package/dist/workers/vmForks.js +2 -2
- package/dist/workers/vmThreads.js +2 -2
- package/dist/workers.d.ts +3 -3
- package/dist/workers.js +3 -3
- package/package.json +15 -19
- package/dist/chunks/run-once.Dimr7O9f.js +0 -47
- package/dist/chunks/typechecker.DYQbn8uK.js +0 -956
- package/dist/chunks/utils.Cc45eY3L.js +0 -200
- package/dist/utils.d.ts +0 -3
- package/dist/utils.js +0 -2
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { a as createThreadsRpcOptions } from '../chunks/utils.BfxieIyZ.js';
|
|
2
|
-
import { r as runVmTests } from '../chunks/vm.
|
|
2
|
+
import { r as runVmTests } from '../chunks/vm.C1HHjtNS.js';
|
|
3
3
|
import '@vitest/utils';
|
|
4
4
|
import 'node:url';
|
|
5
5
|
import 'node:vm';
|
|
@@ -12,7 +12,7 @@ import 'node:stream';
|
|
|
12
12
|
import 'tinyrainbow';
|
|
13
13
|
import '../chunks/date.CDOsz-HY.js';
|
|
14
14
|
import '../chunks/utils.CgTj3MsC.js';
|
|
15
|
-
import '../chunks/execute.
|
|
15
|
+
import '../chunks/execute.JlGHLJZT.js';
|
|
16
16
|
import 'node:fs';
|
|
17
17
|
import '@vitest/utils/error';
|
|
18
18
|
import 'vite-node/client';
|
package/dist/workers.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { W as WorkerGlobalState, C as ContextRPC, B as BirpcOptions, R as RuntimeRPC } from './chunks/worker.d.
|
|
1
|
+
import { W as WorkerGlobalState, C as ContextRPC, B as BirpcOptions, R as RuntimeRPC } from './chunks/worker.d.CoCI7hzP.js';
|
|
2
2
|
import { Awaitable } from '@vitest/utils';
|
|
3
3
|
import * as v8 from 'v8';
|
|
4
4
|
import { a as SerializedConfig } from './chunks/config.d.UqE-KR0o.js';
|
|
5
|
-
import { W as WorkerContext } from './chunks/worker.d.
|
|
5
|
+
import { W as WorkerContext } from './chunks/worker.d.D5Xdi-Zr.js';
|
|
6
6
|
import '@vitest/runner';
|
|
7
7
|
import 'vite-node';
|
|
8
|
-
import './chunks/environment.d.
|
|
8
|
+
import './chunks/environment.d.D8YDy2v5.js';
|
|
9
9
|
import 'vitest/optional-types.js';
|
|
10
10
|
import '@vitest/snapshot';
|
|
11
11
|
import '@vitest/pretty-format';
|
package/dist/workers.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
export { p as provideWorkerState } from './chunks/utils.CgTj3MsC.js';
|
|
2
2
|
export { collect as collectVitestWorkerTests, run as runVitestWorker } from './worker.js';
|
|
3
|
-
export { r as runBaseTests } from './chunks/base.
|
|
3
|
+
export { r as runBaseTests } from './chunks/base.DwtwORaC.js';
|
|
4
4
|
export { c as createForksRpcOptions, a as createThreadsRpcOptions, u as unwrapSerializableConfig } from './chunks/utils.BfxieIyZ.js';
|
|
5
|
-
export { r as runVmTests } from './chunks/vm.
|
|
5
|
+
export { r as runVmTests } from './chunks/vm.C1HHjtNS.js';
|
|
6
6
|
import '@vitest/utils';
|
|
7
7
|
import 'node:url';
|
|
8
8
|
import '@vitest/utils/source-map';
|
|
@@ -16,7 +16,7 @@ import './chunks/inspector.DbDkSkFn.js';
|
|
|
16
16
|
import 'node:module';
|
|
17
17
|
import './chunks/rpc.D9_013TY.js';
|
|
18
18
|
import './chunks/index.CJ0plNrh.js';
|
|
19
|
-
import './chunks/execute.
|
|
19
|
+
import './chunks/execute.JlGHLJZT.js';
|
|
20
20
|
import 'node:vm';
|
|
21
21
|
import '@vitest/utils/error';
|
|
22
22
|
import 'vite-node/utils';
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vitest",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "3.
|
|
4
|
+
"version": "3.2.0-beta.2",
|
|
5
5
|
"description": "Next generation testing framework powered by Vite",
|
|
6
6
|
"author": "Anthony Fu <anthonyfu117@hotmail.com>",
|
|
7
7
|
"license": "MIT",
|
|
@@ -58,7 +58,7 @@
|
|
|
58
58
|
"types": "./dist/workers.d.ts",
|
|
59
59
|
"import": "./dist/workers.js"
|
|
60
60
|
},
|
|
61
|
-
"./browser": {
|
|
61
|
+
"./internal/browser": {
|
|
62
62
|
"types": "./dist/browser.d.ts",
|
|
63
63
|
"default": "./dist/browser.js"
|
|
64
64
|
},
|
|
@@ -74,10 +74,6 @@
|
|
|
74
74
|
"types": "./dist/environments.d.ts",
|
|
75
75
|
"default": "./dist/environments.js"
|
|
76
76
|
},
|
|
77
|
-
"./utils": {
|
|
78
|
-
"types": "./dist/utils.d.ts",
|
|
79
|
-
"default": "./dist/utils.js"
|
|
80
|
-
},
|
|
81
77
|
"./config": {
|
|
82
78
|
"types": "./config.d.ts",
|
|
83
79
|
"require": "./dist/config.cjs",
|
|
@@ -123,8 +119,8 @@
|
|
|
123
119
|
"@types/node": "^18.0.0 || ^20.0.0 || >=22.0.0",
|
|
124
120
|
"happy-dom": "*",
|
|
125
121
|
"jsdom": "*",
|
|
126
|
-
"@vitest/browser": "3.
|
|
127
|
-
"@vitest/ui": "3.
|
|
122
|
+
"@vitest/browser": "3.2.0-beta.2",
|
|
123
|
+
"@vitest/ui": "3.2.0-beta.2"
|
|
128
124
|
},
|
|
129
125
|
"peerDependenciesMeta": {
|
|
130
126
|
"@edge-runtime/vm": {
|
|
@@ -150,11 +146,13 @@
|
|
|
150
146
|
}
|
|
151
147
|
},
|
|
152
148
|
"dependencies": {
|
|
149
|
+
"@types/chai": "^5.2.2",
|
|
153
150
|
"chai": "^5.2.0",
|
|
154
151
|
"debug": "^4.4.0",
|
|
155
152
|
"expect-type": "^1.2.1",
|
|
156
153
|
"magic-string": "^0.30.17",
|
|
157
154
|
"pathe": "^2.0.3",
|
|
155
|
+
"picomatch": "^4.0.2",
|
|
158
156
|
"std-env": "^3.9.0",
|
|
159
157
|
"tinybench": "^2.9.0",
|
|
160
158
|
"tinyexec": "^0.3.2",
|
|
@@ -163,14 +161,14 @@
|
|
|
163
161
|
"tinyrainbow": "^2.0.0",
|
|
164
162
|
"vite": "^5.0.0 || ^6.0.0",
|
|
165
163
|
"why-is-node-running": "^2.3.0",
|
|
166
|
-
"@vitest/
|
|
167
|
-
"@vitest/pretty-format": "^3.
|
|
168
|
-
"@vitest/
|
|
169
|
-
"@vitest/runner": "3.
|
|
170
|
-
"@vitest/spy": "3.
|
|
171
|
-
"
|
|
172
|
-
"
|
|
173
|
-
"@vitest/
|
|
164
|
+
"@vitest/mocker": "3.2.0-beta.2",
|
|
165
|
+
"@vitest/pretty-format": "^3.2.0-beta.2",
|
|
166
|
+
"@vitest/expect": "3.2.0-beta.2",
|
|
167
|
+
"@vitest/runner": "3.2.0-beta.2",
|
|
168
|
+
"@vitest/spy": "3.2.0-beta.2",
|
|
169
|
+
"vite-node": "3.2.0-beta.2",
|
|
170
|
+
"@vitest/utils": "3.2.0-beta.2",
|
|
171
|
+
"@vitest/snapshot": "3.2.0-beta.2"
|
|
174
172
|
},
|
|
175
173
|
"devDependencies": {
|
|
176
174
|
"@ampproject/remapping": "^2.3.0",
|
|
@@ -182,8 +180,8 @@
|
|
|
182
180
|
"@types/istanbul-lib-coverage": "^2.0.6",
|
|
183
181
|
"@types/istanbul-reports": "^3.0.4",
|
|
184
182
|
"@types/jsdom": "^21.1.7",
|
|
185
|
-
"@types/micromatch": "^4.0.9",
|
|
186
183
|
"@types/node": "^22.14.1",
|
|
184
|
+
"@types/picomatch": "^4.0.0",
|
|
187
185
|
"@types/prompts": "^2.4.9",
|
|
188
186
|
"@types/sinonjs__fake-timers": "^8.1.5",
|
|
189
187
|
"acorn-walk": "^8.3.4",
|
|
@@ -192,11 +190,9 @@
|
|
|
192
190
|
"chai-subset": "^1.6.0",
|
|
193
191
|
"find-up": "^6.3.0",
|
|
194
192
|
"flatted": "^3.3.3",
|
|
195
|
-
"get-tsconfig": "^4.10.0",
|
|
196
193
|
"happy-dom": "^17.4.4",
|
|
197
194
|
"jsdom": "^26.1.0",
|
|
198
195
|
"local-pkg": "^1.1.1",
|
|
199
|
-
"micromatch": "^4.0.8",
|
|
200
196
|
"pretty-format": "^29.7.0",
|
|
201
197
|
"prompts": "^2.4.2",
|
|
202
198
|
"strip-literal": "^3.0.0",
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import { g as getWorkerState } from './utils.CgTj3MsC.js';
|
|
2
|
-
|
|
3
|
-
const filesCount = new Map();
|
|
4
|
-
const cache = new Map();
|
|
5
|
-
/**
|
|
6
|
-
* This utils allows computational intensive tasks to only be ran once
|
|
7
|
-
* across test reruns to improve the watch mode performance.
|
|
8
|
-
*
|
|
9
|
-
* Currently only works with `poolOptions.<pool>.isolate: false`
|
|
10
|
-
*
|
|
11
|
-
* @experimental
|
|
12
|
-
*/
|
|
13
|
-
function runOnce(fn, key) {
|
|
14
|
-
const filepath = getWorkerState().filepath || "__unknown_files__";
|
|
15
|
-
if (!key) {
|
|
16
|
-
filesCount.set(filepath, (filesCount.get(filepath) || 0) + 1);
|
|
17
|
-
key = String(filesCount.get(filepath));
|
|
18
|
-
}
|
|
19
|
-
const id = `${filepath}:${key}`;
|
|
20
|
-
if (!cache.has(id)) {
|
|
21
|
-
cache.set(id, fn());
|
|
22
|
-
}
|
|
23
|
-
return cache.get(id);
|
|
24
|
-
}
|
|
25
|
-
/**
|
|
26
|
-
* Get a boolean indicates whether the task is running in the first time.
|
|
27
|
-
* Could only be `false` in watch mode.
|
|
28
|
-
*
|
|
29
|
-
* Currently only works with `isolate: false`
|
|
30
|
-
*
|
|
31
|
-
* @experimental
|
|
32
|
-
*/
|
|
33
|
-
function isFirstRun() {
|
|
34
|
-
let firstRun = false;
|
|
35
|
-
runOnce(() => {
|
|
36
|
-
firstRun = true;
|
|
37
|
-
}, "__vitest_first_run__");
|
|
38
|
-
return firstRun;
|
|
39
|
-
}
|
|
40
|
-
/**
|
|
41
|
-
* @internal
|
|
42
|
-
*/
|
|
43
|
-
function resetRunOnceCounter() {
|
|
44
|
-
filesCount.clear();
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
export { runOnce as a, isFirstRun as i, resetRunOnceCounter as r };
|