vitest 1.6.0 → 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.vcoXCoKs.js → environments-node.39w4gmlF.js} +2 -2
- 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.oAvMKtQC.js → runtime-runBaseTests._dXkRAZc.js} +18 -18
- package/dist/cli.js +3 -3
- package/dist/config.cjs +1 -2
- package/dist/config.d.ts +1 -1
- package/dist/config.js +1 -2
- 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 +2 -1
- package/dist/execute.js +2 -2
- package/dist/index.d.ts +769 -21
- package/dist/index.js +12 -12
- package/dist/node.d.ts +2 -2
- package/dist/node.js +20 -21
- package/dist/{reporters-yx5ZTtEV.d.ts → reporters-MGvT5U9f.d.ts} +28 -31
- package/dist/reporters.d.ts +1 -1
- package/dist/reporters.js +10 -11
- package/dist/runners.d.ts +1 -1
- package/dist/runners.js +17 -18
- package/dist/snapshot.js +3 -3
- package/dist/{suite-IbNSsUWN.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.Ybri3C14.js → base.VFkIJ66g.js} +3 -3
- package/dist/vendor/{base.5NT-gWu5.js → base._gnK9Slw.js} +1 -2
- package/dist/vendor/{benchmark.yGkUTKnC.js → benchmark.BNLebNi5.js} +1 -1
- package/dist/vendor/{cac.EdDItJD-.js → cac.DzKZaJu2.js} +5 -6
- package/dist/vendor/{cli-api.E07AF1Yq.js → cli-api.DTeni0Qq.js} +3060 -361
- package/dist/vendor/{execute.fL3szUAI.js → execute.CLLNVNnK.js} +1 -1
- package/dist/vendor/{index.DpVgvm2P.js → index.BfoZyXD1.js} +5 -5
- package/dist/vendor/{index.8bPxjt7g.js → index.BpSiYbpB.js} +5 -1
- package/dist/vendor/{index.Q04MCqDO.js → index.CRxYS9H3.js} +414 -113
- package/dist/vendor/{index.dI9lHwVn.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.8nJLd4ay.js → setup-common.XeoZAW8t.js} +2 -2
- package/dist/vendor/{tasks.IknbGB2n.js → tasks.WC7M-K-v.js} +4 -1
- package/dist/vendor/{utils.dEtNIEgr.js → utils.D5gGkwyH.js} +1 -1
- package/dist/vendor/{vi.YFlodzP_.js → vi.ClD3hi7L.js} +23 -10
- package/dist/vendor/{vm.QEE48c0T.js → vm.Bi3bljci.js} +47 -59
- package/dist/worker.js +6 -6
- package/dist/workers/forks.js +5 -5
- package/dist/workers/runVmTests.js +17 -17
- package/dist/workers/threads.js +5 -5
- package/dist/workers/vmForks.js +8 -8
- package/dist/workers/vmThreads.js +8 -8
- package/dist/workers.d.ts +1 -1
- package/dist/workers.js +13 -13
- package/package.json +29 -29
- package/vitest.mjs +1 -1
- package/dist/chunks/integrations-globals.kw4co3rx.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
|
@@ -7,7 +7,7 @@ import { resolve, isAbsolute, dirname, join, basename, extname, normalize, relat
|
|
|
7
7
|
import { processError } from '@vitest/utils/error';
|
|
8
8
|
import { distDir } from '../path.js';
|
|
9
9
|
import { highlight, getType } from '@vitest/utils';
|
|
10
|
-
import { g as getAllMockableProperties } from './base.
|
|
10
|
+
import { g as getAllMockableProperties } from './base._gnK9Slw.js';
|
|
11
11
|
|
|
12
12
|
const spyModulePath = resolve(distDir, "spy.js");
|
|
13
13
|
class RefTracker {
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import * as chai from 'chai';
|
|
2
2
|
import { resolve } from 'pathe';
|
|
3
3
|
import { distDir } from '../path.js';
|
|
4
|
-
import { g as getWorkerState } from './global.
|
|
5
|
-
import { r as rpc } from './rpc.
|
|
6
|
-
import { t as takeCoverageInsideWorker } from './coverage.
|
|
7
|
-
import { l as loadDiffConfig, a as loadSnapshotSerializers } from './setup-common.
|
|
4
|
+
import { g as getWorkerState } from './global.7bFbnyXl.js';
|
|
5
|
+
import { r as rpc } from './rpc.DRDE9Pu1.js';
|
|
6
|
+
import { t as takeCoverageInsideWorker } from './coverage.ChSqD-qS.js';
|
|
7
|
+
import { l as loadDiffConfig, a as loadSnapshotSerializers } from './setup-common.XeoZAW8t.js';
|
|
8
8
|
|
|
9
9
|
function setupChaiConfig(config) {
|
|
10
10
|
Object.assign(chai.config, config);
|
|
@@ -12,7 +12,7 @@ function setupChaiConfig(config) {
|
|
|
12
12
|
|
|
13
13
|
async function resolveSnapshotEnvironment(config, executor) {
|
|
14
14
|
if (!config.snapshotEnvironment) {
|
|
15
|
-
const { VitestNodeSnapshotEnvironment } = await import('../chunks/environments-node.
|
|
15
|
+
const { VitestNodeSnapshotEnvironment } = await import('../chunks/environments-node.39w4gmlF.js');
|
|
16
16
|
return new VitestNodeSnapshotEnvironment();
|
|
17
17
|
}
|
|
18
18
|
const mod = await executor.executeId(config.snapshotEnvironment);
|
|
@@ -21,6 +21,8 @@ function createBirpc(functions, options) {
|
|
|
21
21
|
get(_, method) {
|
|
22
22
|
if (method === "$functions")
|
|
23
23
|
return functions;
|
|
24
|
+
if (method === "then" && !eventNames.includes("then") && !("then" in functions))
|
|
25
|
+
return void 0;
|
|
24
26
|
const sendEvent = (...args) => {
|
|
25
27
|
post(serialize({ m: method, a: args, t: "q" }));
|
|
26
28
|
};
|
|
@@ -42,7 +44,9 @@ function createBirpc(functions, options) {
|
|
|
42
44
|
reject(e);
|
|
43
45
|
}
|
|
44
46
|
rpcPromiseMap.delete(id);
|
|
45
|
-
}, timeout)
|
|
47
|
+
}, timeout);
|
|
48
|
+
if (typeof timeoutId === "object")
|
|
49
|
+
timeoutId = timeoutId.unref?.();
|
|
46
50
|
}
|
|
47
51
|
rpcPromiseMap.set(id, { resolve, reject, timeoutId });
|
|
48
52
|
post(serialize({ m: method, a: args, i: id, t: "q" }));
|