vitest 4.0.8 → 4.0.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.
- package/dist/browser.d.ts +2 -2
- package/dist/browser.js +1 -1
- package/dist/chunks/_commonjsHelpers.D26ty3Ew.js +6 -0
- package/dist/chunks/{base.BgTO2qAg.js → base.BFVArrYW.js} +6 -6
- package/dist/chunks/{browser.d.DTTM2PTh.d.ts → browser.d.DnU_kh8a.d.ts} +1 -1
- package/dist/chunks/{cac.CfkWq8Qy.js → cac.D9CYcNPM.js} +7 -7
- package/dist/chunks/{cli-api.BQ-bjcRi.js → cli-api.RnIE1JbW.js} +65 -63
- package/dist/chunks/{coverage.NVjCOln1.js → coverage.BUlIqJrL.js} +11 -11
- package/dist/chunks/{creator.fzVyoMf3.js → creator.DU9qFjsW.js} +2 -2
- package/dist/chunks/{global.d.DVdCfKp5.d.ts → global.d.BQDgW9Pr.d.ts} +1 -1
- package/dist/chunks/{globals.DOh96BiR.js → globals.NLOzC_A5.js} +3 -3
- package/dist/chunks/{index.DAL392Ss.js → index.0kCJoeWi.js} +94 -75
- package/dist/chunks/{index.op2Re5rn.js → index.B8lJfb0J.js} +1 -1
- package/dist/chunks/{index.kotH7DY7.js → index.BYek7GgP.js} +5 -3
- package/dist/chunks/{index.Dc3xnDvT.js → index.D4KonVSU.js} +5 -5
- package/dist/chunks/{index.DIFZf73e.js → index.DZ-mI_Nm.js} +1 -1
- package/dist/chunks/{index.BY4-tcno.js → index.Dua7TZg_.js} +3 -3
- package/dist/chunks/{index.DfKyPFVi.js → index.QWbK7rHY.js} +9 -3
- package/dist/chunks/init-forks.BZSlxfwV.js +32 -0
- package/dist/chunks/{init-threads.Cm4OCIWA.js → init-threads.CwE2n-Bv.js} +1 -1
- package/dist/chunks/{init.DMDG-idf.js → init.Cz2kTB9a.js} +3 -3
- package/dist/chunks/{moduleRunner.d.CzOZ_4wC.d.ts → moduleRunner.d.BxT-OjLR.d.ts} +1 -1
- package/dist/chunks/{plugin.d.D4RrtywJ.d.ts → plugin.d.C6KrdvNG.d.ts} +1 -1
- package/dist/chunks/{reporters.d.Da1D1VbQ.d.ts → reporters.d.keG-yFSu.d.ts} +4 -3
- package/dist/chunks/{rpc.BUV7uWKJ.js → rpc.BytlcPfC.js} +1 -1
- package/dist/chunks/{setup-common.LGjNSzXp.js → setup-common.BOzbXE3x.js} +2 -2
- package/dist/chunks/{startModuleRunner.BOmUtLIO.js → startModuleRunner.DLjmA_wU.js} +9 -9
- package/dist/chunks/{test.ClrAtjMv.js → test.BPErLMrw.js} +2 -2
- package/dist/chunks/{vi.Bgcdy3bQ.js → vi.BiaV1qII.js} +8 -8
- package/dist/chunks/{vm.BIkCDs68.js → vm.wSHjz-et.js} +11 -11
- package/dist/chunks/{worker.d.DadbA89M.d.ts → worker.d.ZGohxCEd.d.ts} +44 -5
- package/dist/cli.js +2 -2
- package/dist/config.d.ts +5 -5
- package/dist/coverage.d.ts +3 -3
- package/dist/coverage.js +1 -1
- package/dist/environments.js +1 -1
- package/dist/index.d.ts +7 -7
- package/dist/index.js +3 -3
- package/dist/module-evaluator.d.ts +2 -2
- package/dist/module-evaluator.js +6 -6
- package/dist/module-runner.js +1 -1
- package/dist/node.d.ts +7 -7
- package/dist/node.js +12 -12
- package/dist/reporters.d.ts +3 -3
- package/dist/reporters.js +2 -2
- package/dist/runners.js +5 -5
- package/dist/worker.d.ts +1 -1
- package/dist/worker.js +12 -12
- package/dist/workers/forks.js +13 -14
- package/dist/workers/runVmTests.js +8 -8
- package/dist/workers/threads.js +13 -13
- package/dist/workers/vmForks.js +7 -8
- package/dist/workers/vmThreads.js +7 -7
- package/package.json +15 -15
- package/dist/chunks/_commonjsHelpers.BFTU3MAI.js +0 -7
- package/dist/chunks/init-forks.2hx7cf78.js +0 -65
package/dist/workers/threads.js
CHANGED
|
@@ -1,40 +1,40 @@
|
|
|
1
|
-
import { s as setupEnvironment, r as runBaseTests } from '../chunks/base.
|
|
2
|
-
import { w as workerInit } from '../chunks/init-threads.
|
|
1
|
+
import { s as setupEnvironment, r as runBaseTests } from '../chunks/base.BFVArrYW.js';
|
|
2
|
+
import { w as workerInit } from '../chunks/init-threads.CwE2n-Bv.js';
|
|
3
3
|
import 'node:vm';
|
|
4
4
|
import '@vitest/spy';
|
|
5
|
-
import '../chunks/index.
|
|
5
|
+
import '../chunks/index.Dua7TZg_.js';
|
|
6
6
|
import '@vitest/expect';
|
|
7
|
-
import '../chunks/setup-common.
|
|
7
|
+
import '../chunks/setup-common.BOzbXE3x.js';
|
|
8
8
|
import '../chunks/coverage.D_JHT54q.js';
|
|
9
9
|
import '@vitest/snapshot';
|
|
10
10
|
import '@vitest/utils/timers';
|
|
11
11
|
import '../chunks/utils.DvEY5TfP.js';
|
|
12
|
-
import '../chunks/rpc.
|
|
13
|
-
import '../chunks/index.
|
|
14
|
-
import '../chunks/test.
|
|
12
|
+
import '../chunks/rpc.BytlcPfC.js';
|
|
13
|
+
import '../chunks/index.0kCJoeWi.js';
|
|
14
|
+
import '../chunks/test.BPErLMrw.js';
|
|
15
15
|
import '@vitest/runner';
|
|
16
16
|
import '@vitest/utils/helpers';
|
|
17
17
|
import '../chunks/benchmark.B3N2zMcH.js';
|
|
18
18
|
import '@vitest/runner/utils';
|
|
19
19
|
import '@vitest/utils/error';
|
|
20
20
|
import 'pathe';
|
|
21
|
-
import '../chunks/vi.
|
|
21
|
+
import '../chunks/vi.BiaV1qII.js';
|
|
22
22
|
import '@vitest/utils/offset';
|
|
23
23
|
import '@vitest/utils/source-map';
|
|
24
|
-
import '../chunks/_commonjsHelpers.
|
|
24
|
+
import '../chunks/_commonjsHelpers.D26ty3Ew.js';
|
|
25
25
|
import '../chunks/date.Bq6ZW5rf.js';
|
|
26
|
-
import '../chunks/init.
|
|
26
|
+
import '../chunks/init.Cz2kTB9a.js';
|
|
27
27
|
import 'node:fs';
|
|
28
28
|
import 'node:module';
|
|
29
29
|
import 'node:url';
|
|
30
30
|
import 'vite/module-runner';
|
|
31
|
-
import '../chunks/startModuleRunner.
|
|
31
|
+
import '../chunks/startModuleRunner.DLjmA_wU.js';
|
|
32
32
|
import '../path.js';
|
|
33
33
|
import 'node:path';
|
|
34
34
|
import '@vitest/utils/serialize';
|
|
35
35
|
import '../module-evaluator.js';
|
|
36
36
|
import '@vitest/mocker';
|
|
37
|
-
import '../chunks/index.
|
|
37
|
+
import '../chunks/index.QWbK7rHY.js';
|
|
38
38
|
import 'node:console';
|
|
39
39
|
import '../chunks/inspector.CvyFGlXm.js';
|
|
40
40
|
import '../chunks/evaluatedModules.Dg1zASAC.js';
|
|
@@ -43,7 +43,7 @@ import 'node:timers';
|
|
|
43
43
|
import 'node:timers/promises';
|
|
44
44
|
import 'node:util';
|
|
45
45
|
import '@vitest/utils/constants';
|
|
46
|
-
import '../chunks/index.
|
|
46
|
+
import '../chunks/index.DZ-mI_Nm.js';
|
|
47
47
|
import 'expect-type';
|
|
48
48
|
import 'node:worker_threads';
|
|
49
49
|
|
package/dist/workers/vmForks.js
CHANGED
|
@@ -1,13 +1,12 @@
|
|
|
1
|
-
import { w as workerInit } from '../chunks/init-forks.
|
|
2
|
-
import { r as runVmTests } from '../chunks/vm.
|
|
3
|
-
import '
|
|
4
|
-
import '../chunks/init.DMDG-idf.js';
|
|
1
|
+
import { w as workerInit } from '../chunks/init-forks.BZSlxfwV.js';
|
|
2
|
+
import { r as runVmTests } from '../chunks/vm.wSHjz-et.js';
|
|
3
|
+
import '../chunks/init.Cz2kTB9a.js';
|
|
5
4
|
import 'node:fs';
|
|
6
5
|
import 'node:module';
|
|
7
6
|
import 'node:url';
|
|
8
7
|
import 'pathe';
|
|
9
8
|
import 'vite/module-runner';
|
|
10
|
-
import '../chunks/startModuleRunner.
|
|
9
|
+
import '../chunks/startModuleRunner.DLjmA_wU.js';
|
|
11
10
|
import '@vitest/utils/helpers';
|
|
12
11
|
import '../path.js';
|
|
13
12
|
import 'node:path';
|
|
@@ -15,12 +14,12 @@ import '@vitest/utils/serialize';
|
|
|
15
14
|
import '../module-evaluator.js';
|
|
16
15
|
import 'node:vm';
|
|
17
16
|
import '@vitest/mocker';
|
|
18
|
-
import '../chunks/index.
|
|
17
|
+
import '../chunks/index.QWbK7rHY.js';
|
|
19
18
|
import 'node:console';
|
|
20
19
|
import '@vitest/utils/error';
|
|
21
|
-
import '../chunks/rpc.
|
|
20
|
+
import '../chunks/rpc.BytlcPfC.js';
|
|
22
21
|
import '@vitest/utils/timers';
|
|
23
|
-
import '../chunks/index.
|
|
22
|
+
import '../chunks/index.0kCJoeWi.js';
|
|
24
23
|
import '../chunks/utils.DvEY5TfP.js';
|
|
25
24
|
import '@vitest/utils/source-map';
|
|
26
25
|
import '../chunks/inspector.CvyFGlXm.js';
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { w as workerInit } from '../chunks/init-threads.
|
|
2
|
-
import { r as runVmTests } from '../chunks/vm.
|
|
1
|
+
import { w as workerInit } from '../chunks/init-threads.CwE2n-Bv.js';
|
|
2
|
+
import { r as runVmTests } from '../chunks/vm.wSHjz-et.js';
|
|
3
3
|
import 'node:worker_threads';
|
|
4
|
-
import '../chunks/init.
|
|
4
|
+
import '../chunks/init.Cz2kTB9a.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/startModuleRunner.
|
|
10
|
+
import '../chunks/startModuleRunner.DLjmA_wU.js';
|
|
11
11
|
import '@vitest/utils/helpers';
|
|
12
12
|
import '../path.js';
|
|
13
13
|
import 'node:path';
|
|
@@ -15,12 +15,12 @@ import '@vitest/utils/serialize';
|
|
|
15
15
|
import '../module-evaluator.js';
|
|
16
16
|
import 'node:vm';
|
|
17
17
|
import '@vitest/mocker';
|
|
18
|
-
import '../chunks/index.
|
|
18
|
+
import '../chunks/index.QWbK7rHY.js';
|
|
19
19
|
import 'node:console';
|
|
20
20
|
import '@vitest/utils/error';
|
|
21
|
-
import '../chunks/rpc.
|
|
21
|
+
import '../chunks/rpc.BytlcPfC.js';
|
|
22
22
|
import '@vitest/utils/timers';
|
|
23
|
-
import '../chunks/index.
|
|
23
|
+
import '../chunks/index.0kCJoeWi.js';
|
|
24
24
|
import '../chunks/utils.DvEY5TfP.js';
|
|
25
25
|
import '@vitest/utils/source-map';
|
|
26
26
|
import '../chunks/inspector.CvyFGlXm.js';
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vitest",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "4.0.
|
|
4
|
+
"version": "4.0.10",
|
|
5
5
|
"description": "Next generation testing framework powered by Vite",
|
|
6
6
|
"author": "Anthony Fu <anthonyfu117@hotmail.com>",
|
|
7
7
|
"license": "MIT",
|
|
@@ -134,10 +134,10 @@
|
|
|
134
134
|
"@types/node": "^20.0.0 || ^22.0.0 || >=24.0.0",
|
|
135
135
|
"happy-dom": "*",
|
|
136
136
|
"jsdom": "*",
|
|
137
|
-
"@vitest/browser-playwright": "4.0.
|
|
138
|
-
"@vitest/
|
|
139
|
-
"@vitest/browser-
|
|
140
|
-
"@vitest/
|
|
137
|
+
"@vitest/browser-playwright": "4.0.10",
|
|
138
|
+
"@vitest/browser-webdriverio": "4.0.10",
|
|
139
|
+
"@vitest/browser-preview": "4.0.10",
|
|
140
|
+
"@vitest/ui": "4.0.10"
|
|
141
141
|
},
|
|
142
142
|
"peerDependenciesMeta": {
|
|
143
143
|
"@edge-runtime/vm": {
|
|
@@ -182,13 +182,13 @@
|
|
|
182
182
|
"tinyrainbow": "^3.0.3",
|
|
183
183
|
"vite": "^6.0.0 || ^7.0.0",
|
|
184
184
|
"why-is-node-running": "^2.3.0",
|
|
185
|
-
"@vitest/expect": "4.0.
|
|
186
|
-
"@vitest/
|
|
187
|
-
"@vitest/
|
|
188
|
-
"@vitest/
|
|
189
|
-
"@vitest/
|
|
190
|
-
"@vitest/
|
|
191
|
-
"@vitest/
|
|
185
|
+
"@vitest/expect": "4.0.10",
|
|
186
|
+
"@vitest/pretty-format": "4.0.10",
|
|
187
|
+
"@vitest/runner": "4.0.10",
|
|
188
|
+
"@vitest/spy": "4.0.10",
|
|
189
|
+
"@vitest/snapshot": "4.0.10",
|
|
190
|
+
"@vitest/utils": "4.0.10",
|
|
191
|
+
"@vitest/mocker": "4.0.10"
|
|
192
192
|
},
|
|
193
193
|
"devDependencies": {
|
|
194
194
|
"@antfu/install-pkg": "^1.1.0",
|
|
@@ -200,17 +200,17 @@
|
|
|
200
200
|
"@types/istanbul-lib-coverage": "^2.0.6",
|
|
201
201
|
"@types/istanbul-reports": "^3.0.4",
|
|
202
202
|
"@types/jsdom": "^27.0.0",
|
|
203
|
-
"@types/node": "^
|
|
203
|
+
"@types/node": "^24.10.1",
|
|
204
204
|
"@types/picomatch": "^4.0.2",
|
|
205
205
|
"@types/prompts": "^2.4.9",
|
|
206
206
|
"@types/sinonjs__fake-timers": "^8.1.5",
|
|
207
207
|
"acorn-walk": "^8.3.4",
|
|
208
|
-
"birpc": "^2.
|
|
208
|
+
"birpc": "^2.8.0",
|
|
209
209
|
"cac": "^6.7.14",
|
|
210
210
|
"empathic": "^2.0.0",
|
|
211
211
|
"flatted": "^3.3.3",
|
|
212
212
|
"happy-dom": "^20.0.10",
|
|
213
|
-
"jsdom": "^27.
|
|
213
|
+
"jsdom": "^27.2.0",
|
|
214
214
|
"local-pkg": "^1.1.2",
|
|
215
215
|
"mime": "^4.1.0",
|
|
216
216
|
"prompts": "^2.4.2",
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
|
|
2
|
-
|
|
3
|
-
function getDefaultExportFromCjs (x) {
|
|
4
|
-
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
export { commonjsGlobal as c, getDefaultExportFromCjs as g };
|
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
import v8 from 'node:v8';
|
|
2
|
-
import { i as init } from './init.DMDG-idf.js';
|
|
3
|
-
|
|
4
|
-
if (!process.send) throw new Error("Expected worker to be run in node:child_process");
|
|
5
|
-
// Store globals in case tests overwrite them
|
|
6
|
-
const processExit = process.exit.bind(process);
|
|
7
|
-
const processSend = process.send.bind(process);
|
|
8
|
-
const processOn = process.on.bind(process);
|
|
9
|
-
const processOff = process.off.bind(process);
|
|
10
|
-
const processRemoveAllListeners = process.removeAllListeners.bind(process);
|
|
11
|
-
// Work-around for nodejs/node#55094
|
|
12
|
-
if (process.execArgv.some((execArg) => execArg.startsWith("--prof") || execArg.startsWith("--cpu-prof") || execArg.startsWith("--heap-prof") || execArg.startsWith("--diagnostic-dir"))) processOn("SIGTERM", () => processExit());
|
|
13
|
-
function workerInit(options) {
|
|
14
|
-
const { runTests } = options;
|
|
15
|
-
init({
|
|
16
|
-
post: (v) => processSend(v),
|
|
17
|
-
on: (cb) => processOn("message", cb),
|
|
18
|
-
off: (cb) => processOff("message", cb),
|
|
19
|
-
teardown: () => processRemoveAllListeners("message"),
|
|
20
|
-
serialize: v8.serialize,
|
|
21
|
-
deserialize: (v) => v8.deserialize(Buffer.from(v)),
|
|
22
|
-
runTests: (state) => executeTests("run", state),
|
|
23
|
-
collectTests: (state) => executeTests("collect", state),
|
|
24
|
-
setup: options.setup
|
|
25
|
-
});
|
|
26
|
-
async function executeTests(method, state) {
|
|
27
|
-
state.ctx.config = unwrapSerializableConfig(state.ctx.config);
|
|
28
|
-
try {
|
|
29
|
-
await runTests(method, state);
|
|
30
|
-
} finally {
|
|
31
|
-
process.exit = processExit;
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
/**
|
|
36
|
-
* Reverts the wrapping done by `wrapSerializableConfig` in {@link file://./../../node/pool/runtimes/forks.ts}
|
|
37
|
-
*/
|
|
38
|
-
function unwrapSerializableConfig(config) {
|
|
39
|
-
if (config.testNamePattern && typeof config.testNamePattern === "string") {
|
|
40
|
-
const testNamePattern = config.testNamePattern;
|
|
41
|
-
if (testNamePattern.startsWith("$$vitest:")) config.testNamePattern = parseRegexp(testNamePattern.slice(9));
|
|
42
|
-
}
|
|
43
|
-
if (config.defines && Array.isArray(config.defines.keys) && config.defines.original) {
|
|
44
|
-
const { keys, original } = config.defines;
|
|
45
|
-
const defines = {};
|
|
46
|
-
// Apply all keys from the original. Entries which had undefined value are missing from original now
|
|
47
|
-
for (const key of keys) defines[key] = original[key];
|
|
48
|
-
config.defines = defines;
|
|
49
|
-
}
|
|
50
|
-
return config;
|
|
51
|
-
}
|
|
52
|
-
function parseRegexp(input) {
|
|
53
|
-
// Parse input
|
|
54
|
-
// eslint-disable-next-line regexp/no-misleading-capturing-group
|
|
55
|
-
const m = input.match(/(\/?)(.+)\1([a-z]*)/i);
|
|
56
|
-
// match nothing
|
|
57
|
-
if (!m) return /$^/;
|
|
58
|
-
// Invalid flags
|
|
59
|
-
// eslint-disable-next-line regexp/optimal-quantifier-concatenation
|
|
60
|
-
if (m[3] && !/^(?!.*?(.).*?\1)[gmixXsuUAJ]+$/.test(m[3])) return new RegExp(input);
|
|
61
|
-
// Create the regular expression
|
|
62
|
-
return new RegExp(m[2], m[3]);
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
export { workerInit as w };
|