vitest 1.3.1 → 1.5.0
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 +4 -1
- package/dist/browser.js +1 -1
- package/dist/chunks/{integrations-globals.THajbSRg.js → integrations-globals.2J_Aii2q.js} +4 -4
- package/dist/chunks/{runtime-console.Iloo9fIt.js → runtime-console.kbFEN7E-.js} +16 -8
- package/dist/chunks/{runtime-runBaseTests.9RbsHRbU.js → runtime-runBaseTests.3fVSWBsC.js} +12 -10
- package/dist/cli-wrapper.js +1 -1
- package/dist/cli.js +7 -7
- package/dist/config.cjs +1 -0
- package/dist/config.d.ts +1 -1
- package/dist/config.js +1 -0
- package/dist/coverage.d.ts +1 -1
- package/dist/environments.d.ts +1 -1
- package/dist/execute.d.ts +1 -1
- package/dist/execute.js +2 -2
- package/dist/index.d.ts +4 -3
- package/dist/index.js +4 -4
- package/dist/node.d.ts +2 -2
- package/dist/node.js +7 -7
- package/dist/{reporters-MmQN-57K.d.ts → reporters-LqC_WI4d.d.ts} +233 -173
- package/dist/reporters.d.ts +1 -1
- package/dist/reporters.js +4 -4
- package/dist/runners.d.ts +2 -1
- package/dist/runners.js +10 -5
- package/dist/{suite-UrZdHRff.d.ts → suite-ynYMzeLu.d.ts} +1 -1
- package/dist/suite.d.ts +2 -2
- package/dist/utils.d.ts +5 -0
- package/dist/utils.js +6 -0
- package/dist/vendor/{base.Z38YsPLm.js → base.BjeeYg4o.js} +2 -2
- package/dist/vendor/{base.N3JkKp7j.js → base.Xt0Omgh7.js} +9 -3
- package/dist/vendor/{cac.wWT9ELdg.js → cac.qnW6GNL2.js} +258 -129
- package/dist/vendor/{constants.K-Wf1PUy.js → constants.5J7I254_.js} +2 -1
- package/dist/vendor/{execute.27Kk4lQF.js → execute.2_yoIC01.js} +1 -1
- package/dist/vendor/{index.9hqYxJUw.js → index.-ITFwqG_.js} +1 -1
- package/dist/vendor/{index.JZMafwT-.js → index.12jbrDSD.js} +1 -1
- package/dist/vendor/{index.c1V_jzyZ.js → index.kSaPvGW6.js} +69 -26
- package/dist/vendor/inspector.IgLX3ur5.js +54 -0
- package/dist/vendor/{setup-common.snyQUvE3.js → setup-common.A1De6efh.js} +8 -1
- package/dist/vendor/utils.0uYuCbzo.js +49 -0
- package/dist/vendor/{vi.C5mroSoP.js → vi.Fxjax7rQ.js} +37 -21
- package/dist/vendor/{vm.o1IruPAo.js → vm.I_IsyNig.js} +3 -3
- package/dist/worker.js +4 -26
- package/dist/workers/forks.js +5 -5
- package/dist/workers/runVmTests.js +11 -5
- package/dist/workers/threads.js +4 -4
- package/dist/workers/vmForks.js +10 -10
- package/dist/workers/vmThreads.js +9 -9
- package/dist/workers.d.ts +6 -3
- package/dist/workers.js +10 -9
- package/package.json +12 -12
- package/dist/vendor/utils.GbToHGHI.js +0 -41
package/dist/worker.js
CHANGED
|
@@ -3,11 +3,12 @@ import { workerId } from 'tinypool';
|
|
|
3
3
|
import { ViteNodeRunner, ModuleCacheMap } from 'vite-node/client';
|
|
4
4
|
import { resolve, normalize } from 'pathe';
|
|
5
5
|
import { e as environments } from './vendor/index.GVFv9dZ0.js';
|
|
6
|
-
import { i as isChildProcess, s as setProcessTitle } from './vendor/base.
|
|
7
|
-
import {
|
|
6
|
+
import { i as isChildProcess, s as setProcessTitle } from './vendor/base.Xt0Omgh7.js';
|
|
7
|
+
import { s as setupInspect } from './vendor/inspector.IgLX3ur5.js';
|
|
8
8
|
import { c as createRuntimeRpc, a as rpcDone } from './vendor/rpc.joBhAkyK.js';
|
|
9
9
|
import 'node:console';
|
|
10
10
|
import '@vitest/utils';
|
|
11
|
+
import 'node:module';
|
|
11
12
|
import './vendor/index.8bPxjt7g.js';
|
|
12
13
|
import './vendor/global.CkGT_TMy.js';
|
|
13
14
|
|
|
@@ -50,34 +51,11 @@ async function loadEnvironment(ctx, rpc) {
|
|
|
50
51
|
return environment;
|
|
51
52
|
}
|
|
52
53
|
|
|
53
|
-
const __require = createRequire(import.meta.url);
|
|
54
|
-
let inspector;
|
|
55
|
-
function setupInspect(config) {
|
|
56
|
-
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
57
|
-
const isEnabled = config.inspect || config.inspectBrk;
|
|
58
|
-
if (isEnabled) {
|
|
59
|
-
inspector = __require("node:inspector");
|
|
60
|
-
const isOpen = inspector.url() !== void 0;
|
|
61
|
-
if (!isOpen) {
|
|
62
|
-
inspector.open();
|
|
63
|
-
if (config.inspectBrk)
|
|
64
|
-
inspector.waitForDebugger();
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
const isIsolatedSingleThread = config.pool === "threads" && ((_b = (_a = config.poolOptions) == null ? void 0 : _a.threads) == null ? void 0 : _b.isolate) === false && ((_d = (_c = config.poolOptions) == null ? void 0 : _c.threads) == null ? void 0 : _d.singleThread);
|
|
68
|
-
const isIsolatedSingleFork = config.pool === "forks" && ((_f = (_e = config.poolOptions) == null ? void 0 : _e.forks) == null ? void 0 : _f.isolate) === false && ((_h = (_g = config.poolOptions) == null ? void 0 : _g.forks) == null ? void 0 : _h.singleFork);
|
|
69
|
-
const keepOpen = config.watch && (isIsolatedSingleFork || isIsolatedSingleThread);
|
|
70
|
-
return function cleanup() {
|
|
71
|
-
if (isEnabled && !keepOpen && inspector)
|
|
72
|
-
inspector.close();
|
|
73
|
-
};
|
|
74
|
-
}
|
|
75
|
-
|
|
76
54
|
if (isChildProcess())
|
|
77
55
|
setProcessTitle(`vitest ${workerId}`);
|
|
78
56
|
async function run(ctx) {
|
|
79
57
|
const prepareStart = performance.now();
|
|
80
|
-
const inspectorCleanup = setupInspect(ctx
|
|
58
|
+
const inspectorCleanup = setupInspect(ctx);
|
|
81
59
|
process.env.VITEST_WORKER_ID = String(ctx.workerId);
|
|
82
60
|
process.env.VITEST_POOL_ID = String(workerId);
|
|
83
61
|
try {
|
package/dist/workers/forks.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import v8 from 'node:v8';
|
|
2
|
-
import { c as createForksRpcOptions, u as
|
|
3
|
-
import { r as runBaseTests } from '../vendor/base.
|
|
2
|
+
import { c as createForksRpcOptions, u as unwrapSerializableConfig } from '../vendor/utils.0uYuCbzo.js';
|
|
3
|
+
import { r as runBaseTests } from '../vendor/base.BjeeYg4o.js';
|
|
4
4
|
import '@vitest/utils';
|
|
5
5
|
import 'vite-node/client';
|
|
6
6
|
import '../vendor/global.CkGT_TMy.js';
|
|
7
|
-
import '../vendor/execute.
|
|
7
|
+
import '../vendor/execute.2_yoIC01.js';
|
|
8
8
|
import 'node:vm';
|
|
9
9
|
import 'node:url';
|
|
10
10
|
import 'vite-node/utils';
|
|
@@ -12,7 +12,7 @@ import 'pathe';
|
|
|
12
12
|
import '@vitest/utils/error';
|
|
13
13
|
import '../path.js';
|
|
14
14
|
import 'node:fs';
|
|
15
|
-
import '../vendor/base.
|
|
15
|
+
import '../vendor/base.Xt0Omgh7.js';
|
|
16
16
|
|
|
17
17
|
class ForksBaseWorker {
|
|
18
18
|
getRpcOptions() {
|
|
@@ -20,7 +20,7 @@ class ForksBaseWorker {
|
|
|
20
20
|
}
|
|
21
21
|
async runTests(state) {
|
|
22
22
|
const exit = process.exit;
|
|
23
|
-
state.ctx.config =
|
|
23
|
+
state.ctx.config = unwrapSerializableConfig(state.ctx.config);
|
|
24
24
|
try {
|
|
25
25
|
await runBaseTests(state);
|
|
26
26
|
} finally {
|
|
@@ -6,11 +6,12 @@ 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 { V as VitestSnapshotEnvironment, s as setupChaiConfig, r as resolveTestRunner } from '../vendor/index.
|
|
9
|
+
import { V as VitestSnapshotEnvironment, s as setupChaiConfig, r as resolveTestRunner } from '../vendor/index.-ITFwqG_.js';
|
|
10
10
|
import { a as startCoverageInsideWorker, s as stopCoverageInsideWorker } from '../vendor/coverage.E7sG1b3r.js';
|
|
11
11
|
import { g as getWorkerState } from '../vendor/global.CkGT_TMy.js';
|
|
12
|
-
import { V as VitestIndex } from '../vendor/index.
|
|
13
|
-
import { s as setupCommonEnv } from '../vendor/setup-common.
|
|
12
|
+
import { V as VitestIndex } from '../vendor/index.12jbrDSD.js';
|
|
13
|
+
import { s as setupCommonEnv } from '../vendor/setup-common.A1De6efh.js';
|
|
14
|
+
import { c as closeInspector } from '../vendor/inspector.IgLX3ur5.js';
|
|
14
15
|
import 'chai';
|
|
15
16
|
import '@vitest/snapshot/environment';
|
|
16
17
|
import 'pathe';
|
|
@@ -23,14 +24,14 @@ import '@vitest/runner/utils';
|
|
|
23
24
|
import '../vendor/index.ir9i0ywP.js';
|
|
24
25
|
import 'std-env';
|
|
25
26
|
import '../vendor/run-once.Olz_Zkd8.js';
|
|
26
|
-
import '../vendor/vi.
|
|
27
|
+
import '../vendor/vi.Fxjax7rQ.js';
|
|
27
28
|
import '../vendor/_commonjsHelpers.jjO7Zipk.js';
|
|
28
29
|
import '@vitest/expect';
|
|
29
30
|
import '@vitest/snapshot';
|
|
30
31
|
import '@vitest/utils/error';
|
|
31
32
|
import '../vendor/tasks.IknbGB2n.js';
|
|
32
33
|
import '@vitest/utils/source-map';
|
|
33
|
-
import '../vendor/base.
|
|
34
|
+
import '../vendor/base.Xt0Omgh7.js';
|
|
34
35
|
import '../vendor/date.Ns1pGd_X.js';
|
|
35
36
|
import '@vitest/spy';
|
|
36
37
|
|
|
@@ -61,6 +62,11 @@ async function run(files, config, executor) {
|
|
|
61
62
|
if (config.chaiConfig)
|
|
62
63
|
setupChaiConfig(config.chaiConfig);
|
|
63
64
|
const runner = await resolveTestRunner(config, executor);
|
|
65
|
+
workerState.onCancel.then((reason) => {
|
|
66
|
+
var _a;
|
|
67
|
+
closeInspector(config);
|
|
68
|
+
(_a = runner.onCancel) == null ? void 0 : _a.call(runner, reason);
|
|
69
|
+
});
|
|
64
70
|
workerState.durations.prepare = performance.now() - workerState.durations.prepare;
|
|
65
71
|
const { vi } = VitestIndex;
|
|
66
72
|
for (const file of files) {
|
package/dist/workers/threads.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { r as runBaseTests } from '../vendor/base.
|
|
2
|
-
import { a as createThreadsRpcOptions } from '../vendor/utils.
|
|
1
|
+
import { r as runBaseTests } from '../vendor/base.BjeeYg4o.js';
|
|
2
|
+
import { a as createThreadsRpcOptions } from '../vendor/utils.0uYuCbzo.js';
|
|
3
3
|
import 'vite-node/client';
|
|
4
4
|
import '../vendor/global.CkGT_TMy.js';
|
|
5
|
-
import '../vendor/execute.
|
|
5
|
+
import '../vendor/execute.2_yoIC01.js';
|
|
6
6
|
import 'node:vm';
|
|
7
7
|
import 'node:url';
|
|
8
8
|
import 'vite-node/utils';
|
|
@@ -11,7 +11,7 @@ import '@vitest/utils/error';
|
|
|
11
11
|
import '../path.js';
|
|
12
12
|
import 'node:fs';
|
|
13
13
|
import '@vitest/utils';
|
|
14
|
-
import '../vendor/base.
|
|
14
|
+
import '../vendor/base.Xt0Omgh7.js';
|
|
15
15
|
|
|
16
16
|
class ThreadsBaseWorker {
|
|
17
17
|
getRpcOptions(ctx) {
|
package/dist/workers/vmForks.js
CHANGED
|
@@ -1,28 +1,28 @@
|
|
|
1
1
|
import v8 from 'node:v8';
|
|
2
|
-
import { c as createForksRpcOptions, u as
|
|
3
|
-
import { r as runVmTests } from '../vendor/vm.
|
|
2
|
+
import { c as createForksRpcOptions, u as unwrapSerializableConfig } from '../vendor/utils.0uYuCbzo.js';
|
|
3
|
+
import { r as runVmTests } from '../vendor/vm.I_IsyNig.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.kbFEN7E-.js';
|
|
9
9
|
import 'node:stream';
|
|
10
10
|
import 'node:console';
|
|
11
11
|
import 'node:path';
|
|
12
12
|
import '../vendor/date.Ns1pGd_X.js';
|
|
13
|
-
import '../vendor/
|
|
13
|
+
import '../vendor/index.ir9i0ywP.js';
|
|
14
|
+
import 'std-env';
|
|
15
|
+
import '@vitest/runner/utils';
|
|
16
|
+
import '../vendor/global.CkGT_TMy.js';
|
|
17
|
+
import '../vendor/execute.2_yoIC01.js';
|
|
14
18
|
import 'vite-node/client';
|
|
15
19
|
import 'vite-node/utils';
|
|
16
20
|
import '@vitest/utils/error';
|
|
17
21
|
import '../path.js';
|
|
18
22
|
import 'node:fs';
|
|
19
|
-
import '../vendor/base.
|
|
23
|
+
import '../vendor/base.Xt0Omgh7.js';
|
|
20
24
|
import 'node:module';
|
|
21
25
|
import 'vite-node/constants';
|
|
22
|
-
import '../vendor/index.ir9i0ywP.js';
|
|
23
|
-
import 'std-env';
|
|
24
|
-
import '@vitest/runner/utils';
|
|
25
|
-
import '../vendor/global.CkGT_TMy.js';
|
|
26
26
|
|
|
27
27
|
class ForksVmWorker {
|
|
28
28
|
getRpcOptions() {
|
|
@@ -30,7 +30,7 @@ class ForksVmWorker {
|
|
|
30
30
|
}
|
|
31
31
|
async runTests(state) {
|
|
32
32
|
const exit = process.exit;
|
|
33
|
-
state.ctx.config =
|
|
33
|
+
state.ctx.config = unwrapSerializableConfig(state.ctx.config);
|
|
34
34
|
try {
|
|
35
35
|
await runVmTests(state);
|
|
36
36
|
} finally {
|
|
@@ -1,27 +1,27 @@
|
|
|
1
|
-
import { a as createThreadsRpcOptions } from '../vendor/utils.
|
|
2
|
-
import { r as runVmTests } from '../vendor/vm.
|
|
1
|
+
import { a as createThreadsRpcOptions } from '../vendor/utils.0uYuCbzo.js';
|
|
2
|
+
import { r as runVmTests } from '../vendor/vm.I_IsyNig.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.kbFEN7E-.js';
|
|
8
8
|
import 'node:stream';
|
|
9
9
|
import 'node:console';
|
|
10
10
|
import 'node:path';
|
|
11
11
|
import '../vendor/date.Ns1pGd_X.js';
|
|
12
|
-
import '../vendor/
|
|
12
|
+
import '../vendor/index.ir9i0ywP.js';
|
|
13
|
+
import 'std-env';
|
|
14
|
+
import '@vitest/runner/utils';
|
|
15
|
+
import '../vendor/global.CkGT_TMy.js';
|
|
16
|
+
import '../vendor/execute.2_yoIC01.js';
|
|
13
17
|
import 'vite-node/client';
|
|
14
18
|
import 'vite-node/utils';
|
|
15
19
|
import '@vitest/utils/error';
|
|
16
20
|
import '../path.js';
|
|
17
21
|
import 'node:fs';
|
|
18
|
-
import '../vendor/base.
|
|
22
|
+
import '../vendor/base.Xt0Omgh7.js';
|
|
19
23
|
import 'node:module';
|
|
20
24
|
import 'vite-node/constants';
|
|
21
|
-
import '../vendor/index.ir9i0ywP.js';
|
|
22
|
-
import 'std-env';
|
|
23
|
-
import '@vitest/runner/utils';
|
|
24
|
-
import '../vendor/global.CkGT_TMy.js';
|
|
25
25
|
|
|
26
26
|
class ThreadsVmWorker {
|
|
27
27
|
getRpcOptions(ctx) {
|
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-LqC_WI4d.js';
|
|
3
3
|
import { Awaitable } from '@vitest/utils';
|
|
4
4
|
import 'vite';
|
|
5
5
|
import '@vitest/runner';
|
|
@@ -23,7 +23,10 @@ interface VitestWorker {
|
|
|
23
23
|
|
|
24
24
|
declare function createThreadsRpcOptions({ port }: WorkerContext): WorkerRpcOptions;
|
|
25
25
|
declare function createForksRpcOptions(nodeV8: typeof v8): WorkerRpcOptions;
|
|
26
|
-
|
|
26
|
+
/**
|
|
27
|
+
* Reverts the wrapping done by `utils/config-helpers.ts`'s `wrapSerializableConfig`
|
|
28
|
+
*/
|
|
29
|
+
declare function unwrapSerializableConfig(config: ResolvedConfig): ResolvedConfig;
|
|
27
30
|
|
|
28
31
|
declare function provideWorkerState(context: any, state: WorkerGlobalState): WorkerGlobalState;
|
|
29
32
|
|
|
@@ -33,4 +36,4 @@ declare function runVmTests(state: WorkerGlobalState): Promise<void>;
|
|
|
33
36
|
|
|
34
37
|
declare function runBaseTests(state: WorkerGlobalState): Promise<void>;
|
|
35
38
|
|
|
36
|
-
export { type VitestWorker, type WorkerRpcOptions, createForksRpcOptions, createThreadsRpcOptions, provideWorkerState, runBaseTests, run as runVitestWorker, runVmTests,
|
|
39
|
+
export { type VitestWorker, type WorkerRpcOptions, createForksRpcOptions, createThreadsRpcOptions, provideWorkerState, runBaseTests, run as runVitestWorker, runVmTests, unwrapSerializableConfig };
|
package/dist/workers.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
export { c as createForksRpcOptions, a as createThreadsRpcOptions, u as
|
|
1
|
+
export { c as createForksRpcOptions, a as createThreadsRpcOptions, u as unwrapSerializableConfig } from './vendor/utils.0uYuCbzo.js';
|
|
2
2
|
export { p as provideWorkerState } from './vendor/global.CkGT_TMy.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.I_IsyNig.js';
|
|
5
|
+
export { r as runBaseTests } from './vendor/base.BjeeYg4o.js';
|
|
6
6
|
import '@vitest/utils';
|
|
7
7
|
import 'node:url';
|
|
8
8
|
import 'tinypool';
|
|
@@ -10,21 +10,22 @@ import 'vite-node/client';
|
|
|
10
10
|
import 'pathe';
|
|
11
11
|
import './vendor/index.GVFv9dZ0.js';
|
|
12
12
|
import 'node:console';
|
|
13
|
-
import './vendor/base.
|
|
13
|
+
import './vendor/base.Xt0Omgh7.js';
|
|
14
|
+
import './vendor/inspector.IgLX3ur5.js';
|
|
14
15
|
import 'node:module';
|
|
15
16
|
import './vendor/rpc.joBhAkyK.js';
|
|
16
17
|
import './vendor/index.8bPxjt7g.js';
|
|
17
18
|
import 'node:vm';
|
|
18
|
-
import './chunks/runtime-console.
|
|
19
|
+
import './chunks/runtime-console.kbFEN7E-.js';
|
|
19
20
|
import 'node:stream';
|
|
20
21
|
import 'node:path';
|
|
21
22
|
import './vendor/date.Ns1pGd_X.js';
|
|
22
|
-
import './vendor/
|
|
23
|
+
import './vendor/index.ir9i0ywP.js';
|
|
24
|
+
import 'std-env';
|
|
25
|
+
import '@vitest/runner/utils';
|
|
26
|
+
import './vendor/execute.2_yoIC01.js';
|
|
23
27
|
import 'vite-node/utils';
|
|
24
28
|
import '@vitest/utils/error';
|
|
25
29
|
import './path.js';
|
|
26
30
|
import 'node:fs';
|
|
27
31
|
import 'vite-node/constants';
|
|
28
|
-
import './vendor/index.ir9i0ywP.js';
|
|
29
|
-
import 'std-env';
|
|
30
|
-
import '@vitest/runner/utils';
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vitest",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "1.
|
|
4
|
+
"version": "1.5.0",
|
|
5
5
|
"description": "Next generation testing framework powered by Vite",
|
|
6
6
|
"author": "Anthony Fu <anthonyfu117@hotmail.com>",
|
|
7
7
|
"license": "MIT",
|
|
@@ -115,8 +115,8 @@
|
|
|
115
115
|
"@types/node": "^18.0.0 || >=20.0.0",
|
|
116
116
|
"happy-dom": "*",
|
|
117
117
|
"jsdom": "*",
|
|
118
|
-
"@vitest/
|
|
119
|
-
"@vitest/
|
|
118
|
+
"@vitest/ui": "1.5.0",
|
|
119
|
+
"@vitest/browser": "1.5.0"
|
|
120
120
|
},
|
|
121
121
|
"peerDependenciesMeta": {
|
|
122
122
|
"@edge-runtime/vm": {
|
|
@@ -150,15 +150,15 @@
|
|
|
150
150
|
"std-env": "^3.5.0",
|
|
151
151
|
"strip-literal": "^2.0.0",
|
|
152
152
|
"tinybench": "^2.5.1",
|
|
153
|
-
"tinypool": "^0.8.
|
|
153
|
+
"tinypool": "^0.8.3",
|
|
154
154
|
"vite": "^5.0.0",
|
|
155
155
|
"why-is-node-running": "^2.2.2",
|
|
156
|
-
"@vitest/expect": "1.
|
|
157
|
-
"@vitest/
|
|
158
|
-
"@vitest/
|
|
159
|
-
"@vitest/
|
|
160
|
-
"
|
|
161
|
-
"
|
|
156
|
+
"@vitest/expect": "1.5.0",
|
|
157
|
+
"@vitest/snapshot": "1.5.0",
|
|
158
|
+
"@vitest/spy": "1.5.0",
|
|
159
|
+
"@vitest/utils": "1.5.0",
|
|
160
|
+
"vite-node": "1.5.0",
|
|
161
|
+
"@vitest/runner": "1.5.0"
|
|
162
162
|
},
|
|
163
163
|
"devDependencies": {
|
|
164
164
|
"@ampproject/remapping": "^2.2.1",
|
|
@@ -181,8 +181,8 @@
|
|
|
181
181
|
"fast-glob": "^3.3.2",
|
|
182
182
|
"find-up": "^6.3.0",
|
|
183
183
|
"flatted": "^3.2.9",
|
|
184
|
-
"get-tsconfig": "^4.7.
|
|
185
|
-
"happy-dom": "^
|
|
184
|
+
"get-tsconfig": "^4.7.3",
|
|
185
|
+
"happy-dom": "^14.3.10",
|
|
186
186
|
"jsdom": "^24.0.0",
|
|
187
187
|
"log-update": "^5.0.1",
|
|
188
188
|
"micromatch": "^4.0.5",
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import { parseRegexp } from '@vitest/utils';
|
|
2
|
-
|
|
3
|
-
function createThreadsRpcOptions({ port }) {
|
|
4
|
-
return {
|
|
5
|
-
post: (v) => {
|
|
6
|
-
port.postMessage(v);
|
|
7
|
-
},
|
|
8
|
-
on: (fn) => {
|
|
9
|
-
port.addListener("message", fn);
|
|
10
|
-
}
|
|
11
|
-
};
|
|
12
|
-
}
|
|
13
|
-
function createForksRpcOptions(nodeV8) {
|
|
14
|
-
return {
|
|
15
|
-
serialize: nodeV8.serialize,
|
|
16
|
-
deserialize: (v) => nodeV8.deserialize(Buffer.from(v)),
|
|
17
|
-
post(v) {
|
|
18
|
-
process.send(v);
|
|
19
|
-
},
|
|
20
|
-
on(fn) {
|
|
21
|
-
process.on("message", (message, ...extras) => {
|
|
22
|
-
if (message == null ? void 0 : message.__tinypool_worker_message__)
|
|
23
|
-
return;
|
|
24
|
-
return fn(message, ...extras);
|
|
25
|
-
});
|
|
26
|
-
}
|
|
27
|
-
};
|
|
28
|
-
}
|
|
29
|
-
function parsePossibleRegexp(str) {
|
|
30
|
-
const prefix = "$$vitest:";
|
|
31
|
-
if (typeof str === "string" && str.startsWith(prefix))
|
|
32
|
-
return parseRegexp(str.slice(prefix.length));
|
|
33
|
-
return str;
|
|
34
|
-
}
|
|
35
|
-
function unwrapForksConfig(config) {
|
|
36
|
-
if (config.testNamePattern)
|
|
37
|
-
config.testNamePattern = parsePossibleRegexp(config.testNamePattern);
|
|
38
|
-
return config;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
export { createThreadsRpcOptions as a, createForksRpcOptions as c, unwrapForksConfig as u };
|