vitest 2.1.2 → 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.
- package/LICENSE.md +320 -238
- package/dist/browser.d.ts +21 -21
- package/dist/browser.js +7 -7
- package/dist/chunks/{RandomSequencer.Bh5-tlNJ.js → RandomSequencer.CMRlh2v4.js} +143 -142
- package/dist/chunks/{base.tiemDJX6.js → base.C3xNdjV6.js} +3 -3
- package/dist/chunks/{benchmark.C8CRJYG4.js → benchmark.Cdu9hjj4.js} +2 -2
- package/dist/chunks/{benchmark.JVlTzojj.d.ts → benchmark.geERunq4.d.ts} +1 -1
- package/dist/chunks/{cac.B9PaPYY1.js → cac.DrfPaMvZ.js} +11 -10
- package/dist/chunks/{cli-api.CHxC4-U8.js → cli-api.CKrRYkw8.js} +3573 -3353
- package/dist/chunks/{console.DI3gHgtH.js → console.BYGVloWk.js} +3 -7
- package/dist/chunks/{coverage.zlNdAMHK.js → coverage.BoMDb1ip.js} +1 -1
- package/dist/chunks/{creator.Cf-MKt9i.js → creator.IIqd8RWT.js} +8 -8
- package/dist/chunks/{execute._eQQfgI8.js → execute.2pr0rHgK.js} +8 -6
- package/dist/chunks/{globals.HsM2o-0O.js → globals.Bp645TTJ.js} +8 -13
- package/dist/chunks/{index.BpSiYbpB.js → index.68735LiX.js} +28 -5
- package/dist/chunks/{index.BpojBOif.js → index.BJDntFik.js} +10 -10
- package/dist/chunks/{index.FcPVJkIQ.js → index.Bn81VaWg.js} +3828 -3790
- package/dist/chunks/{index.CPD77dLA.js → index.CqYx2Nsr.js} +7 -7
- package/dist/chunks/{index.Ckn0Cw1h.js → index.D3d79vc8.js} +6 -6
- package/dist/chunks/index.Dqe5k2Rk.js +54 -0
- package/dist/chunks/{node.Bx4JZjMG.js → node.AKq966Jp.js} +1 -5
- package/dist/chunks/{reporters.DAfKSDh5.d.ts → reporters.anwo7Y6a.d.ts} +1159 -1144
- package/dist/chunks/{resolveConfig.D1DENLPF.js → resolveConfig.DPmbhVlP.js} +2610 -2574
- package/dist/chunks/{rpc.B7Mfb-Yf.js → rpc.C3q9uwRX.js} +2 -2
- package/dist/chunks/{run-once.Sxe67Wng.js → run-once.2ogXb3JV.js} +1 -1
- package/dist/chunks/{runBaseTests.D-Gcin7G.js → runBaseTests.Dm-659zB.js} +21 -25
- package/dist/chunks/{setup-common.DF96bIYE.js → setup-common.DDmVKp6O.js} +3 -3
- package/dist/chunks/{suite.BMWOKiTe.d.ts → suite.B2jumIFP.d.ts} +2 -2
- package/dist/chunks/{utils.CY6Spixo.js → utils.BB4zjzR8.js} +2 -2
- package/dist/chunks/utils.C8RiOc4B.js +77 -0
- package/dist/chunks/{vi.DUs2eKik.js → vi.JMQoNY_Z.js} +94 -139
- package/dist/chunks/{vite.8fk186v-.d.ts → vite.BdBj-UWY.d.ts} +1 -1
- package/dist/chunks/{vm.CPXwWp4C.js → vm.jpyrB0xy.js} +5 -8
- package/dist/chunks/{worker.Chrs-_NL.d.ts → worker.BAlI9hII.d.ts} +50 -27
- package/dist/chunks/{worker.Qtv8v5nL.d.ts → worker.DHnGaO2M.d.ts} +1 -1
- package/dist/cli.js +3 -4
- package/dist/config.cjs +4 -4
- package/dist/config.d.ts +24 -19
- package/dist/config.js +4 -4
- package/dist/coverage.d.ts +72 -35
- package/dist/coverage.js +256 -118
- package/dist/environments.d.ts +2 -2
- package/dist/environments.js +1 -1
- package/dist/execute.d.ts +53 -53
- package/dist/execute.js +7 -6
- package/dist/index.d.ts +92 -1099
- package/dist/index.js +7 -18
- package/dist/node.d.ts +43 -41
- package/dist/node.js +23 -28
- package/dist/path.js +1 -1
- package/dist/reporters.d.ts +10 -10
- package/dist/reporters.js +12 -18
- package/dist/runners.d.ts +12 -19
- package/dist/runners.js +142 -148
- package/dist/snapshot.js +2 -6
- package/dist/suite.d.ts +2 -2
- package/dist/suite.js +2 -6
- package/dist/worker.js +5 -6
- package/dist/workers/forks.js +9 -8
- package/dist/workers/runVmTests.js +16 -20
- package/dist/workers/threads.js +9 -8
- package/dist/workers/vmForks.js +9 -12
- package/dist/workers/vmThreads.js +9 -12
- package/dist/workers.d.ts +13 -13
- package/dist/workers.js +14 -18
- package/package.json +27 -27
- package/dist/chunks/base.DwXGwWst.js +0 -89
- package/dist/chunks/env.CmHVDJnw.js +0 -7
- package/dist/chunks/index.CxRxs566.js +0 -23
- package/dist/chunks/index.mAqbj9F9.js +0 -140
- package/dist/chunks/tasks.BZnCS9aT.js +0 -18
- package/dist/chunks/utils.Ck2hJTRs.js +0 -23
- package/dist/chunks/{environment.CzISCQ7o.d.ts → environment.LoooBwUu.d.ts} +24 -24
- package/dist/chunks/{index.lVXYBqEP.js → index.BMoXz_-n.js} +186 -186
package/dist/runners.js
CHANGED
|
@@ -1,25 +1,153 @@
|
|
|
1
|
-
import { setState, GLOBAL_EXPECT, getState } from '@vitest/expect';
|
|
2
|
-
import { g as getSnapshotClient, c as createExpect, v as vi } from './chunks/vi.DUs2eKik.js';
|
|
3
|
-
import 'pathe';
|
|
4
|
-
import { g as getTestName } from './chunks/tasks.BZnCS9aT.js';
|
|
5
|
-
import { createDefer, getSafeTimers } from '@vitest/utils';
|
|
6
|
-
import { g as getWorkerState } from './chunks/utils.Ck2hJTRs.js';
|
|
7
|
-
import './chunks/env.CmHVDJnw.js';
|
|
8
|
-
import { r as rpc } from './chunks/rpc.B7Mfb-Yf.js';
|
|
9
|
-
import { getTests, getNames } from '@vitest/runner/utils';
|
|
10
1
|
import { updateTask } from '@vitest/runner';
|
|
11
|
-
import {
|
|
2
|
+
import { createDefer, getSafeTimers } from '@vitest/utils';
|
|
3
|
+
import { a as getBenchOptions, g as getBenchFn } from './chunks/benchmark.Cdu9hjj4.js';
|
|
4
|
+
import { g as getWorkerState } from './chunks/utils.C8RiOc4B.js';
|
|
5
|
+
import { setState, GLOBAL_EXPECT, getState } from '@vitest/expect';
|
|
6
|
+
import { getTests, getNames, getTestName } from '@vitest/runner/utils';
|
|
7
|
+
import { g as getSnapshotClient, c as createExpect, v as vi } from './chunks/vi.JMQoNY_Z.js';
|
|
8
|
+
import { r as rpc } from './chunks/rpc.C3q9uwRX.js';
|
|
12
9
|
import 'chai';
|
|
13
10
|
import './chunks/_commonjsHelpers.BFTU3MAI.js';
|
|
14
11
|
import '@vitest/snapshot';
|
|
15
12
|
import '@vitest/utils/error';
|
|
16
13
|
import '@vitest/utils/source-map';
|
|
17
|
-
import './chunks/base.DwXGwWst.js';
|
|
18
14
|
import './chunks/date.W2xKR2qe.js';
|
|
19
15
|
import '@vitest/spy';
|
|
20
|
-
import '
|
|
21
|
-
|
|
22
|
-
|
|
16
|
+
import './chunks/index.68735LiX.js';
|
|
17
|
+
|
|
18
|
+
function createBenchmarkResult(name) {
|
|
19
|
+
return {
|
|
20
|
+
name,
|
|
21
|
+
rank: 0,
|
|
22
|
+
rme: 0,
|
|
23
|
+
samples: []
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
const benchmarkTasks = /* @__PURE__ */ new WeakMap();
|
|
27
|
+
async function runBenchmarkSuite(suite, runner) {
|
|
28
|
+
const { Task, Bench } = await runner.importTinybench();
|
|
29
|
+
const start = performance.now();
|
|
30
|
+
const benchmarkGroup = [];
|
|
31
|
+
const benchmarkSuiteGroup = [];
|
|
32
|
+
for (const task of suite.tasks) {
|
|
33
|
+
if (task.mode !== "run") {
|
|
34
|
+
continue;
|
|
35
|
+
}
|
|
36
|
+
if (task.meta?.benchmark) {
|
|
37
|
+
benchmarkGroup.push(task);
|
|
38
|
+
} else if (task.type === "suite") {
|
|
39
|
+
benchmarkSuiteGroup.push(task);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
for (const subSuite of benchmarkSuiteGroup) {
|
|
43
|
+
await runBenchmarkSuite(subSuite, runner);
|
|
44
|
+
}
|
|
45
|
+
if (benchmarkGroup.length) {
|
|
46
|
+
const defer = createDefer();
|
|
47
|
+
suite.result = {
|
|
48
|
+
state: "run",
|
|
49
|
+
startTime: start,
|
|
50
|
+
benchmark: createBenchmarkResult(suite.name)
|
|
51
|
+
};
|
|
52
|
+
updateTask$1(suite);
|
|
53
|
+
const addBenchTaskListener = (task, benchmark) => {
|
|
54
|
+
task.addEventListener(
|
|
55
|
+
"complete",
|
|
56
|
+
(e) => {
|
|
57
|
+
const task2 = e.task;
|
|
58
|
+
const taskRes = task2.result;
|
|
59
|
+
const result = benchmark.result.benchmark;
|
|
60
|
+
Object.assign(result, taskRes);
|
|
61
|
+
const samples = result.samples;
|
|
62
|
+
result.sampleCount = samples.length;
|
|
63
|
+
result.median = samples.length % 2 ? samples[Math.floor(samples.length / 2)] : (samples[samples.length / 2] + samples[samples.length / 2 - 1]) / 2;
|
|
64
|
+
if (!runner.config.benchmark?.includeSamples) {
|
|
65
|
+
result.samples.length = 0;
|
|
66
|
+
}
|
|
67
|
+
updateTask$1(benchmark);
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
once: true
|
|
71
|
+
}
|
|
72
|
+
);
|
|
73
|
+
task.addEventListener(
|
|
74
|
+
"error",
|
|
75
|
+
(e) => {
|
|
76
|
+
const task2 = e.task;
|
|
77
|
+
defer.reject(benchmark ? task2.result.error : e);
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
once: true
|
|
81
|
+
}
|
|
82
|
+
);
|
|
83
|
+
};
|
|
84
|
+
benchmarkGroup.forEach((benchmark) => {
|
|
85
|
+
const options = getBenchOptions(benchmark);
|
|
86
|
+
const benchmarkInstance = new Bench(options);
|
|
87
|
+
const benchmarkFn = getBenchFn(benchmark);
|
|
88
|
+
benchmark.result = {
|
|
89
|
+
state: "run",
|
|
90
|
+
startTime: start,
|
|
91
|
+
benchmark: createBenchmarkResult(benchmark.name)
|
|
92
|
+
};
|
|
93
|
+
const task = new Task(benchmarkInstance, benchmark.name, benchmarkFn);
|
|
94
|
+
benchmarkTasks.set(benchmark, task);
|
|
95
|
+
addBenchTaskListener(task, benchmark);
|
|
96
|
+
updateTask$1(benchmark);
|
|
97
|
+
});
|
|
98
|
+
const { setTimeout } = getSafeTimers();
|
|
99
|
+
const tasks = [];
|
|
100
|
+
for (const benchmark of benchmarkGroup) {
|
|
101
|
+
const task = benchmarkTasks.get(benchmark);
|
|
102
|
+
await task.warmup();
|
|
103
|
+
tasks.push([
|
|
104
|
+
await new Promise(
|
|
105
|
+
(resolve) => setTimeout(async () => {
|
|
106
|
+
resolve(await task.run());
|
|
107
|
+
})
|
|
108
|
+
),
|
|
109
|
+
benchmark
|
|
110
|
+
]);
|
|
111
|
+
}
|
|
112
|
+
suite.result.duration = performance.now() - start;
|
|
113
|
+
suite.result.state = "pass";
|
|
114
|
+
tasks.sort(([taskA], [taskB]) => taskA.result.mean - taskB.result.mean).forEach(([, benchmark], idx) => {
|
|
115
|
+
benchmark.result.state = "pass";
|
|
116
|
+
if (benchmark) {
|
|
117
|
+
const result = benchmark.result.benchmark;
|
|
118
|
+
result.rank = Number(idx) + 1;
|
|
119
|
+
updateTask$1(benchmark);
|
|
120
|
+
}
|
|
121
|
+
});
|
|
122
|
+
updateTask$1(suite);
|
|
123
|
+
defer.resolve(null);
|
|
124
|
+
await defer;
|
|
125
|
+
}
|
|
126
|
+
function updateTask$1(task) {
|
|
127
|
+
updateTask(task, runner);
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
class NodeBenchmarkRunner {
|
|
131
|
+
constructor(config) {
|
|
132
|
+
this.config = config;
|
|
133
|
+
}
|
|
134
|
+
__vitest_executor;
|
|
135
|
+
async importTinybench() {
|
|
136
|
+
return await import('tinybench');
|
|
137
|
+
}
|
|
138
|
+
importFile(filepath, source) {
|
|
139
|
+
if (source === "setup") {
|
|
140
|
+
getWorkerState().moduleCache.delete(filepath);
|
|
141
|
+
}
|
|
142
|
+
return this.__vitest_executor.executeId(filepath);
|
|
143
|
+
}
|
|
144
|
+
async runSuite(suite) {
|
|
145
|
+
await runBenchmarkSuite(suite, this);
|
|
146
|
+
}
|
|
147
|
+
async runTask() {
|
|
148
|
+
throw new Error("`test()` and `it()` is only available in test mode.");
|
|
149
|
+
}
|
|
150
|
+
}
|
|
23
151
|
|
|
24
152
|
class VitestTestRunner {
|
|
25
153
|
constructor(config) {
|
|
@@ -171,138 +299,4 @@ function clearModuleMocks(config) {
|
|
|
171
299
|
}
|
|
172
300
|
}
|
|
173
301
|
|
|
174
|
-
function createBenchmarkResult(name) {
|
|
175
|
-
return {
|
|
176
|
-
name,
|
|
177
|
-
rank: 0,
|
|
178
|
-
rme: 0,
|
|
179
|
-
samples: []
|
|
180
|
-
};
|
|
181
|
-
}
|
|
182
|
-
const benchmarkTasks = /* @__PURE__ */ new WeakMap();
|
|
183
|
-
async function runBenchmarkSuite(suite, runner) {
|
|
184
|
-
const { Task, Bench } = await runner.importTinybench();
|
|
185
|
-
const start = performance.now();
|
|
186
|
-
const benchmarkGroup = [];
|
|
187
|
-
const benchmarkSuiteGroup = [];
|
|
188
|
-
for (const task of suite.tasks) {
|
|
189
|
-
if (task.mode !== "run") {
|
|
190
|
-
continue;
|
|
191
|
-
}
|
|
192
|
-
if (task.meta?.benchmark) {
|
|
193
|
-
benchmarkGroup.push(task);
|
|
194
|
-
} else if (task.type === "suite") {
|
|
195
|
-
benchmarkSuiteGroup.push(task);
|
|
196
|
-
}
|
|
197
|
-
}
|
|
198
|
-
for (const subSuite of benchmarkSuiteGroup) {
|
|
199
|
-
await runBenchmarkSuite(subSuite, runner);
|
|
200
|
-
}
|
|
201
|
-
if (benchmarkGroup.length) {
|
|
202
|
-
const defer = createDefer();
|
|
203
|
-
suite.result = {
|
|
204
|
-
state: "run",
|
|
205
|
-
startTime: start,
|
|
206
|
-
benchmark: createBenchmarkResult(suite.name)
|
|
207
|
-
};
|
|
208
|
-
updateTask$1(suite);
|
|
209
|
-
const addBenchTaskListener = (task, benchmark) => {
|
|
210
|
-
task.addEventListener(
|
|
211
|
-
"complete",
|
|
212
|
-
(e) => {
|
|
213
|
-
const task2 = e.task;
|
|
214
|
-
const taskRes = task2.result;
|
|
215
|
-
const result = benchmark.result.benchmark;
|
|
216
|
-
Object.assign(result, taskRes);
|
|
217
|
-
const samples = result.samples;
|
|
218
|
-
result.sampleCount = samples.length;
|
|
219
|
-
result.median = samples.length % 2 ? samples[Math.floor(samples.length / 2)] : (samples[samples.length / 2] + samples[samples.length / 2 - 1]) / 2;
|
|
220
|
-
if (!runner.config.benchmark?.includeSamples) {
|
|
221
|
-
result.samples.length = 0;
|
|
222
|
-
}
|
|
223
|
-
updateTask$1(benchmark);
|
|
224
|
-
},
|
|
225
|
-
{
|
|
226
|
-
once: true
|
|
227
|
-
}
|
|
228
|
-
);
|
|
229
|
-
task.addEventListener(
|
|
230
|
-
"error",
|
|
231
|
-
(e) => {
|
|
232
|
-
const task2 = e.task;
|
|
233
|
-
defer.reject(benchmark ? task2.result.error : e);
|
|
234
|
-
},
|
|
235
|
-
{
|
|
236
|
-
once: true
|
|
237
|
-
}
|
|
238
|
-
);
|
|
239
|
-
};
|
|
240
|
-
benchmarkGroup.forEach((benchmark) => {
|
|
241
|
-
const options = getBenchOptions(benchmark);
|
|
242
|
-
const benchmarkInstance = new Bench(options);
|
|
243
|
-
const benchmarkFn = getBenchFn(benchmark);
|
|
244
|
-
benchmark.result = {
|
|
245
|
-
state: "run",
|
|
246
|
-
startTime: start,
|
|
247
|
-
benchmark: createBenchmarkResult(benchmark.name)
|
|
248
|
-
};
|
|
249
|
-
const task = new Task(benchmarkInstance, benchmark.name, benchmarkFn);
|
|
250
|
-
benchmarkTasks.set(benchmark, task);
|
|
251
|
-
addBenchTaskListener(task, benchmark);
|
|
252
|
-
updateTask$1(benchmark);
|
|
253
|
-
});
|
|
254
|
-
const { setTimeout } = getSafeTimers();
|
|
255
|
-
const tasks = [];
|
|
256
|
-
for (const benchmark of benchmarkGroup) {
|
|
257
|
-
const task = benchmarkTasks.get(benchmark);
|
|
258
|
-
await task.warmup();
|
|
259
|
-
tasks.push([
|
|
260
|
-
await new Promise(
|
|
261
|
-
(resolve) => setTimeout(async () => {
|
|
262
|
-
resolve(await task.run());
|
|
263
|
-
})
|
|
264
|
-
),
|
|
265
|
-
benchmark
|
|
266
|
-
]);
|
|
267
|
-
}
|
|
268
|
-
suite.result.duration = performance.now() - start;
|
|
269
|
-
suite.result.state = "pass";
|
|
270
|
-
tasks.sort(([taskA], [taskB]) => taskA.result.mean - taskB.result.mean).forEach(([, benchmark], idx) => {
|
|
271
|
-
benchmark.result.state = "pass";
|
|
272
|
-
if (benchmark) {
|
|
273
|
-
const result = benchmark.result.benchmark;
|
|
274
|
-
result.rank = Number(idx) + 1;
|
|
275
|
-
updateTask$1(benchmark);
|
|
276
|
-
}
|
|
277
|
-
});
|
|
278
|
-
updateTask$1(suite);
|
|
279
|
-
defer.resolve(null);
|
|
280
|
-
await defer;
|
|
281
|
-
}
|
|
282
|
-
function updateTask$1(task) {
|
|
283
|
-
updateTask(task, runner);
|
|
284
|
-
}
|
|
285
|
-
}
|
|
286
|
-
class NodeBenchmarkRunner {
|
|
287
|
-
constructor(config) {
|
|
288
|
-
this.config = config;
|
|
289
|
-
}
|
|
290
|
-
__vitest_executor;
|
|
291
|
-
async importTinybench() {
|
|
292
|
-
return await import('tinybench');
|
|
293
|
-
}
|
|
294
|
-
importFile(filepath, source) {
|
|
295
|
-
if (source === "setup") {
|
|
296
|
-
getWorkerState().moduleCache.delete(filepath);
|
|
297
|
-
}
|
|
298
|
-
return this.__vitest_executor.executeId(filepath);
|
|
299
|
-
}
|
|
300
|
-
async runSuite(suite) {
|
|
301
|
-
await runBenchmarkSuite(suite, this);
|
|
302
|
-
}
|
|
303
|
-
async runTask() {
|
|
304
|
-
throw new Error("`test()` and `it()` is only available in test mode.");
|
|
305
|
-
}
|
|
306
|
-
}
|
|
307
|
-
|
|
308
302
|
export { NodeBenchmarkRunner, VitestTestRunner };
|
package/dist/snapshot.js
CHANGED
|
@@ -1,8 +1,4 @@
|
|
|
1
|
-
export { VitestNodeSnapshotEnvironment as VitestSnapshotEnvironment } from './chunks/node.
|
|
1
|
+
export { VitestNodeSnapshotEnvironment as VitestSnapshotEnvironment } from './chunks/node.AKq966Jp.js';
|
|
2
2
|
import '@vitest/snapshot/environment';
|
|
3
|
-
import '
|
|
4
|
-
import '@vitest/runner/utils';
|
|
3
|
+
import './chunks/utils.C8RiOc4B.js';
|
|
5
4
|
import '@vitest/utils';
|
|
6
|
-
import './chunks/utils.Ck2hJTRs.js';
|
|
7
|
-
import './chunks/env.CmHVDJnw.js';
|
|
8
|
-
import 'std-env';
|
package/dist/suite.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
+
export { g as getBenchFn, a as getBenchOptions } from './chunks/suite.B2jumIFP.js';
|
|
1
2
|
export { createTaskCollector, getCurrentSuite, getCurrentTest, getFn, getHooks, setFn, setHooks } from '@vitest/runner';
|
|
2
3
|
export { createChainable } from '@vitest/runner/utils';
|
|
3
|
-
|
|
4
|
-
import './chunks/benchmark.JVlTzojj.js';
|
|
4
|
+
import './chunks/benchmark.geERunq4.js';
|
|
5
5
|
import 'tinybench';
|
package/dist/suite.js
CHANGED
|
@@ -1,9 +1,5 @@
|
|
|
1
|
+
export { g as getBenchFn, a as getBenchOptions } from './chunks/benchmark.Cdu9hjj4.js';
|
|
1
2
|
export { createTaskCollector, getCurrentSuite, getCurrentTest, getFn, getHooks, setFn, setHooks } from '@vitest/runner';
|
|
2
3
|
export { createChainable } from '@vitest/runner/utils';
|
|
3
|
-
export { g as getBenchFn, a as getBenchOptions } from './chunks/benchmark.C8CRJYG4.js';
|
|
4
4
|
import '@vitest/utils';
|
|
5
|
-
import './chunks/
|
|
6
|
-
import 'pathe';
|
|
7
|
-
import './chunks/utils.Ck2hJTRs.js';
|
|
8
|
-
import './chunks/env.CmHVDJnw.js';
|
|
9
|
-
import 'std-env';
|
|
5
|
+
import './chunks/utils.C8RiOc4B.js';
|
package/dist/worker.js
CHANGED
|
@@ -3,16 +3,15 @@ import { workerId } from 'tinypool';
|
|
|
3
3
|
import { ViteNodeRunner, ModuleCacheMap } from 'vite-node/client';
|
|
4
4
|
import { readFileSync } from 'node:fs';
|
|
5
5
|
import { resolve, normalize } from 'pathe';
|
|
6
|
-
import { e as environments } from './chunks/index.
|
|
7
|
-
import { i as isChildProcess, s as setProcessTitle } from './chunks/base.DwXGwWst.js';
|
|
6
|
+
import { e as environments } from './chunks/index.BMoXz_-n.js';
|
|
8
7
|
import { s as setupInspect } from './chunks/inspector.70d6emsh.js';
|
|
9
|
-
import { c as createRuntimeRpc, a as rpcDone } from './chunks/rpc.
|
|
8
|
+
import { c as createRuntimeRpc, a as rpcDone } from './chunks/rpc.C3q9uwRX.js';
|
|
9
|
+
import { i as isChildProcess, s as setProcessTitle } from './chunks/utils.C8RiOc4B.js';
|
|
10
10
|
import { d as disposeInternalListeners } from './chunks/utils.Cn0zI1t3.js';
|
|
11
11
|
import 'node:console';
|
|
12
|
-
import '@vitest/utils';
|
|
13
12
|
import 'node:module';
|
|
14
|
-
import '
|
|
15
|
-
import './chunks/
|
|
13
|
+
import '@vitest/utils';
|
|
14
|
+
import './chunks/index.68735LiX.js';
|
|
16
15
|
|
|
17
16
|
function isBuiltinEnvironment(env) {
|
|
18
17
|
return env in environments;
|
package/dist/workers/forks.js
CHANGED
|
@@ -1,19 +1,20 @@
|
|
|
1
1
|
import v8 from 'node:v8';
|
|
2
|
+
import { r as runBaseTests } from '../chunks/base.C3xNdjV6.js';
|
|
2
3
|
import { c as createForksRpcOptions, u as unwrapSerializableConfig } from '../chunks/utils.Cn0zI1t3.js';
|
|
3
|
-
import { r as runBaseTests } from '../chunks/base.tiemDJX6.js';
|
|
4
|
-
import '@vitest/utils';
|
|
5
4
|
import 'vite-node/client';
|
|
6
|
-
import '../chunks/
|
|
7
|
-
import '../chunks/execute._eQQfgI8.js';
|
|
8
|
-
import 'node:vm';
|
|
9
|
-
import 'node:url';
|
|
5
|
+
import '../chunks/execute.2pr0rHgK.js';
|
|
10
6
|
import 'node:fs';
|
|
11
|
-
import '
|
|
12
|
-
import '
|
|
7
|
+
import 'node:url';
|
|
8
|
+
import 'node:vm';
|
|
13
9
|
import '@vitest/utils/error';
|
|
10
|
+
import 'pathe';
|
|
11
|
+
import 'vite-node/utils';
|
|
14
12
|
import '../path.js';
|
|
13
|
+
import 'node:path';
|
|
15
14
|
import '@vitest/mocker';
|
|
16
15
|
import 'node:module';
|
|
16
|
+
import '@vitest/utils';
|
|
17
|
+
import '../chunks/utils.C8RiOc4B.js';
|
|
17
18
|
|
|
18
19
|
class ForksBaseWorker {
|
|
19
20
|
getRpcOptions() {
|
|
@@ -1,39 +1,35 @@
|
|
|
1
1
|
import { createRequire } from 'node:module';
|
|
2
|
-
import util from 'node:util';
|
|
3
|
-
import timers from 'node:timers';
|
|
4
2
|
import { performance } from 'node:perf_hooks';
|
|
3
|
+
import timers from 'node:timers';
|
|
4
|
+
import util from 'node:util';
|
|
5
5
|
import { startTests, collectTests } from '@vitest/runner';
|
|
6
|
-
import { installSourcemapsSupport } from 'vite-node/source-map';
|
|
7
6
|
import { KNOWN_ASSET_TYPES } from 'vite-node/constants';
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import { s as setupCommonEnv } from '../chunks/setup-common.DF96bIYE.js';
|
|
7
|
+
import { installSourcemapsSupport } from 'vite-node/source-map';
|
|
8
|
+
import { s as setupChaiConfig, r as resolveTestRunner, a as resolveSnapshotEnvironment } from '../chunks/index.D3d79vc8.js';
|
|
9
|
+
import { s as startCoverageInsideWorker, a as stopCoverageInsideWorker } from '../chunks/coverage.BoMDb1ip.js';
|
|
10
|
+
import { V as VitestIndex } from '../chunks/index.Dqe5k2Rk.js';
|
|
13
11
|
import { c as closeInspector } from '../chunks/inspector.70d6emsh.js';
|
|
12
|
+
import { s as setupCommonEnv } from '../chunks/setup-common.DDmVKp6O.js';
|
|
13
|
+
import { g as getWorkerState } from '../chunks/utils.C8RiOc4B.js';
|
|
14
14
|
import 'chai';
|
|
15
|
-
import '
|
|
15
|
+
import 'node:path';
|
|
16
16
|
import '../path.js';
|
|
17
17
|
import 'node:url';
|
|
18
|
-
import '../chunks/rpc.
|
|
18
|
+
import '../chunks/rpc.C3q9uwRX.js';
|
|
19
19
|
import '@vitest/utils';
|
|
20
|
-
import '../chunks/index.
|
|
21
|
-
import '../chunks/
|
|
20
|
+
import '../chunks/index.68735LiX.js';
|
|
21
|
+
import '../chunks/vi.JMQoNY_Z.js';
|
|
22
|
+
import '@vitest/expect';
|
|
22
23
|
import '@vitest/runner/utils';
|
|
23
|
-
import '../chunks/index.CxRxs566.js';
|
|
24
|
-
import '../chunks/env.CmHVDJnw.js';
|
|
25
|
-
import 'std-env';
|
|
26
|
-
import '../chunks/run-once.Sxe67Wng.js';
|
|
27
|
-
import '../chunks/vi.DUs2eKik.js';
|
|
28
24
|
import '../chunks/_commonjsHelpers.BFTU3MAI.js';
|
|
29
|
-
import '@vitest/expect';
|
|
30
25
|
import '@vitest/snapshot';
|
|
31
26
|
import '@vitest/utils/error';
|
|
32
|
-
import '../chunks/tasks.BZnCS9aT.js';
|
|
33
27
|
import '@vitest/utils/source-map';
|
|
34
|
-
import '../chunks/base.DwXGwWst.js';
|
|
35
28
|
import '../chunks/date.W2xKR2qe.js';
|
|
36
29
|
import '@vitest/spy';
|
|
30
|
+
import '../chunks/run-once.2ogXb3JV.js';
|
|
31
|
+
import '../chunks/benchmark.Cdu9hjj4.js';
|
|
32
|
+
import 'expect-type';
|
|
37
33
|
|
|
38
34
|
async function run(method, files, config, executor) {
|
|
39
35
|
const workerState = getWorkerState();
|
package/dist/workers/threads.js
CHANGED
|
@@ -1,18 +1,19 @@
|
|
|
1
|
-
import { r as runBaseTests } from '../chunks/base.
|
|
1
|
+
import { r as runBaseTests } from '../chunks/base.C3xNdjV6.js';
|
|
2
2
|
import { a as createThreadsRpcOptions } from '../chunks/utils.Cn0zI1t3.js';
|
|
3
3
|
import 'vite-node/client';
|
|
4
|
-
import '../chunks/
|
|
5
|
-
import '../chunks/execute._eQQfgI8.js';
|
|
6
|
-
import 'node:vm';
|
|
7
|
-
import 'node:url';
|
|
4
|
+
import '../chunks/execute.2pr0rHgK.js';
|
|
8
5
|
import 'node:fs';
|
|
9
|
-
import '
|
|
10
|
-
import '
|
|
6
|
+
import 'node:url';
|
|
7
|
+
import 'node:vm';
|
|
11
8
|
import '@vitest/utils/error';
|
|
9
|
+
import 'pathe';
|
|
10
|
+
import 'vite-node/utils';
|
|
12
11
|
import '../path.js';
|
|
13
|
-
import '
|
|
12
|
+
import 'node:path';
|
|
14
13
|
import '@vitest/mocker';
|
|
15
14
|
import 'node:module';
|
|
15
|
+
import '@vitest/utils';
|
|
16
|
+
import '../chunks/utils.C8RiOc4B.js';
|
|
16
17
|
|
|
17
18
|
class ThreadsBaseWorker {
|
|
18
19
|
getRpcOptions(ctx) {
|
package/dist/workers/vmForks.js
CHANGED
|
@@ -1,26 +1,23 @@
|
|
|
1
1
|
import v8 from 'node:v8';
|
|
2
2
|
import { c as createForksRpcOptions, u as unwrapSerializableConfig } from '../chunks/utils.Cn0zI1t3.js';
|
|
3
|
-
import { r as runVmTests } from '../chunks/vm.
|
|
3
|
+
import { r as runVmTests } from '../chunks/vm.jpyrB0xy.js';
|
|
4
4
|
import '@vitest/utils';
|
|
5
|
-
import 'node:vm';
|
|
6
5
|
import 'node:url';
|
|
6
|
+
import 'node:vm';
|
|
7
7
|
import 'pathe';
|
|
8
|
-
import '../
|
|
9
|
-
import 'node:stream';
|
|
10
|
-
import 'node:console';
|
|
8
|
+
import '../path.js';
|
|
11
9
|
import 'node:path';
|
|
10
|
+
import '../chunks/console.BYGVloWk.js';
|
|
11
|
+
import 'node:console';
|
|
12
|
+
import 'node:stream';
|
|
12
13
|
import 'tinyrainbow';
|
|
13
14
|
import '../chunks/date.W2xKR2qe.js';
|
|
14
|
-
import '
|
|
15
|
-
import '../chunks/
|
|
16
|
-
import '../chunks/env.CmHVDJnw.js';
|
|
17
|
-
import 'std-env';
|
|
18
|
-
import '../chunks/execute._eQQfgI8.js';
|
|
15
|
+
import '../chunks/utils.C8RiOc4B.js';
|
|
16
|
+
import '../chunks/execute.2pr0rHgK.js';
|
|
19
17
|
import 'node:fs';
|
|
18
|
+
import '@vitest/utils/error';
|
|
20
19
|
import 'vite-node/client';
|
|
21
20
|
import 'vite-node/utils';
|
|
22
|
-
import '@vitest/utils/error';
|
|
23
|
-
import '../path.js';
|
|
24
21
|
import '@vitest/mocker';
|
|
25
22
|
import 'node:module';
|
|
26
23
|
import 'vite-node/constants';
|
|
@@ -1,25 +1,22 @@
|
|
|
1
1
|
import { a as createThreadsRpcOptions } from '../chunks/utils.Cn0zI1t3.js';
|
|
2
|
-
import { r as runVmTests } from '../chunks/vm.
|
|
2
|
+
import { r as runVmTests } from '../chunks/vm.jpyrB0xy.js';
|
|
3
3
|
import '@vitest/utils';
|
|
4
|
-
import 'node:vm';
|
|
5
4
|
import 'node:url';
|
|
5
|
+
import 'node:vm';
|
|
6
6
|
import 'pathe';
|
|
7
|
-
import '../
|
|
8
|
-
import 'node:stream';
|
|
9
|
-
import 'node:console';
|
|
7
|
+
import '../path.js';
|
|
10
8
|
import 'node:path';
|
|
9
|
+
import '../chunks/console.BYGVloWk.js';
|
|
10
|
+
import 'node:console';
|
|
11
|
+
import 'node:stream';
|
|
11
12
|
import 'tinyrainbow';
|
|
12
13
|
import '../chunks/date.W2xKR2qe.js';
|
|
13
|
-
import '
|
|
14
|
-
import '../chunks/
|
|
15
|
-
import '../chunks/env.CmHVDJnw.js';
|
|
16
|
-
import 'std-env';
|
|
17
|
-
import '../chunks/execute._eQQfgI8.js';
|
|
14
|
+
import '../chunks/utils.C8RiOc4B.js';
|
|
15
|
+
import '../chunks/execute.2pr0rHgK.js';
|
|
18
16
|
import 'node:fs';
|
|
17
|
+
import '@vitest/utils/error';
|
|
19
18
|
import 'vite-node/client';
|
|
20
19
|
import 'vite-node/utils';
|
|
21
|
-
import '@vitest/utils/error';
|
|
22
|
-
import '../path.js';
|
|
23
20
|
import '@vitest/mocker';
|
|
24
21
|
import 'node:module';
|
|
25
22
|
import 'vite-node/constants';
|
package/dist/workers.d.ts
CHANGED
|
@@ -1,15 +1,22 @@
|
|
|
1
|
+
import { W as WorkerGlobalState, C as ContextRPC, B as BirpcOptions, R as RuntimeRPC } from './chunks/worker.BAlI9hII.js';
|
|
2
|
+
import { Awaitable } from '@vitest/utils';
|
|
1
3
|
import * as v8 from 'v8';
|
|
2
4
|
import { S as SerializedConfig } from './chunks/config.Crbj2GAb.js';
|
|
3
|
-
import { W as WorkerContext } from './chunks/worker.
|
|
4
|
-
import { B as BirpcOptions, R as RuntimeRPC, C as ContextRPC, W as WorkerGlobalState } from './chunks/worker.Chrs-_NL.js';
|
|
5
|
-
import { Awaitable } from '@vitest/utils';
|
|
6
|
-
import '@vitest/pretty-format';
|
|
5
|
+
import { W as WorkerContext } from './chunks/worker.DHnGaO2M.js';
|
|
7
6
|
import '@vitest/runner';
|
|
7
|
+
import 'vite-node';
|
|
8
|
+
import './chunks/environment.LoooBwUu.js';
|
|
8
9
|
import '@vitest/snapshot';
|
|
10
|
+
import '@vitest/pretty-format';
|
|
9
11
|
import '@vitest/snapshot/environment';
|
|
10
12
|
import 'node:worker_threads';
|
|
11
|
-
|
|
12
|
-
|
|
13
|
+
|
|
14
|
+
declare function provideWorkerState(context: any, state: WorkerGlobalState): WorkerGlobalState;
|
|
15
|
+
|
|
16
|
+
declare function run(ctx: ContextRPC): Promise<void>;
|
|
17
|
+
declare function collect(ctx: ContextRPC): Promise<void>;
|
|
18
|
+
|
|
19
|
+
declare function runBaseTests(method: 'run' | 'collect', state: WorkerGlobalState): Promise<void>;
|
|
13
20
|
|
|
14
21
|
type WorkerRpcOptions = Pick<BirpcOptions<RuntimeRPC>, 'on' | 'post' | 'serialize' | 'deserialize'>;
|
|
15
22
|
interface VitestWorker {
|
|
@@ -25,13 +32,6 @@ declare function createForksRpcOptions(nodeV8: typeof v8): WorkerRpcOptions;
|
|
|
25
32
|
*/
|
|
26
33
|
declare function unwrapSerializableConfig(config: SerializedConfig): SerializedConfig;
|
|
27
34
|
|
|
28
|
-
declare function provideWorkerState(context: any, state: WorkerGlobalState): WorkerGlobalState;
|
|
29
|
-
|
|
30
|
-
declare function run(ctx: ContextRPC): Promise<void>;
|
|
31
|
-
declare function collect(ctx: ContextRPC): Promise<void>;
|
|
32
|
-
|
|
33
35
|
declare function runVmTests(method: 'run' | 'collect', state: WorkerGlobalState): Promise<void>;
|
|
34
36
|
|
|
35
|
-
declare function runBaseTests(method: 'run' | 'collect', state: WorkerGlobalState): Promise<void>;
|
|
36
|
-
|
|
37
37
|
export { type VitestWorker, type WorkerRpcOptions, collect as collectVitestWorkerTests, createForksRpcOptions, createThreadsRpcOptions, provideWorkerState, runBaseTests, run as runVitestWorker, runVmTests, unwrapSerializableConfig };
|
package/dist/workers.js
CHANGED
|
@@ -1,33 +1,29 @@
|
|
|
1
|
-
export {
|
|
2
|
-
export { p as provideWorkerState } from './chunks/utils.Ck2hJTRs.js';
|
|
1
|
+
export { p as provideWorkerState } from './chunks/utils.C8RiOc4B.js';
|
|
3
2
|
export { collect as collectVitestWorkerTests, run as runVitestWorker } from './worker.js';
|
|
4
|
-
export { r as
|
|
5
|
-
export {
|
|
3
|
+
export { r as runBaseTests } from './chunks/base.C3xNdjV6.js';
|
|
4
|
+
export { c as createForksRpcOptions, a as createThreadsRpcOptions, u as unwrapSerializableConfig } from './chunks/utils.Cn0zI1t3.js';
|
|
5
|
+
export { r as runVmTests } from './chunks/vm.jpyrB0xy.js';
|
|
6
6
|
import '@vitest/utils';
|
|
7
7
|
import 'node:url';
|
|
8
8
|
import 'tinypool';
|
|
9
9
|
import 'vite-node/client';
|
|
10
10
|
import 'node:fs';
|
|
11
11
|
import 'pathe';
|
|
12
|
-
import './chunks/index.
|
|
12
|
+
import './chunks/index.BMoXz_-n.js';
|
|
13
13
|
import 'node:console';
|
|
14
|
-
import './chunks/base.DwXGwWst.js';
|
|
15
14
|
import './chunks/inspector.70d6emsh.js';
|
|
16
15
|
import 'node:module';
|
|
17
|
-
import './chunks/rpc.
|
|
18
|
-
import './chunks/index.
|
|
16
|
+
import './chunks/rpc.C3q9uwRX.js';
|
|
17
|
+
import './chunks/index.68735LiX.js';
|
|
18
|
+
import './chunks/execute.2pr0rHgK.js';
|
|
19
19
|
import 'node:vm';
|
|
20
|
-
import './chunks/console.DI3gHgtH.js';
|
|
21
|
-
import 'node:stream';
|
|
22
|
-
import 'node:path';
|
|
23
|
-
import 'tinyrainbow';
|
|
24
|
-
import './chunks/date.W2xKR2qe.js';
|
|
25
|
-
import '@vitest/runner/utils';
|
|
26
|
-
import './chunks/env.CmHVDJnw.js';
|
|
27
|
-
import 'std-env';
|
|
28
|
-
import './chunks/execute._eQQfgI8.js';
|
|
29
|
-
import 'vite-node/utils';
|
|
30
20
|
import '@vitest/utils/error';
|
|
21
|
+
import 'vite-node/utils';
|
|
31
22
|
import './path.js';
|
|
23
|
+
import 'node:path';
|
|
32
24
|
import '@vitest/mocker';
|
|
25
|
+
import './chunks/console.BYGVloWk.js';
|
|
26
|
+
import 'node:stream';
|
|
27
|
+
import 'tinyrainbow';
|
|
28
|
+
import './chunks/date.W2xKR2qe.js';
|
|
33
29
|
import 'vite-node/constants';
|