vitest 2.0.0-beta.9 → 2.0.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 +1 -22
- package/dist/browser.d.ts +24 -7
- package/dist/browser.js +5 -19
- package/dist/chunks/browser-creator.DSqYDthP.js +673 -0
- package/dist/chunks/{environments-node.39w4gmlF.js → environments-node.XE5FbRPQ.js} +1 -1
- package/dist/chunks/{integrations-globals.BK0Cn4q1.js → integrations-globals.CzYWb38r.js} +10 -9
- package/dist/chunks/{node-git.CCI8evVZ.js → node-git.ZtkbKc8u.js} +14 -15
- package/dist/chunks/{runtime-console.DiVMr5d4.js → runtime-console.O41g23Zj.js} +26 -11
- package/dist/chunks/{runtime-runBaseTests.C-Bkopka.js → runtime-runBaseTests.DX3h28Mp.js} +47 -34
- package/dist/cli.js +3 -3
- package/dist/config.cjs +48 -23
- package/dist/config.d.ts +2 -1
- package/dist/config.js +48 -24
- package/dist/coverage.d.ts +6 -4
- package/dist/coverage.js +102 -38
- package/dist/environments.d.ts +2 -1
- package/dist/environments.js +1 -1
- package/dist/execute.d.ts +4 -3
- package/dist/execute.js +2 -2
- package/dist/index.d.ts +1437 -7
- package/dist/index.js +10 -9
- package/dist/node.d.ts +34 -7
- package/dist/node.js +31 -20
- package/dist/path.js +4 -1
- package/dist/{reporters-DaDey3o0.d.ts → reporters-BU_vXAUX.d.ts} +216 -206
- package/dist/reporters.d.ts +2 -1
- package/dist/reporters.js +8 -8
- package/dist/runners.d.ts +3 -1
- package/dist/runners.js +100 -61
- package/dist/snapshot.js +2 -2
- package/dist/{suite-BHSUxUib.d.ts → suite-BRl_IYuM.d.ts} +1 -1
- package/dist/suite.d.ts +3 -2
- package/dist/suite.js +3 -3
- package/dist/utils.d.ts +1 -5
- package/dist/utils.js +1 -6
- package/dist/vendor/{base._gnK9Slw.js → base.CTYV4Gnz.js} +24 -17
- package/dist/vendor/{base.D4XK-wRp.js → base.CdA1i5tB.js} +6 -4
- package/dist/vendor/{benchmark.BNLebNi5.js → benchmark.B6pblCp2.js} +13 -14
- package/dist/vendor/{cac.DCg3FnEs.js → cac.BQc6bsef.js} +142 -47
- package/dist/vendor/{cli-api.LMvYagQ5.js → cli-api.BGRtK_Kj.js} +4189 -9537
- package/dist/vendor/{constants.TCjCaw2D.js → constants.CsnA4eRy.js} +5 -23
- package/dist/vendor/{coverage.ChSqD-qS.js → coverage.BhYSDdTT.js} +27 -11
- package/dist/vendor/{date.BKM1wewY.js → date.W2xKR2qe.js} +5 -3
- package/dist/vendor/env.2ltrQNq0.js +8 -0
- package/dist/vendor/{execute.BHj6OMh4.js → execute.Dx503nGn.js} +186 -64
- package/dist/vendor/{index.TBU3GqRP.js → index.3x3MdmUV.js} +1075 -526
- package/dist/vendor/{index._7XLd8Kd.js → index.BJmtb_7W.js} +3 -2
- package/dist/vendor/{index.DP-km6lF.js → index.BMmMjLIQ.js} +64 -51
- package/dist/vendor/{index.DHRpy7zp.js → index.CROIsoiT.js} +18 -10
- package/dist/vendor/{index.DeR1hhfY.js → index.D4nqnQWz.js} +71 -74
- package/dist/vendor/index.D6GZqexG.js +6575 -0
- package/dist/vendor/{index.DwR86H5i.js → index.Hqvcg1pf.js} +4 -27
- package/dist/vendor/{rpc.DRDE9Pu1.js → rpc.BGx7q_k2.js} +30 -19
- package/dist/vendor/run-once.Db8Hgq9X.js +28 -0
- package/dist/vendor/{setup-common.BhJvzjns.js → setup-common.yHaxjRhz.js} +30 -15
- package/dist/vendor/spy.Cf_4R5Oe.js +22 -0
- package/dist/vendor/{tasks.WC7M-K-v.js → tasks.DhVtQBtW.js} +3 -1
- package/dist/vendor/{utils.YuQ3LT2a.js → utils.BVMrsl6E.js} +55 -30
- package/dist/vendor/{utils.CUjzkRH7.js → utils.DkxLWvS1.js} +12 -5
- package/dist/vendor/{vi.C6AfDXK6.js → vi.DXACdGTu.js} +269 -136
- package/dist/vendor/{vm.Ow-X2mkS.js → vm.BrDS6p7h.js} +157 -90
- package/dist/worker.js +41 -18
- package/dist/workers/forks.js +12 -6
- package/dist/workers/runVmTests.js +22 -16
- package/dist/workers/threads.js +8 -5
- package/dist/workers/vmForks.js +15 -9
- package/dist/workers/vmThreads.js +11 -8
- package/dist/workers.d.ts +8 -5
- package/dist/workers.js +11 -11
- package/package.json +22 -21
- package/suppress-warnings.cjs +2 -4
- package/dist/index-B0dCycbN.d.ts +0 -1571
- package/dist/vendor/env.bmJgw1qP.js +0 -7
package/dist/index.js
CHANGED
|
@@ -1,26 +1,27 @@
|
|
|
1
1
|
export { afterAll, afterEach, beforeAll, beforeEach, describe, it, onTestFailed, onTestFinished, suite, test } from '@vitest/runner';
|
|
2
|
-
export { b as bench } from './vendor/benchmark.
|
|
3
|
-
|
|
4
|
-
export {
|
|
5
|
-
|
|
2
|
+
export { b as bench } from './vendor/benchmark.B6pblCp2.js';
|
|
3
|
+
export { i as isFirstRun, a as runOnce } from './vendor/run-once.Db8Hgq9X.js';
|
|
4
|
+
export { c as createExpect, a as expect, v as vi, b as vitest } from './vendor/vi.DXACdGTu.js';
|
|
5
|
+
import { d as dist } from './vendor/index.Hqvcg1pf.js';
|
|
6
|
+
export { b as assertType, g as getRunningMode, i as inject, a as isWatchMode } from './vendor/index.Hqvcg1pf.js';
|
|
6
7
|
import * as chai from 'chai';
|
|
7
8
|
export { chai };
|
|
8
9
|
export { assert, should } from 'chai';
|
|
9
10
|
import '@vitest/runner/utils';
|
|
10
11
|
import '@vitest/utils';
|
|
11
|
-
import './vendor/index.
|
|
12
|
+
import './vendor/index.BJmtb_7W.js';
|
|
12
13
|
import 'pathe';
|
|
13
14
|
import './vendor/global.7bFbnyXl.js';
|
|
14
|
-
import './vendor/env.
|
|
15
|
+
import './vendor/env.2ltrQNq0.js';
|
|
15
16
|
import 'std-env';
|
|
16
17
|
import './vendor/_commonjsHelpers.BFTU3MAI.js';
|
|
17
18
|
import '@vitest/expect';
|
|
18
19
|
import '@vitest/snapshot';
|
|
19
20
|
import '@vitest/utils/error';
|
|
20
|
-
import './vendor/tasks.
|
|
21
|
+
import './vendor/tasks.DhVtQBtW.js';
|
|
21
22
|
import '@vitest/utils/source-map';
|
|
22
|
-
import './vendor/base.
|
|
23
|
-
import './vendor/date.
|
|
23
|
+
import './vendor/base.CTYV4Gnz.js';
|
|
24
|
+
import './vendor/date.W2xKR2qe.js';
|
|
24
25
|
import '@vitest/spy';
|
|
25
26
|
|
|
26
27
|
|
package/dist/node.d.ts
CHANGED
|
@@ -1,8 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export {
|
|
3
|
-
import { UserConfig as UserConfig$1, Plugin } from 'vite';
|
|
4
|
-
|
|
1
|
+
import { v as VitestRunMode, U as UserConfig, aj as VitestOptions, Q as Vitest, R as ResolvedConfig, i as ProvidedContext, ak as WorkspaceProject, e as RuntimeRPC, A as ApiConfig, al as Logger, am as TestSequencer, an as WorkspaceSpec } from './reporters-BU_vXAUX.js';
|
|
2
|
+
export { ay as BrowserBuiltinProvider, az as BrowserCommand, aA as BrowserCommandContext, aE as BrowserOrchestrator, at as BrowserProvider, as as BrowserProviderInitializationOptions, av as BrowserProviderModule, ax as BrowserProviderOptions, z as BrowserScript, aB as BrowserServer, aC as BrowserServerState, aD as BrowserServerStateContext, au as CDPSession, aH as HTMLOptions, aG as JUnitOptions, aF as JsonOptions, ao as ProcessPool, aw as ResolvedBrowserOptions, ar as TestSequencerConstructor, aq as VitestPackageInstaller, ap as getFilePoolName } from './reporters-BU_vXAUX.js';
|
|
3
|
+
import { UserConfig as UserConfig$1, Plugin, ResolvedConfig as ResolvedConfig$1 } from 'vite';
|
|
4
|
+
import * as vite from 'vite';
|
|
5
|
+
export { vite as Vite };
|
|
6
|
+
export { createServer, isFileServingAllowed, parseAst, parseAstAsync } from 'vite';
|
|
5
7
|
import { Writable } from 'node:stream';
|
|
8
|
+
import createDebug from 'debug';
|
|
6
9
|
import '@vitest/runner';
|
|
7
10
|
import 'vite-node';
|
|
8
11
|
import '@vitest/snapshot';
|
|
@@ -14,6 +17,7 @@ import 'vite-node/client';
|
|
|
14
17
|
import '@vitest/snapshot/manager';
|
|
15
18
|
import 'vite-node/server';
|
|
16
19
|
import 'node:worker_threads';
|
|
20
|
+
import '@vitest/utils/source-map';
|
|
17
21
|
import 'node:fs';
|
|
18
22
|
import 'chai';
|
|
19
23
|
|
|
@@ -30,6 +34,10 @@ interface CliOptions extends UserConfig {
|
|
|
30
34
|
* Removes colors from the console output
|
|
31
35
|
*/
|
|
32
36
|
color?: boolean;
|
|
37
|
+
/**
|
|
38
|
+
* Output collected tests as JSON or to a file
|
|
39
|
+
*/
|
|
40
|
+
json?: string | boolean;
|
|
33
41
|
}
|
|
34
42
|
/**
|
|
35
43
|
* Start Vitest programmatically
|
|
@@ -50,10 +58,29 @@ declare function registerConsoleShortcuts(ctx: Vitest, stdin: NodeJS.ReadStream
|
|
|
50
58
|
|
|
51
59
|
interface GlobalSetupContext {
|
|
52
60
|
config: ResolvedConfig;
|
|
53
|
-
provide: <T extends keyof ProvidedContext>(key: T, value: ProvidedContext[T]) => void;
|
|
61
|
+
provide: <T extends keyof ProvidedContext & string>(key: T, value: ProvidedContext[T]) => void;
|
|
54
62
|
}
|
|
55
63
|
|
|
56
|
-
|
|
64
|
+
interface MethodsOptions {
|
|
65
|
+
cacheFs?: boolean;
|
|
66
|
+
}
|
|
67
|
+
declare function createMethodsRPC(project: WorkspaceProject, options?: MethodsOptions): RuntimeRPC;
|
|
68
|
+
|
|
69
|
+
declare function createDebugger(namespace: `vitest:${string}`): createDebug.Debugger | undefined;
|
|
70
|
+
|
|
71
|
+
declare function resolveFsAllow(projectRoot: string, rootConfigFile: string | false | undefined): string[];
|
|
72
|
+
|
|
73
|
+
declare function resolveApiServerConfig<Options extends ApiConfig & UserConfig>(options: Options, defaultPort: number): ApiConfig | undefined;
|
|
74
|
+
declare function resolveConfig(mode: VitestRunMode, options: UserConfig, viteConfig: ResolvedConfig$1, logger: Logger): ResolvedConfig;
|
|
75
|
+
|
|
76
|
+
declare class FilesNotFoundError extends Error {
|
|
77
|
+
code: string;
|
|
78
|
+
constructor(mode: 'test' | 'benchmark');
|
|
79
|
+
}
|
|
80
|
+
declare class GitNotFoundError extends Error {
|
|
81
|
+
code: string;
|
|
82
|
+
constructor();
|
|
83
|
+
}
|
|
57
84
|
|
|
58
85
|
declare const rootDir: string;
|
|
59
86
|
declare const distDir: string;
|
|
@@ -65,4 +92,4 @@ declare class BaseSequencer implements TestSequencer {
|
|
|
65
92
|
sort(files: WorkspaceSpec[]): Promise<WorkspaceSpec[]>;
|
|
66
93
|
}
|
|
67
94
|
|
|
68
|
-
export { BaseSequencer, type GlobalSetupContext, TestSequencer, Vitest, VitestPlugin, WorkspaceProject, WorkspaceSpec, createMethodsRPC, createVitest, distDir, parseCLI, registerConsoleShortcuts, rootDir, startVitest };
|
|
95
|
+
export { BaseSequencer, GitNotFoundError, type GlobalSetupContext, TestSequencer, FilesNotFoundError as TestsNotFoundError, Vitest, VitestPlugin, WorkspaceProject, WorkspaceSpec, createDebugger, createMethodsRPC, createVitest, distDir, parseCLI, registerConsoleShortcuts, resolveApiServerConfig, resolveConfig, resolveFsAllow, rootDir, startVitest };
|
package/dist/node.js
CHANGED
|
@@ -1,34 +1,36 @@
|
|
|
1
|
-
export { b as VitestPackageInstaller, V as VitestPlugin, a as createMethodsRPC, c as createVitest, g as getFilePoolName, r as registerConsoleShortcuts, s as startVitest } from './vendor/cli-api.
|
|
2
|
-
export { p as parseCLI } from './vendor/cac.
|
|
1
|
+
export { G as GitNotFoundError, F as TestsNotFoundError, b as VitestPackageInstaller, V as VitestPlugin, a as createMethodsRPC, c as createVitest, g as getFilePoolName, r as registerConsoleShortcuts, e as resolveApiServerConfig, f as resolveConfig, d as resolveFsAllow, s as startVitest } from './vendor/cli-api.BGRtK_Kj.js';
|
|
2
|
+
export { p as parseCLI } from './vendor/cac.BQc6bsef.js';
|
|
3
|
+
import createDebug from 'debug';
|
|
3
4
|
export { distDir, rootDir } from './path.js';
|
|
4
|
-
export {
|
|
5
|
-
export { isFileServingAllowed } from 'vite';
|
|
5
|
+
export { e as BaseSequencer } from './vendor/index.3x3MdmUV.js';
|
|
6
|
+
export { createServer, isFileServingAllowed, parseAst, parseAstAsync } from 'vite';
|
|
7
|
+
import 'node:fs';
|
|
6
8
|
import 'pathe';
|
|
7
|
-
import './vendor/
|
|
8
|
-
import './vendor/
|
|
9
|
-
import './vendor/index.DeR1hhfY.js';
|
|
9
|
+
import './vendor/coverage.BhYSDdTT.js';
|
|
10
|
+
import './vendor/index.D4nqnQWz.js';
|
|
10
11
|
import 'node:console';
|
|
12
|
+
import './vendor/index.D6GZqexG.js';
|
|
11
13
|
import 'node:path';
|
|
12
14
|
import 'node:url';
|
|
13
15
|
import 'node:process';
|
|
14
|
-
import 'node:fs';
|
|
15
|
-
import 'node:worker_threads';
|
|
16
16
|
import './vendor/_commonjsHelpers.BFTU3MAI.js';
|
|
17
|
+
import 'readline';
|
|
18
|
+
import 'events';
|
|
19
|
+
import './vendor/constants.CsnA4eRy.js';
|
|
20
|
+
import 'node:worker_threads';
|
|
17
21
|
import 'os';
|
|
18
22
|
import 'path';
|
|
19
|
-
import './vendor/index.DP-km6lF.js';
|
|
20
23
|
import 'util';
|
|
24
|
+
import './vendor/index.BMmMjLIQ.js';
|
|
21
25
|
import 'stream';
|
|
22
|
-
import 'events';
|
|
23
26
|
import 'fs';
|
|
24
|
-
import 'picocolors';
|
|
25
27
|
import 'vite-node/client';
|
|
26
28
|
import '@vitest/snapshot/manager';
|
|
27
29
|
import 'vite-node/server';
|
|
28
30
|
import '@vitest/runner/utils';
|
|
29
|
-
import './vendor/base.
|
|
31
|
+
import './vendor/base.CTYV4Gnz.js';
|
|
30
32
|
import '@vitest/utils';
|
|
31
|
-
import './vendor/env.
|
|
33
|
+
import './vendor/env.2ltrQNq0.js';
|
|
32
34
|
import 'std-env';
|
|
33
35
|
import './vendor/index.BpSiYbpB.js';
|
|
34
36
|
import 'zlib';
|
|
@@ -49,19 +51,28 @@ import 'node:fs/promises';
|
|
|
49
51
|
import 'node:module';
|
|
50
52
|
import 'node:assert';
|
|
51
53
|
import 'node:util';
|
|
54
|
+
import 'picocolors';
|
|
52
55
|
import 'vite-node/utils';
|
|
53
56
|
import 'magic-string';
|
|
54
57
|
import '@vitest/utils/ast';
|
|
55
|
-
import './vendor/index.
|
|
58
|
+
import './vendor/index.BJmtb_7W.js';
|
|
56
59
|
import './vendor/global.7bFbnyXl.js';
|
|
57
60
|
import 'node:readline';
|
|
58
|
-
import '
|
|
59
|
-
import './vendor/
|
|
60
|
-
import './vendor/tasks.WC7M-K-v.js';
|
|
61
|
+
import './vendor/utils.BVMrsl6E.js';
|
|
62
|
+
import './vendor/tasks.DhVtQBtW.js';
|
|
61
63
|
import 'node:perf_hooks';
|
|
62
|
-
import './chunks/runtime-console.
|
|
64
|
+
import './chunks/runtime-console.O41g23Zj.js';
|
|
63
65
|
import 'node:stream';
|
|
64
|
-
import './vendor/date.
|
|
66
|
+
import './vendor/date.W2xKR2qe.js';
|
|
65
67
|
import 'execa';
|
|
66
68
|
import 'module';
|
|
67
69
|
import 'assert';
|
|
70
|
+
|
|
71
|
+
function createDebugger(namespace) {
|
|
72
|
+
const debug = createDebug(namespace);
|
|
73
|
+
if (debug.enabled) {
|
|
74
|
+
return debug;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
export { createDebugger };
|
package/dist/path.js
CHANGED
|
@@ -2,6 +2,9 @@ import url from 'node:url';
|
|
|
2
2
|
import { resolve } from 'pathe';
|
|
3
3
|
|
|
4
4
|
const rootDir = resolve(url.fileURLToPath(import.meta.url), "../../");
|
|
5
|
-
const distDir = resolve(
|
|
5
|
+
const distDir = resolve(
|
|
6
|
+
url.fileURLToPath(import.meta.url),
|
|
7
|
+
"../../dist"
|
|
8
|
+
);
|
|
6
9
|
|
|
7
10
|
export { distDir, rootDir };
|