vitest 1.5.3 → 2.0.0-beta.1
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 +172 -0
- package/dist/browser.d.ts +1 -1
- package/dist/browser.js +4 -4
- package/dist/chunks/environments-node.39w4gmlF.js +19 -0
- package/dist/chunks/{install-pkg.LE8oaA1t.js → install-pkg.DNUmWFkO.js} +2 -2
- package/dist/chunks/integrations-globals.B5Jl0grA.js +31 -0
- package/dist/chunks/{runtime-console.EO5ha7qv.js → runtime-console.CUES-L8X.js} +9 -9
- package/dist/chunks/{runtime-runBaseTests.l6qXp5eU.js → runtime-runBaseTests._dXkRAZc.js} +21 -22
- package/dist/cli.js +3 -3
- package/dist/config.cjs +2 -3
- package/dist/config.d.ts +1 -1
- package/dist/config.js +2 -3
- package/dist/coverage.d.ts +1 -1
- package/dist/coverage.js +2 -2
- package/dist/environments.d.ts +1 -1
- package/dist/environments.js +1 -1
- package/dist/execute.d.ts +7 -4
- package/dist/execute.js +3 -3
- package/dist/index.d.ts +770 -21
- package/dist/index.js +12 -12
- package/dist/node.d.ts +2 -2
- package/dist/node.js +21 -22
- package/dist/{reporters-BXNXFKfg.d.ts → reporters-MGvT5U9f.d.ts} +128 -55
- package/dist/reporters.d.ts +1 -1
- package/dist/reporters.js +11 -12
- package/dist/runners.d.ts +1 -1
- package/dist/runners.js +17 -18
- package/dist/snapshot.d.ts +9 -0
- package/dist/snapshot.js +8 -0
- package/dist/{suite-KPWE530F.d.ts → suite-8WAe-urM.d.ts} +1 -1
- package/dist/suite.d.ts +2 -2
- package/dist/suite.js +4 -4
- package/dist/vendor/{base.oIzAvGLe.js → base.VFkIJ66g.js} +3 -3
- package/dist/vendor/{base.Xt0Omgh7.js → base._gnK9Slw.js} +8 -1
- package/dist/vendor/{benchmark.yGkUTKnC.js → benchmark.BNLebNi5.js} +1 -1
- package/dist/vendor/{cac.RDd_SGOd.js → cac.DzKZaJu2.js} +39 -17
- package/dist/vendor/{cli-api.AmIc1Dmz.js → cli-api.DTeni0Qq.js} +3201 -404
- package/dist/vendor/{execute.2_yoIC01.js → execute.CLLNVNnK.js} +8 -3
- package/dist/vendor/{index.Fm6OikHU.js → index.BfoZyXD1.js} +20 -21
- package/dist/vendor/{index.8bPxjt7g.js → index.BpSiYbpB.js} +5 -1
- package/dist/vendor/{index.X7lgIMc_.js → index.CRxYS9H3.js} +586 -230
- package/dist/vendor/{index.QVcwRDVW.js → index.CmILuxzC.js} +8 -6
- package/dist/vendor/{index.xL8XjTLv.js → index.DP-km6lF.js} +1 -1
- package/dist/vendor/{index.SMVOaj7F.js → index._7XLd8Kd.js} +2 -2
- package/dist/vendor/{rpc.joBhAkyK.js → rpc.DRDE9Pu1.js} +2 -2
- package/dist/vendor/{run-once.Olz_Zkd8.js → run-once.DLomgGUH.js} +1 -1
- package/dist/vendor/{setup-common.5nUd4r76.js → setup-common.XeoZAW8t.js} +2 -2
- package/dist/vendor/{tasks.IknbGB2n.js → tasks.WC7M-K-v.js} +4 -1
- package/dist/vendor/{utils.VYmeMh-u.js → utils.D5gGkwyH.js} +1 -1
- package/dist/vendor/{vi.Y_w82WR8.js → vi.ClD3hi7L.js} +23 -10
- package/dist/vendor/{vm.i4FO5N37.js → vm.Bi3bljci.js} +132 -54
- package/dist/worker.js +13 -7
- package/dist/workers/forks.js +6 -6
- package/dist/workers/runVmTests.js +22 -20
- package/dist/workers/threads.js +6 -6
- package/dist/workers/vmForks.js +9 -9
- package/dist/workers/vmThreads.js +9 -9
- package/dist/workers.d.ts +1 -1
- package/dist/workers.js +14 -14
- package/package.json +33 -29
- package/snapshot.d.ts +1 -0
- package/vitest.mjs +1 -1
- package/dist/chunks/integrations-globals.Hr6znn-f.js +0 -31
- package/dist/cli-wrapper.js +0 -119
- /package/dist/chunks/{node-git.Hw101KjS.js → node-git.CCI8evVZ.js} +0 -0
- /package/dist/vendor/{_commonjsHelpers.jjO7Zipk.js → _commonjsHelpers.BFTU3MAI.js} +0 -0
- /package/dist/vendor/{constants.5J7I254_.js → constants.5SOfHUj0.js} +0 -0
- /package/dist/vendor/{coverage.E7sG1b3r.js → coverage.ChSqD-qS.js} +0 -0
- /package/dist/vendor/{date.Ns1pGd_X.js → date.BKM1wewY.js} +0 -0
- /package/dist/vendor/{env.AtSIuHFg.js → env.bmJgw1qP.js} +0 -0
- /package/dist/vendor/{global.CkGT_TMy.js → global.7bFbnyXl.js} +0 -0
- /package/dist/vendor/{index.GVFv9dZ0.js → index.DeR1hhfY.js} +0 -0
- /package/dist/vendor/{inspector.IgLX3ur5.js → inspector.hPQncR7V.js} +0 -0
- /package/dist/vendor/{utils.0uYuCbzo.js → utils.CUjzkRH7.js} +0 -0
|
@@ -6,34 +6,33 @@ import { performance } from 'node:perf_hooks';
|
|
|
6
6
|
import { startTests } from '@vitest/runner';
|
|
7
7
|
import { setupColors, createColors } from '@vitest/utils';
|
|
8
8
|
import { installSourcemapsSupport } from 'vite-node/source-map';
|
|
9
|
-
import {
|
|
10
|
-
import { a as startCoverageInsideWorker, s as stopCoverageInsideWorker } from '../vendor/coverage.
|
|
11
|
-
import { g as getWorkerState } from '../vendor/global.
|
|
12
|
-
import { V as VitestIndex } from '../vendor/index.
|
|
13
|
-
import { s as setupCommonEnv } from '../vendor/setup-common.
|
|
14
|
-
import { c as closeInspector } from '../vendor/inspector.
|
|
9
|
+
import { s as setupChaiConfig, r as resolveTestRunner, a as resolveSnapshotEnvironment } from '../vendor/index.BfoZyXD1.js';
|
|
10
|
+
import { a as startCoverageInsideWorker, s as stopCoverageInsideWorker } from '../vendor/coverage.ChSqD-qS.js';
|
|
11
|
+
import { g as getWorkerState } from '../vendor/global.7bFbnyXl.js';
|
|
12
|
+
import { V as VitestIndex } from '../vendor/index.CmILuxzC.js';
|
|
13
|
+
import { s as setupCommonEnv } from '../vendor/setup-common.XeoZAW8t.js';
|
|
14
|
+
import { c as closeInspector } from '../vendor/inspector.hPQncR7V.js';
|
|
15
15
|
import 'chai';
|
|
16
|
-
import '@vitest/snapshot/environment';
|
|
17
16
|
import 'pathe';
|
|
18
17
|
import '../path.js';
|
|
19
18
|
import 'node:url';
|
|
20
|
-
import '../vendor/rpc.
|
|
21
|
-
import '../vendor/index.
|
|
22
|
-
import '../vendor/benchmark.
|
|
19
|
+
import '../vendor/rpc.DRDE9Pu1.js';
|
|
20
|
+
import '../vendor/index.BpSiYbpB.js';
|
|
21
|
+
import '../vendor/benchmark.BNLebNi5.js';
|
|
23
22
|
import '@vitest/runner/utils';
|
|
24
|
-
import '../vendor/index.
|
|
25
|
-
import '../vendor/env.
|
|
23
|
+
import '../vendor/index._7XLd8Kd.js';
|
|
24
|
+
import '../vendor/env.bmJgw1qP.js';
|
|
26
25
|
import 'std-env';
|
|
27
|
-
import '../vendor/run-once.
|
|
28
|
-
import '../vendor/vi.
|
|
29
|
-
import '../vendor/_commonjsHelpers.
|
|
26
|
+
import '../vendor/run-once.DLomgGUH.js';
|
|
27
|
+
import '../vendor/vi.ClD3hi7L.js';
|
|
28
|
+
import '../vendor/_commonjsHelpers.BFTU3MAI.js';
|
|
30
29
|
import '@vitest/expect';
|
|
31
30
|
import '@vitest/snapshot';
|
|
32
31
|
import '@vitest/utils/error';
|
|
33
|
-
import '../vendor/tasks.
|
|
32
|
+
import '../vendor/tasks.WC7M-K-v.js';
|
|
34
33
|
import '@vitest/utils/source-map';
|
|
35
|
-
import '../vendor/base.
|
|
36
|
-
import '../vendor/date.
|
|
34
|
+
import '../vendor/base._gnK9Slw.js';
|
|
35
|
+
import '../vendor/date.BKM1wewY.js';
|
|
37
36
|
import '@vitest/spy';
|
|
38
37
|
|
|
39
38
|
async function run(files, config, executor) {
|
|
@@ -43,7 +42,6 @@ async function run(files, config, executor) {
|
|
|
43
42
|
value: VitestIndex,
|
|
44
43
|
enumerable: false
|
|
45
44
|
});
|
|
46
|
-
config.snapshotOptions.snapshotEnvironment = new VitestSnapshotEnvironment(workerState.rpc);
|
|
47
45
|
setupColors(createColors(isatty(1)));
|
|
48
46
|
if (workerState.environment.transformMode === "web") {
|
|
49
47
|
const _require = createRequire(import.meta.url);
|
|
@@ -62,7 +60,11 @@ async function run(files, config, executor) {
|
|
|
62
60
|
await startCoverageInsideWorker(config.coverage, executor);
|
|
63
61
|
if (config.chaiConfig)
|
|
64
62
|
setupChaiConfig(config.chaiConfig);
|
|
65
|
-
const runner = await
|
|
63
|
+
const [runner, snapshotEnvironment] = await Promise.all([
|
|
64
|
+
resolveTestRunner(config, executor),
|
|
65
|
+
resolveSnapshotEnvironment(config, executor)
|
|
66
|
+
]);
|
|
67
|
+
config.snapshotOptions.snapshotEnvironment = snapshotEnvironment;
|
|
66
68
|
workerState.onCancel.then((reason) => {
|
|
67
69
|
var _a;
|
|
68
70
|
closeInspector(config);
|
package/dist/workers/threads.js
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import { r as runBaseTests } from '../vendor/base.
|
|
2
|
-
import { a as createThreadsRpcOptions } from '../vendor/utils.
|
|
1
|
+
import { r as runBaseTests } from '../vendor/base.VFkIJ66g.js';
|
|
2
|
+
import { a as createThreadsRpcOptions } from '../vendor/utils.CUjzkRH7.js';
|
|
3
3
|
import 'vite-node/client';
|
|
4
|
-
import '../vendor/global.
|
|
5
|
-
import '../vendor/execute.
|
|
4
|
+
import '../vendor/global.7bFbnyXl.js';
|
|
5
|
+
import '../vendor/execute.CLLNVNnK.js';
|
|
6
6
|
import 'node:vm';
|
|
7
7
|
import 'node:url';
|
|
8
|
+
import 'node:fs';
|
|
8
9
|
import 'vite-node/utils';
|
|
9
10
|
import 'pathe';
|
|
10
11
|
import '@vitest/utils/error';
|
|
11
12
|
import '../path.js';
|
|
12
|
-
import 'node:fs';
|
|
13
13
|
import '@vitest/utils';
|
|
14
|
-
import '../vendor/base.
|
|
14
|
+
import '../vendor/base._gnK9Slw.js';
|
|
15
15
|
|
|
16
16
|
class ThreadsBaseWorker {
|
|
17
17
|
getRpcOptions(ctx) {
|
package/dist/workers/vmForks.js
CHANGED
|
@@ -1,26 +1,26 @@
|
|
|
1
1
|
import v8 from 'node:v8';
|
|
2
|
-
import { c as createForksRpcOptions, u as unwrapSerializableConfig } from '../vendor/utils.
|
|
3
|
-
import { r as runVmTests } from '../vendor/vm.
|
|
2
|
+
import { c as createForksRpcOptions, u as unwrapSerializableConfig } from '../vendor/utils.CUjzkRH7.js';
|
|
3
|
+
import { r as runVmTests } from '../vendor/vm.Bi3bljci.js';
|
|
4
4
|
import '@vitest/utils';
|
|
5
5
|
import 'node:vm';
|
|
6
6
|
import 'node:url';
|
|
7
7
|
import 'pathe';
|
|
8
|
-
import '../chunks/runtime-console.
|
|
8
|
+
import '../chunks/runtime-console.CUES-L8X.js';
|
|
9
9
|
import 'node:stream';
|
|
10
10
|
import 'node:console';
|
|
11
11
|
import 'node:path';
|
|
12
|
-
import '../vendor/date.
|
|
12
|
+
import '../vendor/date.BKM1wewY.js';
|
|
13
13
|
import '@vitest/runner/utils';
|
|
14
|
-
import '../vendor/global.
|
|
15
|
-
import '../vendor/env.
|
|
14
|
+
import '../vendor/global.7bFbnyXl.js';
|
|
15
|
+
import '../vendor/env.bmJgw1qP.js';
|
|
16
16
|
import 'std-env';
|
|
17
|
-
import '../vendor/execute.
|
|
17
|
+
import '../vendor/execute.CLLNVNnK.js';
|
|
18
|
+
import 'node:fs';
|
|
18
19
|
import 'vite-node/client';
|
|
19
20
|
import 'vite-node/utils';
|
|
20
21
|
import '@vitest/utils/error';
|
|
21
22
|
import '../path.js';
|
|
22
|
-
import '
|
|
23
|
-
import '../vendor/base.Xt0Omgh7.js';
|
|
23
|
+
import '../vendor/base._gnK9Slw.js';
|
|
24
24
|
import 'node:module';
|
|
25
25
|
import 'vite-node/constants';
|
|
26
26
|
|
|
@@ -1,25 +1,25 @@
|
|
|
1
|
-
import { a as createThreadsRpcOptions } from '../vendor/utils.
|
|
2
|
-
import { r as runVmTests } from '../vendor/vm.
|
|
1
|
+
import { a as createThreadsRpcOptions } from '../vendor/utils.CUjzkRH7.js';
|
|
2
|
+
import { r as runVmTests } from '../vendor/vm.Bi3bljci.js';
|
|
3
3
|
import '@vitest/utils';
|
|
4
4
|
import 'node:vm';
|
|
5
5
|
import 'node:url';
|
|
6
6
|
import 'pathe';
|
|
7
|
-
import '../chunks/runtime-console.
|
|
7
|
+
import '../chunks/runtime-console.CUES-L8X.js';
|
|
8
8
|
import 'node:stream';
|
|
9
9
|
import 'node:console';
|
|
10
10
|
import 'node:path';
|
|
11
|
-
import '../vendor/date.
|
|
11
|
+
import '../vendor/date.BKM1wewY.js';
|
|
12
12
|
import '@vitest/runner/utils';
|
|
13
|
-
import '../vendor/global.
|
|
14
|
-
import '../vendor/env.
|
|
13
|
+
import '../vendor/global.7bFbnyXl.js';
|
|
14
|
+
import '../vendor/env.bmJgw1qP.js';
|
|
15
15
|
import 'std-env';
|
|
16
|
-
import '../vendor/execute.
|
|
16
|
+
import '../vendor/execute.CLLNVNnK.js';
|
|
17
|
+
import 'node:fs';
|
|
17
18
|
import 'vite-node/client';
|
|
18
19
|
import 'vite-node/utils';
|
|
19
20
|
import '@vitest/utils/error';
|
|
20
21
|
import '../path.js';
|
|
21
|
-
import '
|
|
22
|
-
import '../vendor/base.Xt0Omgh7.js';
|
|
22
|
+
import '../vendor/base._gnK9Slw.js';
|
|
23
23
|
import 'node:module';
|
|
24
24
|
import 'vite-node/constants';
|
|
25
25
|
|
package/dist/workers.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as v8 from 'v8';
|
|
2
|
-
import { d as BirpcOptions, e as RuntimeRPC, f as ContextRPC, W as WorkerGlobalState, g as WorkerContext, R as ResolvedConfig } from './reporters-
|
|
2
|
+
import { d as BirpcOptions, e as RuntimeRPC, f as ContextRPC, W as WorkerGlobalState, g as WorkerContext, R as ResolvedConfig } from './reporters-MGvT5U9f.js';
|
|
3
3
|
import { Awaitable } from '@vitest/utils';
|
|
4
4
|
import 'vite';
|
|
5
5
|
import '@vitest/runner';
|
package/dist/workers.js
CHANGED
|
@@ -1,31 +1,31 @@
|
|
|
1
|
-
export { c as createForksRpcOptions, a as createThreadsRpcOptions, u as unwrapSerializableConfig } from './vendor/utils.
|
|
2
|
-
export { p as provideWorkerState } from './vendor/global.
|
|
1
|
+
export { c as createForksRpcOptions, a as createThreadsRpcOptions, u as unwrapSerializableConfig } from './vendor/utils.CUjzkRH7.js';
|
|
2
|
+
export { p as provideWorkerState } from './vendor/global.7bFbnyXl.js';
|
|
3
3
|
export { run as runVitestWorker } from './worker.js';
|
|
4
|
-
export { r as runVmTests } from './vendor/vm.
|
|
5
|
-
export { r as runBaseTests } from './vendor/base.
|
|
4
|
+
export { r as runVmTests } from './vendor/vm.Bi3bljci.js';
|
|
5
|
+
export { r as runBaseTests } from './vendor/base.VFkIJ66g.js';
|
|
6
6
|
import '@vitest/utils';
|
|
7
7
|
import 'node:url';
|
|
8
8
|
import 'tinypool';
|
|
9
9
|
import 'vite-node/client';
|
|
10
|
+
import 'node:fs';
|
|
10
11
|
import 'pathe';
|
|
11
|
-
import './vendor/index.
|
|
12
|
+
import './vendor/index.DeR1hhfY.js';
|
|
12
13
|
import 'node:console';
|
|
13
|
-
import './vendor/base.
|
|
14
|
-
import './vendor/inspector.
|
|
14
|
+
import './vendor/base._gnK9Slw.js';
|
|
15
|
+
import './vendor/inspector.hPQncR7V.js';
|
|
15
16
|
import 'node:module';
|
|
16
|
-
import './vendor/rpc.
|
|
17
|
-
import './vendor/index.
|
|
17
|
+
import './vendor/rpc.DRDE9Pu1.js';
|
|
18
|
+
import './vendor/index.BpSiYbpB.js';
|
|
18
19
|
import 'node:vm';
|
|
19
|
-
import './chunks/runtime-console.
|
|
20
|
+
import './chunks/runtime-console.CUES-L8X.js';
|
|
20
21
|
import 'node:stream';
|
|
21
22
|
import 'node:path';
|
|
22
|
-
import './vendor/date.
|
|
23
|
+
import './vendor/date.BKM1wewY.js';
|
|
23
24
|
import '@vitest/runner/utils';
|
|
24
|
-
import './vendor/env.
|
|
25
|
+
import './vendor/env.bmJgw1qP.js';
|
|
25
26
|
import 'std-env';
|
|
26
|
-
import './vendor/execute.
|
|
27
|
+
import './vendor/execute.CLLNVNnK.js';
|
|
27
28
|
import 'vite-node/utils';
|
|
28
29
|
import '@vitest/utils/error';
|
|
29
30
|
import './path.js';
|
|
30
|
-
import 'node:fs';
|
|
31
31
|
import 'vite-node/constants';
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vitest",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "
|
|
4
|
+
"version": "2.0.0-beta.1",
|
|
5
5
|
"description": "Next generation testing framework powered by Vite",
|
|
6
6
|
"author": "Anthony Fu <anthonyfu117@hotmail.com>",
|
|
7
7
|
"license": "MIT",
|
|
@@ -91,6 +91,10 @@
|
|
|
91
91
|
"./reporters": {
|
|
92
92
|
"types": "./dist/reporters.d.ts",
|
|
93
93
|
"default": "./dist/reporters.js"
|
|
94
|
+
},
|
|
95
|
+
"./snapshot": {
|
|
96
|
+
"types": "./dist/snapshot.d.ts",
|
|
97
|
+
"default": "./dist/snapshot.js"
|
|
94
98
|
}
|
|
95
99
|
},
|
|
96
100
|
"main": "./dist/index.js",
|
|
@@ -115,8 +119,8 @@
|
|
|
115
119
|
"@types/node": "^18.0.0 || >=20.0.0",
|
|
116
120
|
"happy-dom": "*",
|
|
117
121
|
"jsdom": "*",
|
|
118
|
-
"@vitest/
|
|
119
|
-
"@vitest/
|
|
122
|
+
"@vitest/ui": "2.0.0-beta.1",
|
|
123
|
+
"@vitest/browser": "2.0.0-beta.1"
|
|
120
124
|
},
|
|
121
125
|
"peerDependenciesMeta": {
|
|
122
126
|
"@edge-runtime/vm": {
|
|
@@ -139,58 +143,58 @@
|
|
|
139
143
|
}
|
|
140
144
|
},
|
|
141
145
|
"dependencies": {
|
|
142
|
-
"
|
|
143
|
-
"chai": "^4.3.10",
|
|
146
|
+
"chai": "^5.1.1",
|
|
144
147
|
"debug": "^4.3.4",
|
|
145
148
|
"execa": "^8.0.1",
|
|
146
|
-
"
|
|
147
|
-
"
|
|
148
|
-
"pathe": "^1.1.1",
|
|
149
|
+
"magic-string": "^0.30.10",
|
|
150
|
+
"pathe": "^1.1.2",
|
|
149
151
|
"picocolors": "^1.0.0",
|
|
150
|
-
"std-env": "^3.
|
|
151
|
-
"
|
|
152
|
-
"
|
|
153
|
-
"tinypool": "^0.8.3",
|
|
152
|
+
"std-env": "^3.7.0",
|
|
153
|
+
"tinybench": "^2.8.0",
|
|
154
|
+
"tinypool": "^0.8.4",
|
|
154
155
|
"vite": "^5.0.0",
|
|
155
156
|
"why-is-node-running": "^2.2.2",
|
|
156
|
-
"@vitest/
|
|
157
|
-
"@vitest/
|
|
158
|
-
"
|
|
159
|
-
"@vitest/
|
|
160
|
-
"@vitest/spy": "
|
|
161
|
-
"
|
|
157
|
+
"@vitest/runner": "2.0.0-beta.1",
|
|
158
|
+
"@vitest/expect": "2.0.0-beta.1",
|
|
159
|
+
"@vitest/snapshot": "2.0.0-beta.1",
|
|
160
|
+
"@vitest/utils": "2.0.0-beta.1",
|
|
161
|
+
"@vitest/spy": "2.0.0-beta.1",
|
|
162
|
+
"vite-node": "2.0.0-beta.1"
|
|
162
163
|
},
|
|
163
164
|
"devDependencies": {
|
|
164
|
-
"@ampproject/remapping": "^2.
|
|
165
|
-
"@antfu/install-pkg": "
|
|
166
|
-
"@edge-runtime/vm": "^3.
|
|
165
|
+
"@ampproject/remapping": "^2.3.0",
|
|
166
|
+
"@antfu/install-pkg": "0.3.1",
|
|
167
|
+
"@edge-runtime/vm": "^3.2.0",
|
|
167
168
|
"@sinonjs/fake-timers": "11.1.0",
|
|
168
169
|
"@types/estree": "^1.0.5",
|
|
169
170
|
"@types/istanbul-lib-coverage": "^2.0.6",
|
|
170
171
|
"@types/istanbul-reports": "^3.0.4",
|
|
171
172
|
"@types/jsdom": "^21.1.6",
|
|
172
|
-
"@types/micromatch": "^4.0.
|
|
173
|
-
"@types/node": "^20.11
|
|
173
|
+
"@types/micromatch": "^4.0.7",
|
|
174
|
+
"@types/node": "^20.12.11",
|
|
174
175
|
"@types/prompts": "^2.4.9",
|
|
175
176
|
"@types/sinonjs__fake-timers": "^8.1.5",
|
|
176
|
-
"
|
|
177
|
+
"acorn-walk": "^8.3.2",
|
|
178
|
+
"birpc": "0.2.17",
|
|
177
179
|
"cac": "^6.7.14",
|
|
178
180
|
"chai-subset": "^1.6.0",
|
|
179
181
|
"cli-truncate": "^4.0.0",
|
|
180
|
-
"expect-type": "^0.
|
|
182
|
+
"expect-type": "^0.19.0",
|
|
181
183
|
"fast-glob": "^3.3.2",
|
|
182
184
|
"find-up": "^6.3.0",
|
|
183
|
-
"flatted": "^3.
|
|
184
|
-
"get-tsconfig": "^4.7.
|
|
185
|
-
"happy-dom": "^14.
|
|
185
|
+
"flatted": "^3.3.1",
|
|
186
|
+
"get-tsconfig": "^4.7.4",
|
|
187
|
+
"happy-dom": "^14.10.1",
|
|
186
188
|
"jsdom": "^24.0.0",
|
|
189
|
+
"local-pkg": "^0.5.0",
|
|
187
190
|
"log-update": "^5.0.1",
|
|
188
191
|
"micromatch": "^4.0.5",
|
|
189
192
|
"p-limit": "^5.0.0",
|
|
190
193
|
"pretty-format": "^29.7.0",
|
|
191
194
|
"prompts": "^2.4.2",
|
|
192
195
|
"strip-ansi": "^7.1.0",
|
|
193
|
-
"
|
|
196
|
+
"strip-literal": "^2.1.0",
|
|
197
|
+
"ws": "^8.17.0"
|
|
194
198
|
},
|
|
195
199
|
"scripts": {
|
|
196
200
|
"build": "rimraf dist && rollup -c",
|
package/snapshot.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './dist/snapshot.js'
|
package/vitest.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import './dist/cli
|
|
2
|
+
import './dist/cli.js'
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { g as globalApis } from '../vendor/constants.5J7I254_.js';
|
|
2
|
-
import { V as VitestIndex } from '../vendor/index.QVcwRDVW.js';
|
|
3
|
-
import '@vitest/runner';
|
|
4
|
-
import '../vendor/benchmark.yGkUTKnC.js';
|
|
5
|
-
import '@vitest/runner/utils';
|
|
6
|
-
import '@vitest/utils';
|
|
7
|
-
import '../vendor/index.SMVOaj7F.js';
|
|
8
|
-
import 'pathe';
|
|
9
|
-
import '../vendor/global.CkGT_TMy.js';
|
|
10
|
-
import '../vendor/env.AtSIuHFg.js';
|
|
11
|
-
import 'std-env';
|
|
12
|
-
import '../vendor/run-once.Olz_Zkd8.js';
|
|
13
|
-
import '../vendor/vi.Y_w82WR8.js';
|
|
14
|
-
import 'chai';
|
|
15
|
-
import '../vendor/_commonjsHelpers.jjO7Zipk.js';
|
|
16
|
-
import '@vitest/expect';
|
|
17
|
-
import '@vitest/snapshot';
|
|
18
|
-
import '@vitest/utils/error';
|
|
19
|
-
import '../vendor/tasks.IknbGB2n.js';
|
|
20
|
-
import '@vitest/utils/source-map';
|
|
21
|
-
import '../vendor/base.Xt0Omgh7.js';
|
|
22
|
-
import '../vendor/date.Ns1pGd_X.js';
|
|
23
|
-
import '@vitest/spy';
|
|
24
|
-
|
|
25
|
-
function registerApiGlobally() {
|
|
26
|
-
globalApis.forEach((api) => {
|
|
27
|
-
globalThis[api] = VitestIndex[api];
|
|
28
|
-
});
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
export { registerApiGlobally };
|
package/dist/cli-wrapper.js
DELETED
|
@@ -1,119 +0,0 @@
|
|
|
1
|
-
import { fileURLToPath } from 'node:url';
|
|
2
|
-
import c from 'picocolors';
|
|
3
|
-
import { execa } from 'execa';
|
|
4
|
-
import { E as EXIT_CODE_RESTART } from './vendor/constants.5J7I254_.js';
|
|
5
|
-
|
|
6
|
-
const ENTRY = new URL("./cli.js", import.meta.url);
|
|
7
|
-
const NODE_ARGS = [
|
|
8
|
-
"--trace-deprecation",
|
|
9
|
-
"--experimental-wasm-threads",
|
|
10
|
-
"--wasm-atomics-on-non-shared-memory"
|
|
11
|
-
];
|
|
12
|
-
const SegfaultErrors = [
|
|
13
|
-
{
|
|
14
|
-
trigger: "Check failed: result.second.",
|
|
15
|
-
url: "https://github.com/nodejs/node/issues/43617"
|
|
16
|
-
},
|
|
17
|
-
{
|
|
18
|
-
trigger: "FATAL ERROR: v8::FromJust Maybe value is Nothing.",
|
|
19
|
-
url: "https://github.com/vitest-dev/vitest/issues/1191"
|
|
20
|
-
},
|
|
21
|
-
{
|
|
22
|
-
trigger: "FATAL ERROR: v8::ToLocalChecked Empty MaybeLocal.",
|
|
23
|
-
url: "https://github.com/nodejs/node/issues/42407"
|
|
24
|
-
}
|
|
25
|
-
];
|
|
26
|
-
main();
|
|
27
|
-
async function main() {
|
|
28
|
-
var _a;
|
|
29
|
-
let retries = 0;
|
|
30
|
-
const args = process.argv.slice(2);
|
|
31
|
-
if (process.env.VITEST_SEGFAULT_RETRY) {
|
|
32
|
-
retries = +process.env.VITEST_SEGFAULT_RETRY;
|
|
33
|
-
} else {
|
|
34
|
-
for (let i = 0; i < args.length; i++) {
|
|
35
|
-
if (args[i].startsWith("--segfault-retry=") || args[i].startsWith("--segfaultRetry=")) {
|
|
36
|
-
retries = +args[i].split("=")[1];
|
|
37
|
-
break;
|
|
38
|
-
} else if ((args[i] === "--segfault-retry" || args[i] === "--segfaultRetry") && ((_a = args[i + 1]) == null ? void 0 : _a.match(/^\d+$/))) {
|
|
39
|
-
retries = +args[i + 1];
|
|
40
|
-
break;
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
if (retries <= 0) {
|
|
45
|
-
await import('./cli.js');
|
|
46
|
-
return;
|
|
47
|
-
}
|
|
48
|
-
const nodeArgs = [];
|
|
49
|
-
const vitestArgs = [];
|
|
50
|
-
for (let i = 0; i < args.length; i++) {
|
|
51
|
-
let matched = false;
|
|
52
|
-
for (const nodeArg of NODE_ARGS) {
|
|
53
|
-
if (args[i] === nodeArg || args[i].startsWith(`${nodeArg}=`)) {
|
|
54
|
-
matched = true;
|
|
55
|
-
nodeArgs.push(args[i]);
|
|
56
|
-
break;
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
if (!matched)
|
|
60
|
-
vitestArgs.push(args[i]);
|
|
61
|
-
}
|
|
62
|
-
retries = Math.max(1, retries || 1);
|
|
63
|
-
for (let i = 1; i <= retries; i++) {
|
|
64
|
-
const result = await start(nodeArgs, vitestArgs);
|
|
65
|
-
if (result === "restart") {
|
|
66
|
-
i -= 1;
|
|
67
|
-
continue;
|
|
68
|
-
}
|
|
69
|
-
if (i === 1 && retries === 1) {
|
|
70
|
-
console.log(c.yellow(`It seems to be an upstream bug of Node.js. To improve the test stability,
|
|
71
|
-
you could pass ${c.bold(c.green("--segfault-retry=3"))} or set env ${c.bold(c.green("VITEST_SEGFAULT_RETRY=3"))} to
|
|
72
|
-
have Vitest auto retries on flaky segfaults.
|
|
73
|
-
`));
|
|
74
|
-
}
|
|
75
|
-
if (i !== retries)
|
|
76
|
-
console.log(`${c.inverse(c.bold(c.magenta(" Retrying ")))} vitest ${args.join(" ")} ${c.gray(`(${i + 1} of ${retries})`)}`);
|
|
77
|
-
}
|
|
78
|
-
process.exit(1);
|
|
79
|
-
}
|
|
80
|
-
async function start(preArgs, postArgs) {
|
|
81
|
-
var _a;
|
|
82
|
-
const child = execa(
|
|
83
|
-
"node",
|
|
84
|
-
[
|
|
85
|
-
...preArgs,
|
|
86
|
-
fileURLToPath(ENTRY),
|
|
87
|
-
...postArgs
|
|
88
|
-
],
|
|
89
|
-
{
|
|
90
|
-
reject: false,
|
|
91
|
-
stderr: "pipe",
|
|
92
|
-
stdout: "inherit",
|
|
93
|
-
stdin: "inherit",
|
|
94
|
-
env: {
|
|
95
|
-
...process.env,
|
|
96
|
-
VITEST_CLI_WRAPPER: "true"
|
|
97
|
-
}
|
|
98
|
-
}
|
|
99
|
-
);
|
|
100
|
-
(_a = child.stderr) == null ? void 0 : _a.pipe(process.stderr);
|
|
101
|
-
const { stderr = "" } = await child;
|
|
102
|
-
if (child.exitCode === EXIT_CODE_RESTART)
|
|
103
|
-
return "restart";
|
|
104
|
-
for (const error of SegfaultErrors) {
|
|
105
|
-
if (stderr.includes(error.trigger)) {
|
|
106
|
-
if (process.env.GITHUB_ACTIONS)
|
|
107
|
-
console.log(`::warning:: Segmentfault Error Detected: ${error.trigger}
|
|
108
|
-
Refer to ${error.url}`);
|
|
109
|
-
const RED_BLOCK = c.inverse(c.red(" "));
|
|
110
|
-
console.log(`
|
|
111
|
-
${c.inverse(c.bold(c.red(" Segmentfault Error Detected ")))}
|
|
112
|
-
${RED_BLOCK} ${c.red(error.trigger)}
|
|
113
|
-
${RED_BLOCK} ${c.red(`Refer to ${error.url}`)}
|
|
114
|
-
`);
|
|
115
|
-
return "error";
|
|
116
|
-
}
|
|
117
|
-
}
|
|
118
|
-
process.exit(child.exitCode);
|
|
119
|
-
}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|