vitest 2.2.0-beta.2 → 3.0.0-beta.2
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 +75 -0
- package/dist/browser.d.ts +13 -10
- package/dist/browser.js +2 -2
- package/dist/chunks/{RandomSequencer.BPedXEug.js → RandomSequencer.gisBJ77r.js} +11 -4
- package/dist/chunks/{base.BS0HhLXd.js → base.CUgXReRN.js} +8 -3
- package/dist/chunks/{cac.Cs06pOqp.js → cac.Xzv7eNWw.js} +22 -17
- package/dist/chunks/{cli-api.CB-jIbYQ.js → cli-api.CETCDGgZ.js} +985 -498
- package/dist/chunks/{config.CPguQ7J1.d.ts → config.BTPBhmK5.d.ts} +1 -1
- package/dist/chunks/{coverage.BoMDb1ip.js → coverage.BWeNbfBa.js} +4 -4
- package/dist/chunks/{creator.IIqd8RWT.js → creator.DcAcUhMD.js} +1 -4
- package/dist/chunks/{environment.CT0jpO-1.d.ts → environment.d8YfPkTm.d.ts} +1 -3
- package/dist/chunks/{globals.BCGEw6ON.js → globals.BFncSRNA.js} +2 -2
- package/dist/chunks/{index.bzFpKeaq.js → index.9ZEBV_TJ.js} +992 -577
- package/dist/chunks/{index.DD5eTY2y.js → index.CkWmZCXU.js} +1 -1
- package/dist/chunks/{index.CqYx2Nsr.js → index.DQboAxJm.js} +23 -14
- package/dist/chunks/{index.BjjsHdBb.js → index.DoV7W5gc.js} +2 -2
- package/dist/chunks/{inspector.70d6emsh.js → inspector.DKLceBVD.js} +1 -1
- package/dist/chunks/{reporters.F9D2idOT.d.ts → reporters.DTtxC3KQ.d.ts} +588 -524
- package/dist/chunks/{resolveConfig.CLnvCvEs.js → resolveConfig.BA-_OKEx.js} +5599 -5570
- package/dist/chunks/{runBaseTests.B7hcVT-s.js → runBaseTests.D0dWpzZV.js} +13 -12
- package/dist/chunks/{setup-common.BfGt8K-K.js → setup-common.Cp_bu5q3.js} +1 -1
- package/dist/chunks/types.BOjykUpq.d.ts +27 -0
- package/dist/chunks/{utils.DJONn5B5.js → utils.CMUTX-p8.js} +5 -2
- package/dist/chunks/{vi.BlPttogV.js → vi.S4Fq8wSo.js} +20 -14
- package/dist/chunks/{vite.DonA4fvH.d.ts → vite.CXaetSK3.d.ts} +1 -1
- package/dist/chunks/{vm.Zr4qWzDJ.js → vm.DGhTouO3.js} +10 -1
- package/dist/chunks/{worker.Qz1UB4Fv.d.ts → worker.ClntunZp.d.ts} +1 -1
- package/dist/chunks/{worker.9VY11NZs.d.ts → worker.o1PBoDdo.d.ts} +4 -4
- package/dist/cli.js +1 -1
- package/dist/config.cjs +1 -10
- package/dist/config.d.ts +7 -10
- package/dist/config.js +1 -10
- package/dist/coverage.d.ts +5 -7
- package/dist/coverage.js +4 -4
- package/dist/environments.d.ts +2 -2
- package/dist/execute.d.ts +4 -4
- package/dist/index.d.ts +27 -22
- package/dist/index.js +2 -2
- package/dist/node.d.ts +25 -33
- package/dist/node.js +66 -32
- package/dist/reporters.d.ts +5 -7
- package/dist/reporters.js +5 -4
- package/dist/runners.d.ts +3 -4
- package/dist/runners.js +9 -14
- package/dist/suite.d.ts +1 -1
- package/dist/worker.js +1 -1
- package/dist/workers/forks.js +1 -1
- package/dist/workers/runVmTests.js +9 -9
- package/dist/workers/threads.js +1 -1
- package/dist/workers/vmForks.js +1 -1
- package/dist/workers/vmThreads.js +1 -1
- package/dist/workers.d.ts +4 -4
- package/dist/workers.js +3 -3
- package/package.json +23 -24
package/dist/node.d.ts
CHANGED
|
@@ -1,29 +1,27 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export { B as BaseCoverageOptions,
|
|
3
|
-
import { UserConfig,
|
|
1
|
+
import { s as VitestRunMode, z as VitestOptions, V as Vitest, v as UserConfig$1, A as ApiConfig, E as TestProject, w as ResolvedConfig, F as TestSequencer, G as TestSpecification, L as Logger, H as TestModule, M as ModuleDiagnostic } from './chunks/reporters.DTtxC3KQ.js';
|
|
2
|
+
export { B as BaseCoverageOptions, y as BenchmarkUserOptions, aa as BrowserBuiltinProvider, ab as BrowserCommand, ac as BrowserCommandContext, n as BrowserConfigOptions, ad as BrowserOrchestrator, ae as BrowserProvider, af as BrowserProviderInitializationOptions, ag as BrowserProviderModule, ah as BrowserProviderOptions, m as BrowserScript, ai as BrowserServer, aj as BrowserServerState, ak as BrowserServerStateContext, o as BuiltinEnvironment, al as CDPSession, r as CSSModuleScopeStrategy, j as CoverageIstanbulOptions, i as CoverageOptions, b as CoverageProvider, c as CoverageProviderModule, g as CoverageReporter, d as CoverageV8Options, k as CustomProviderOptions, D as DepsOptimizationOptions, Z as HTMLOptions, I as InlineConfig, $ as JUnitOptions, _ as JsonOptions, O as OnServerRestartHandler, J as OnTestsRerunHandler, P as Pool, q as PoolOptions, N as ProcessPool, x as ProjectConfig, a as ReportContext, ao as ResolveSnapshotPathHandler, ap as ResolveSnapshotPathHandlerContext, am as ResolvedBrowserOptions, R as ResolvedCoverageOptions, an as ResolvedProjectConfig, Y as SerializedTestProject, a0 as TaskOptions, a1 as TestCase, a2 as TestCollection, a3 as TestDiagnostic, a4 as TestResult, a5 as TestResultFailed, a6 as TestResultPassed, a7 as TestResultSkipped, aq as TestRunResult, a9 as TestSequencerConstructor, a8 as TestSuite, t as TransformModePatterns, u as TypecheckConfig, U as UserWorkspaceConfig, p as VitestEnvironment, K as VitestPackageInstaller, Q as WorkspaceSpec, X as getFilePoolName } from './chunks/reporters.DTtxC3KQ.js';
|
|
3
|
+
import { UserConfig, Plugin, ResolvedConfig as ResolvedConfig$1, LogLevel, LoggerOptions, Logger as Logger$1, createServer as createServer$1 } from 'vite';
|
|
4
4
|
import * as vite from 'vite';
|
|
5
5
|
export { vite as Vite };
|
|
6
|
-
export { isFileServingAllowed, parseAst, parseAstAsync } from 'vite';
|
|
7
|
-
import {
|
|
8
|
-
export { f as EnvironmentOptions, H as HappyDOMOptions, J as JSDOMOptions, O as OnServerRestartHandler } from './chunks/environment.CT0jpO-1.js';
|
|
9
|
-
import { R as RuntimeRPC } from './chunks/worker.9VY11NZs.js';
|
|
6
|
+
export { esbuildVersion, isFileServingAllowed, parseAst, parseAstAsync, rollupVersion, version as viteVersion } from 'vite';
|
|
7
|
+
import { R as RuntimeRPC } from './chunks/worker.o1PBoDdo.js';
|
|
10
8
|
import { Writable } from 'node:stream';
|
|
11
|
-
export { W as WorkerContext } from './chunks/worker.
|
|
9
|
+
export { W as WorkerContext } from './chunks/worker.ClntunZp.js';
|
|
10
|
+
export { C as TypeCheckCollectLineNumbers, a as TypeCheckCollectLines, c as TypeCheckContext, T as TypeCheckErrorInfo, R as TypeCheckRawErrorsMap, b as TypeCheckRootAndTarget } from './chunks/types.BOjykUpq.js';
|
|
12
11
|
import createDebug from 'debug';
|
|
13
|
-
export {
|
|
12
|
+
export { generateFileHash } from '@vitest/runner/utils';
|
|
13
|
+
export { f as EnvironmentOptions, H as HappyDOMOptions, J as JSDOMOptions } from './chunks/environment.d8YfPkTm.js';
|
|
14
|
+
export { b as RuntimeConfig } from './chunks/config.BTPBhmK5.js';
|
|
14
15
|
export { SequenceHooks, SequenceSetupFiles } from '@vitest/runner';
|
|
15
16
|
import '@vitest/utils';
|
|
16
|
-
import 'vite-node';
|
|
17
17
|
import '@vitest/utils/source-map';
|
|
18
18
|
import '@vitest/pretty-format';
|
|
19
19
|
import '@vitest/snapshot';
|
|
20
20
|
import '@vitest/utils/diff';
|
|
21
|
+
import 'vite-node';
|
|
21
22
|
import 'chai';
|
|
22
23
|
import './chunks/benchmark.CFFwLv-O.js';
|
|
23
|
-
import '@vitest/runner/utils';
|
|
24
24
|
import 'tinybench';
|
|
25
|
-
import 'vite-node/client';
|
|
26
|
-
import 'vite-node/server';
|
|
27
25
|
import '@vitest/snapshot/manager';
|
|
28
26
|
import 'node:fs';
|
|
29
27
|
import 'node:worker_threads';
|
|
@@ -54,16 +52,15 @@ interface CliOptions extends UserConfig$1 {
|
|
|
54
52
|
*/
|
|
55
53
|
declare function startVitest(mode: VitestRunMode, cliFilters?: string[], options?: CliOptions, viteOverrides?: UserConfig, vitestOptions?: VitestOptions): Promise<Vitest>;
|
|
56
54
|
|
|
57
|
-
interface
|
|
55
|
+
interface CliParseOptions {
|
|
58
56
|
allowUnknownOptions?: boolean;
|
|
59
57
|
}
|
|
60
|
-
declare function parseCLI(argv: string | string[], config?:
|
|
58
|
+
declare function parseCLI(argv: string | string[], config?: CliParseOptions): {
|
|
61
59
|
filter: string[];
|
|
62
60
|
options: CliOptions;
|
|
63
61
|
};
|
|
64
62
|
|
|
65
63
|
declare function resolveApiServerConfig<Options extends ApiConfig & UserConfig$1>(options: Options, defaultPort: number): ApiConfig | undefined;
|
|
66
|
-
declare function resolveConfig(mode: VitestRunMode, options: UserConfig$1, viteConfig: ResolvedConfig, logger: Logger): ResolvedConfig$1;
|
|
67
64
|
|
|
68
65
|
declare function createVitest(mode: VitestRunMode, options: UserConfig$1, viteOverrides?: UserConfig, vitestOptions?: VitestOptions): Promise<Vitest>;
|
|
69
66
|
|
|
@@ -76,23 +73,16 @@ declare class GitNotFoundError extends Error {
|
|
|
76
73
|
constructor();
|
|
77
74
|
}
|
|
78
75
|
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
* Config of the current project.
|
|
82
|
-
*/
|
|
83
|
-
config: ResolvedConfig$1;
|
|
84
|
-
/**
|
|
85
|
-
* Provide a value to the test context. This value will be available to all tests via `inject`.
|
|
86
|
-
*/
|
|
87
|
-
provide: <T extends keyof ProvidedContext & string>(key: T, value: ProvidedContext[T]) => void;
|
|
88
|
-
/**
|
|
89
|
-
* Register a function that will be called before tests run again in watch mode.
|
|
90
|
-
*/
|
|
91
|
-
onTestsRerun: (cb: OnTestsRerunHandler) => void;
|
|
92
|
-
}
|
|
76
|
+
/** @deprecated use `TestProject` instead */
|
|
77
|
+
type GlobalSetupContext = TestProject;
|
|
93
78
|
|
|
94
79
|
declare function VitestPlugin(options?: UserConfig$1, ctx?: Vitest): Promise<Plugin[]>;
|
|
95
80
|
|
|
81
|
+
declare function resolveConfig(options?: UserConfig$1, viteOverrides?: UserConfig): Promise<{
|
|
82
|
+
vitestConfig: ResolvedConfig;
|
|
83
|
+
viteConfig: ResolvedConfig$1;
|
|
84
|
+
}>;
|
|
85
|
+
|
|
96
86
|
declare function resolveFsAllow(projectRoot: string, rootConfigFile: string | false | undefined): string[];
|
|
97
87
|
|
|
98
88
|
interface MethodsOptions {
|
|
@@ -103,8 +93,8 @@ declare function createMethodsRPC(project: TestProject, options?: MethodsOptions
|
|
|
103
93
|
declare class BaseSequencer implements TestSequencer {
|
|
104
94
|
protected ctx: Vitest;
|
|
105
95
|
constructor(ctx: Vitest);
|
|
106
|
-
shard(files:
|
|
107
|
-
sort(files:
|
|
96
|
+
shard(files: TestSpecification[]): Promise<TestSpecification[]>;
|
|
97
|
+
sort(files: TestSpecification[]): Promise<TestSpecification[]>;
|
|
108
98
|
}
|
|
109
99
|
|
|
110
100
|
declare function registerConsoleShortcuts(ctx: Vitest, stdin: NodeJS.ReadStream | undefined, stdout: NodeJS.WriteStream | Writable): () => void;
|
|
@@ -116,6 +106,8 @@ declare const distDir: string;
|
|
|
116
106
|
|
|
117
107
|
declare function createDebugger(namespace: `vitest:${string}`): createDebug.Debugger | undefined;
|
|
118
108
|
|
|
109
|
+
declare const version: string;
|
|
110
|
+
|
|
119
111
|
/** @deprecated use `createViteServer` instead */
|
|
120
112
|
declare const createServer: typeof createServer$1;
|
|
121
113
|
declare const createViteServer: typeof createServer$1;
|
|
@@ -130,4 +122,4 @@ declare const TestFile: typeof TestModule;
|
|
|
130
122
|
*/
|
|
131
123
|
type FileDiagnostic = ModuleDiagnostic;
|
|
132
124
|
|
|
133
|
-
export { ApiConfig, BaseSequencer, type FileDiagnostic, GitNotFoundError, type GlobalSetupContext, ModuleDiagnostic,
|
|
125
|
+
export { ApiConfig, BaseSequencer, type CliParseOptions, type FileDiagnostic, GitNotFoundError, type GlobalSetupContext, ModuleDiagnostic, ResolvedConfig, TestFile, TestModule, TestProject, TestSequencer, TestSpecification, FilesNotFoundError as TestsNotFoundError, UserConfig$1 as UserConfig, Vitest, VitestPlugin, VitestRunMode, TestProject as WorkspaceProject, createDebugger, createMethodsRPC, createServer, createViteLogger, createViteServer, createVitest, distDir, parseCLI, registerConsoleShortcuts, resolveApiServerConfig, resolveConfig, resolveFsAllow, rootDir, startVitest, version };
|
package/dist/node.js
CHANGED
|
@@ -1,38 +1,22 @@
|
|
|
1
|
-
import { createServer as createServer$1 } from 'vite';
|
|
2
|
-
export { isFileServingAllowed, parseAst, parseAstAsync } from 'vite';
|
|
3
|
-
import {
|
|
4
|
-
export { e as
|
|
5
|
-
|
|
6
|
-
export {
|
|
7
|
-
|
|
8
|
-
export {
|
|
1
|
+
import { resolveConfig as resolveConfig$1, mergeConfig, createServer as createServer$1 } from 'vite';
|
|
2
|
+
export { esbuildVersion, isFileServingAllowed, parseAst, parseAstAsync, rollupVersion, version as viteVersion } from 'vite';
|
|
3
|
+
import { V as Vitest, a as VitestPlugin } from './chunks/cli-api.CETCDGgZ.js';
|
|
4
|
+
export { G as GitNotFoundError, F as TestsNotFoundError, b as VitestPackageInstaller, e as createViteLogger, c as createVitest, d as registerConsoleShortcuts, r as resolveFsAllow, s as startVitest } from './chunks/cli-api.CETCDGgZ.js';
|
|
5
|
+
import { f as TestModule } from './chunks/index.9ZEBV_TJ.js';
|
|
6
|
+
export { p as parseCLI } from './chunks/cac.Xzv7eNWw.js';
|
|
7
|
+
import { a as resolveConfig$2 } from './chunks/resolveConfig.BA-_OKEx.js';
|
|
8
|
+
export { d as createMethodsRPC, g as getFilePoolName, b as resolveApiServerConfig } from './chunks/resolveConfig.BA-_OKEx.js';
|
|
9
|
+
import { slash } from '@vitest/utils';
|
|
10
|
+
import { f as findUp } from './chunks/index.BJDntFik.js';
|
|
11
|
+
import { resolve } from 'pathe';
|
|
12
|
+
import { c as configFiles } from './chunks/constants.fzPh7AOq.js';
|
|
13
|
+
export { B as BaseSequencer } from './chunks/RandomSequencer.gisBJ77r.js';
|
|
9
14
|
export { distDir, rootDir } from './path.js';
|
|
10
15
|
import createDebug from 'debug';
|
|
16
|
+
export { generateFileHash } from '@vitest/runner/utils';
|
|
11
17
|
import 'node:fs';
|
|
12
|
-
import '
|
|
13
|
-
import 'pathe';
|
|
14
|
-
import 'tinyrainbow';
|
|
15
|
-
import './chunks/utils.DJONn5B5.js';
|
|
16
|
-
import 'node:util';
|
|
17
|
-
import '@vitest/utils';
|
|
18
|
-
import 'node:perf_hooks';
|
|
19
|
-
import '@vitest/utils/source-map';
|
|
20
|
-
import 'std-env';
|
|
21
|
-
import 'node:fs/promises';
|
|
22
|
-
import 'restore-cursor';
|
|
23
|
-
import 'node:stream';
|
|
24
|
-
import 'node:console';
|
|
25
|
-
import 'node:process';
|
|
26
|
-
import './chunks/_commonjsHelpers.BFTU3MAI.js';
|
|
27
|
-
import 'node:module';
|
|
28
|
-
import 'node:os';
|
|
29
|
-
import 'events';
|
|
30
|
-
import './chunks/constants.fzPh7AOq.js';
|
|
31
|
-
import './chunks/coverage.BoMDb1ip.js';
|
|
18
|
+
import './chunks/coverage.BWeNbfBa.js';
|
|
32
19
|
import 'node:path';
|
|
33
|
-
import './chunks/index.BJDntFik.js';
|
|
34
|
-
import 'node:url';
|
|
35
|
-
import 'readline';
|
|
36
20
|
import '@vitest/snapshot/manager';
|
|
37
21
|
import 'vite-node/client';
|
|
38
22
|
import 'vite-node/server';
|
|
@@ -41,11 +25,20 @@ import 'stream';
|
|
|
41
25
|
import 'zlib';
|
|
42
26
|
import 'buffer';
|
|
43
27
|
import 'crypto';
|
|
28
|
+
import 'events';
|
|
44
29
|
import 'https';
|
|
45
30
|
import 'http';
|
|
46
31
|
import 'net';
|
|
47
32
|
import 'tls';
|
|
48
33
|
import 'url';
|
|
34
|
+
import './chunks/_commonjsHelpers.BFTU3MAI.js';
|
|
35
|
+
import '@vitest/utils/source-map';
|
|
36
|
+
import 'node:module';
|
|
37
|
+
import 'node:url';
|
|
38
|
+
import 'tinyrainbow';
|
|
39
|
+
import 'std-env';
|
|
40
|
+
import 'node:fs/promises';
|
|
41
|
+
import 'node:os';
|
|
49
42
|
import 'os';
|
|
50
43
|
import 'path';
|
|
51
44
|
import 'fs';
|
|
@@ -53,15 +46,55 @@ import 'vite-node/utils';
|
|
|
53
46
|
import '@vitest/mocker/node';
|
|
54
47
|
import 'magic-string';
|
|
55
48
|
import 'node:readline';
|
|
49
|
+
import 'node:util';
|
|
50
|
+
import './chunks/utils.CMUTX-p8.js';
|
|
51
|
+
import 'node:perf_hooks';
|
|
52
|
+
import 'node:stream';
|
|
53
|
+
import 'node:console';
|
|
54
|
+
import 'node:process';
|
|
55
|
+
import 'assert';
|
|
56
56
|
import 'node:assert';
|
|
57
57
|
import 'node:v8';
|
|
58
58
|
import 'util';
|
|
59
59
|
import 'node:events';
|
|
60
60
|
import 'tinypool';
|
|
61
61
|
import 'node:worker_threads';
|
|
62
|
+
import 'readline';
|
|
62
63
|
import 'tinyexec';
|
|
63
64
|
import 'node:crypto';
|
|
64
65
|
|
|
66
|
+
async function resolveConfig(options = {}, viteOverrides = {}) {
|
|
67
|
+
const root = slash(resolve(options.root || process.cwd()));
|
|
68
|
+
const configPath = options.config === false ? false : options.config ? resolve(root, options.config) : await findUp(configFiles, { cwd: root });
|
|
69
|
+
options.config = configPath;
|
|
70
|
+
const vitest = new Vitest("test");
|
|
71
|
+
const config = await resolveConfig$1(
|
|
72
|
+
mergeConfig(
|
|
73
|
+
{
|
|
74
|
+
configFile: configPath,
|
|
75
|
+
// this will make "mode": "test" | "benchmark" inside defineConfig
|
|
76
|
+
mode: options.mode || "test",
|
|
77
|
+
plugins: [
|
|
78
|
+
await VitestPlugin(options, vitest)
|
|
79
|
+
]
|
|
80
|
+
},
|
|
81
|
+
mergeConfig(viteOverrides, { root: options.root })
|
|
82
|
+
),
|
|
83
|
+
"serve"
|
|
84
|
+
);
|
|
85
|
+
const updatedOptions = Reflect.get(config, "_vitest");
|
|
86
|
+
const vitestConfig = resolveConfig$2(
|
|
87
|
+
"test",
|
|
88
|
+
updatedOptions,
|
|
89
|
+
config,
|
|
90
|
+
vitest.logger
|
|
91
|
+
);
|
|
92
|
+
return {
|
|
93
|
+
viteConfig: config,
|
|
94
|
+
vitestConfig
|
|
95
|
+
};
|
|
96
|
+
}
|
|
97
|
+
|
|
65
98
|
function createDebugger(namespace) {
|
|
66
99
|
const debug = createDebug(namespace);
|
|
67
100
|
if (debug.enabled) {
|
|
@@ -69,8 +102,9 @@ function createDebugger(namespace) {
|
|
|
69
102
|
}
|
|
70
103
|
}
|
|
71
104
|
|
|
105
|
+
const version = Vitest.version;
|
|
72
106
|
const createServer = createServer$1;
|
|
73
107
|
const createViteServer = createServer$1;
|
|
74
108
|
const TestFile = TestModule;
|
|
75
109
|
|
|
76
|
-
export { TestFile,
|
|
110
|
+
export { TestFile, VitestPlugin, createDebugger, createServer, createViteServer, resolveConfig, version };
|
package/dist/reporters.d.ts
CHANGED
|
@@ -1,21 +1,19 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { aB as BaseReporter, ar as BasicReporter, aL as BenchmarkBuiltinReporters, aK as BenchmarkReportsMap, aG as BuiltinReporterOptions, aF as BuiltinReporters, as as DefaultReporter, at as DotReporter, aD as FileDiagnostic, au as GithubActionsReporter, av as HangingProcessReporter, ax as JUnitReporter, aH as JsonAssertionResult, aw as JsonReporter, aI as JsonTestResult, aJ as JsonTestResults, l as Reporter, aE as ReportersMap, ay as TapFlatReporter, az as TapReporter, a0 as TaskOptions, a1 as TestCase, a2 as TestCollection, a3 as TestDiagnostic, aC as TestFile, H as TestModule, E as TestProject, a4 as TestResult, a5 as TestResultFailed, a6 as TestResultPassed, a7 as TestResultSkipped, a8 as TestSuite, aA as VerboseReporter } from './chunks/reporters.DTtxC3KQ.js';
|
|
2
2
|
import '@vitest/runner';
|
|
3
|
-
import './chunks/environment.
|
|
3
|
+
import './chunks/environment.d8YfPkTm.js';
|
|
4
|
+
import '@vitest/utils';
|
|
4
5
|
import 'node:stream';
|
|
5
6
|
import 'vite';
|
|
6
|
-
import '@vitest/utils';
|
|
7
|
-
import 'vite-node';
|
|
8
7
|
import '@vitest/utils/source-map';
|
|
9
|
-
import './chunks/config.
|
|
8
|
+
import './chunks/config.BTPBhmK5.js';
|
|
10
9
|
import '@vitest/pretty-format';
|
|
11
10
|
import '@vitest/snapshot';
|
|
12
11
|
import '@vitest/snapshot/environment';
|
|
13
12
|
import '@vitest/utils/diff';
|
|
13
|
+
import 'vite-node';
|
|
14
14
|
import 'chai';
|
|
15
15
|
import './chunks/benchmark.CFFwLv-O.js';
|
|
16
16
|
import '@vitest/runner/utils';
|
|
17
17
|
import 'tinybench';
|
|
18
|
-
import 'vite-node/client';
|
|
19
|
-
import 'vite-node/server';
|
|
20
18
|
import '@vitest/snapshot/manager';
|
|
21
19
|
import 'node:fs';
|
package/dist/reporters.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
export { B as BasicReporter, h as BenchmarkReportsMap, D as DefaultReporter, a as DotReporter, G as GithubActionsReporter, H as HangingProcessReporter, b as JUnitReporter, J as JsonReporter, R as ReportersMap, T as TapFlatReporter, c as TapReporter, e as TestCase, d as TestFile, f as TestModule, g as TestSuite, V as VerboseReporter } from './chunks/index.
|
|
1
|
+
export { B as BasicReporter, h as BenchmarkReportsMap, D as DefaultReporter, a as DotReporter, G as GithubActionsReporter, H as HangingProcessReporter, b as JUnitReporter, J as JsonReporter, R as ReportersMap, T as TapFlatReporter, c as TapReporter, e as TestCase, d as TestFile, f as TestModule, g as TestSuite, V as VerboseReporter } from './chunks/index.9ZEBV_TJ.js';
|
|
2
2
|
import 'node:fs';
|
|
3
3
|
import '@vitest/runner/utils';
|
|
4
4
|
import 'pathe';
|
|
5
5
|
import 'tinyrainbow';
|
|
6
|
-
import './chunks/utils.
|
|
6
|
+
import './chunks/utils.CMUTX-p8.js';
|
|
7
7
|
import 'node:util';
|
|
8
8
|
import '@vitest/utils';
|
|
9
9
|
import 'node:perf_hooks';
|
|
10
10
|
import '@vitest/utils/source-map';
|
|
11
|
-
import './chunks/RandomSequencer.
|
|
11
|
+
import './chunks/RandomSequencer.gisBJ77r.js';
|
|
12
12
|
import 'std-env';
|
|
13
13
|
import 'node:fs/promises';
|
|
14
14
|
import 'tinyexec';
|
|
@@ -20,8 +20,9 @@ import 'node:module';
|
|
|
20
20
|
import 'fs';
|
|
21
21
|
import 'vite-node/utils';
|
|
22
22
|
import 'node:crypto';
|
|
23
|
-
import 'restore-cursor';
|
|
24
23
|
import 'node:stream';
|
|
25
24
|
import 'node:console';
|
|
26
25
|
import 'node:process';
|
|
27
26
|
import './chunks/_commonjsHelpers.BFTU3MAI.js';
|
|
27
|
+
import 'assert';
|
|
28
|
+
import 'events';
|
package/dist/runners.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as tinybench from 'tinybench';
|
|
2
|
-
import { VitestRunner, VitestRunnerImportSource, Suite, File, Task, CancelReason,
|
|
3
|
-
import { S as SerializedConfig } from './chunks/config.
|
|
2
|
+
import { VitestRunner, VitestRunnerImportSource, Suite, File, Task, CancelReason, TestContext } from '@vitest/runner';
|
|
3
|
+
import { S as SerializedConfig } from './chunks/config.BTPBhmK5.js';
|
|
4
4
|
import '@vitest/pretty-format';
|
|
5
5
|
import '@vitest/snapshot';
|
|
6
6
|
import '@vitest/snapshot/environment';
|
|
@@ -27,7 +27,6 @@ declare class VitestTestRunner implements VitestRunner {
|
|
|
27
27
|
constructor(config: SerializedConfig);
|
|
28
28
|
importFile(filepath: string, source: VitestRunnerImportSource): unknown;
|
|
29
29
|
onCollectStart(file: File): void;
|
|
30
|
-
onBeforeRunFiles(): void;
|
|
31
30
|
onAfterRunFiles(): void;
|
|
32
31
|
onAfterRunSuite(suite: Suite): Promise<void>;
|
|
33
32
|
onAfterRunTask(test: Task): void;
|
|
@@ -37,7 +36,7 @@ declare class VitestTestRunner implements VitestRunner {
|
|
|
37
36
|
onBeforeRunSuite(suite: Suite): Promise<void>;
|
|
38
37
|
onBeforeTryTask(test: Task): void;
|
|
39
38
|
onAfterTryTask(test: Task): void;
|
|
40
|
-
extendTaskContext
|
|
39
|
+
extendTaskContext(context: TestContext): TestContext;
|
|
41
40
|
}
|
|
42
41
|
|
|
43
42
|
export { NodeBenchmarkRunner, VitestTestRunner };
|
package/dist/runners.js
CHANGED
|
@@ -4,7 +4,7 @@ import { a as getBenchOptions, g as getBenchFn } from './chunks/benchmark.Cdu9hj
|
|
|
4
4
|
import { g as getWorkerState } from './chunks/utils.C8RiOc4B.js';
|
|
5
5
|
import { setState, GLOBAL_EXPECT, getState } from '@vitest/expect';
|
|
6
6
|
import { getTests, getNames, getTestName } from '@vitest/runner/utils';
|
|
7
|
-
import { g as getSnapshotClient, i as inject, c as createExpect, v as vi } from './chunks/vi.
|
|
7
|
+
import { g as getSnapshotClient, i as inject, c as createExpect, v as vi } from './chunks/vi.S4Fq8wSo.js';
|
|
8
8
|
import { r as rpc } from './chunks/rpc.C3q9uwRX.js';
|
|
9
9
|
import 'chai';
|
|
10
10
|
import './chunks/_commonjsHelpers.BFTU3MAI.js';
|
|
@@ -168,10 +168,8 @@ class VitestTestRunner {
|
|
|
168
168
|
onCollectStart(file) {
|
|
169
169
|
this.workerState.current = file;
|
|
170
170
|
}
|
|
171
|
-
onBeforeRunFiles() {
|
|
172
|
-
this.snapshotClient.clear();
|
|
173
|
-
}
|
|
174
171
|
onAfterRunFiles() {
|
|
172
|
+
this.snapshotClient.clear();
|
|
175
173
|
this.workerState.current = void 0;
|
|
176
174
|
}
|
|
177
175
|
async onAfterRunSuite(suite) {
|
|
@@ -182,18 +180,15 @@ class VitestTestRunner {
|
|
|
182
180
|
for (const test of getTests(suite)) {
|
|
183
181
|
if (test.mode === "skip") {
|
|
184
182
|
const name = getNames(test).slice(1).join(" > ");
|
|
185
|
-
this.snapshotClient.
|
|
183
|
+
this.snapshotClient.skipTest(suite.file.filepath, name);
|
|
186
184
|
}
|
|
187
185
|
}
|
|
188
|
-
const result = await this.snapshotClient.
|
|
189
|
-
|
|
190
|
-
await rpc().snapshotSaved(result);
|
|
191
|
-
}
|
|
186
|
+
const result = await this.snapshotClient.finish(suite.file.filepath);
|
|
187
|
+
await rpc().snapshotSaved(result);
|
|
192
188
|
}
|
|
193
189
|
this.workerState.current = suite.suite || suite.file;
|
|
194
190
|
}
|
|
195
191
|
onAfterRunTask(test) {
|
|
196
|
-
this.snapshotClient.clearTest();
|
|
197
192
|
if (this.config.logHeapUsage && typeof process !== "undefined") {
|
|
198
193
|
test.result.heap = process.memoryUsage().heapUsed;
|
|
199
194
|
}
|
|
@@ -220,15 +215,15 @@ class VitestTestRunner {
|
|
|
220
215
|
suite.mode = "skip";
|
|
221
216
|
}
|
|
222
217
|
if (suite.mode !== "skip" && "filepath" in suite) {
|
|
223
|
-
await this.snapshotClient.
|
|
224
|
-
suite.filepath,
|
|
225
|
-
"__default_name_",
|
|
218
|
+
await this.snapshotClient.setup(
|
|
219
|
+
suite.file.filepath,
|
|
226
220
|
this.workerState.config.snapshotOptions
|
|
227
221
|
);
|
|
228
222
|
}
|
|
229
223
|
this.workerState.current = suite;
|
|
230
224
|
}
|
|
231
225
|
onBeforeTryTask(test) {
|
|
226
|
+
this.snapshotClient.clearTest(test.file.filepath, test.id);
|
|
232
227
|
setState(
|
|
233
228
|
{
|
|
234
229
|
assertionCalls: 0,
|
|
@@ -238,7 +233,7 @@ class VitestTestRunner {
|
|
|
238
233
|
expectedAssertionsNumberErrorGen: null,
|
|
239
234
|
testPath: test.file.filepath,
|
|
240
235
|
currentTestName: getTestName(test),
|
|
241
|
-
snapshotState: this.snapshotClient.
|
|
236
|
+
snapshotState: this.snapshotClient.getSnapshotState(test.file.filepath)
|
|
242
237
|
},
|
|
243
238
|
globalThis[GLOBAL_EXPECT]
|
|
244
239
|
);
|
package/dist/suite.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { g as getBenchFn, a as getBenchOptions } from './chunks/suite.BJU7kdY9.js';
|
|
2
|
-
export { createTaskCollector, getCurrentSuite, getCurrentTest, getFn, getHooks, setFn, setHooks } from '@vitest/runner';
|
|
2
|
+
export { VitestRunner, VitestRunnerConfig, createTaskCollector, getCurrentSuite, getCurrentTest, getFn, getHooks, setFn, setHooks } from '@vitest/runner';
|
|
3
3
|
export { createChainable } from '@vitest/runner/utils';
|
|
4
4
|
import './chunks/benchmark.CFFwLv-O.js';
|
|
5
5
|
import 'tinybench';
|
package/dist/worker.js
CHANGED
|
@@ -5,7 +5,7 @@ import { ViteNodeRunner, ModuleCacheMap } from 'vite-node/client';
|
|
|
5
5
|
import { readFileSync } from 'node:fs';
|
|
6
6
|
import { resolve, normalize } from 'pathe';
|
|
7
7
|
import { e as environments } from './chunks/index.K90BXFOx.js';
|
|
8
|
-
import { s as setupInspect } from './chunks/inspector.
|
|
8
|
+
import { s as setupInspect } from './chunks/inspector.DKLceBVD.js';
|
|
9
9
|
import { c as createRuntimeRpc, a as rpcDone } from './chunks/rpc.C3q9uwRX.js';
|
|
10
10
|
import { i as isChildProcess, s as setProcessTitle } from './chunks/utils.C8RiOc4B.js';
|
|
11
11
|
import { d as disposeInternalListeners } from './chunks/utils.Cn0zI1t3.js';
|
package/dist/workers/forks.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import v8 from 'node:v8';
|
|
2
|
-
import { r as runBaseTests } from '../chunks/base.
|
|
2
|
+
import { r as runBaseTests } from '../chunks/base.CUgXReRN.js';
|
|
3
3
|
import { c as createForksRpcOptions, u as unwrapSerializableConfig } from '../chunks/utils.Cn0zI1t3.js';
|
|
4
4
|
import 'vite-node/client';
|
|
5
5
|
import '../chunks/execute.2pr0rHgK.js';
|
|
@@ -5,11 +5,11 @@ import util from 'node:util';
|
|
|
5
5
|
import { startTests, collectTests } from '@vitest/runner';
|
|
6
6
|
import { KNOWN_ASSET_TYPES } from 'vite-node/constants';
|
|
7
7
|
import { installSourcemapsSupport } from 'vite-node/source-map';
|
|
8
|
-
import { s as setupChaiConfig, r as resolveTestRunner, a as resolveSnapshotEnvironment } from '../chunks/index.
|
|
9
|
-
import { s as startCoverageInsideWorker, a as stopCoverageInsideWorker } from '../chunks/coverage.
|
|
10
|
-
import { V as VitestIndex } from '../chunks/index.
|
|
11
|
-
import { c as closeInspector } from '../chunks/inspector.
|
|
12
|
-
import { s as setupCommonEnv } from '../chunks/setup-common.
|
|
8
|
+
import { s as setupChaiConfig, r as resolveTestRunner, a as resolveSnapshotEnvironment } from '../chunks/index.DoV7W5gc.js';
|
|
9
|
+
import { s as startCoverageInsideWorker, a as stopCoverageInsideWorker } from '../chunks/coverage.BWeNbfBa.js';
|
|
10
|
+
import { V as VitestIndex } from '../chunks/index.CkWmZCXU.js';
|
|
11
|
+
import { c as closeInspector } from '../chunks/inspector.DKLceBVD.js';
|
|
12
|
+
import { s as setupCommonEnv } from '../chunks/setup-common.Cp_bu5q3.js';
|
|
13
13
|
import { g as getWorkerState } from '../chunks/utils.C8RiOc4B.js';
|
|
14
14
|
import 'chai';
|
|
15
15
|
import 'node:path';
|
|
@@ -18,7 +18,7 @@ import 'node:url';
|
|
|
18
18
|
import '../chunks/rpc.C3q9uwRX.js';
|
|
19
19
|
import '@vitest/utils';
|
|
20
20
|
import '../chunks/index.68735LiX.js';
|
|
21
|
-
import '../chunks/vi.
|
|
21
|
+
import '../chunks/vi.S4Fq8wSo.js';
|
|
22
22
|
import '@vitest/expect';
|
|
23
23
|
import '@vitest/runner/utils';
|
|
24
24
|
import '../chunks/_commonjsHelpers.BFTU3MAI.js';
|
|
@@ -58,7 +58,7 @@ async function run(method, files, config, executor) {
|
|
|
58
58
|
installSourcemapsSupport({
|
|
59
59
|
getSourceMap: (source) => workerState.moduleCache.getSourceMap(source)
|
|
60
60
|
});
|
|
61
|
-
await startCoverageInsideWorker(config.coverage, executor);
|
|
61
|
+
await startCoverageInsideWorker(config.coverage, executor, { isolate: false });
|
|
62
62
|
if (config.chaiConfig) {
|
|
63
63
|
setupChaiConfig(config.chaiConfig);
|
|
64
64
|
}
|
|
@@ -74,7 +74,7 @@ async function run(method, files, config, executor) {
|
|
|
74
74
|
workerState.durations.prepare = performance.now() - workerState.durations.prepare;
|
|
75
75
|
const { vi } = VitestIndex;
|
|
76
76
|
for (const file of files) {
|
|
77
|
-
workerState.filepath = file;
|
|
77
|
+
workerState.filepath = file.filepath;
|
|
78
78
|
if (method === "run") {
|
|
79
79
|
await startTests([file], runner);
|
|
80
80
|
} else {
|
|
@@ -83,7 +83,7 @@ async function run(method, files, config, executor) {
|
|
|
83
83
|
vi.resetConfig();
|
|
84
84
|
vi.restoreAllMocks();
|
|
85
85
|
}
|
|
86
|
-
await stopCoverageInsideWorker(config.coverage, executor);
|
|
86
|
+
await stopCoverageInsideWorker(config.coverage, executor, { isolate: false });
|
|
87
87
|
}
|
|
88
88
|
function resolveCss(mod) {
|
|
89
89
|
mod.exports = "";
|
package/dist/workers/threads.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { r as runBaseTests } from '../chunks/base.
|
|
1
|
+
import { r as runBaseTests } from '../chunks/base.CUgXReRN.js';
|
|
2
2
|
import { a as createThreadsRpcOptions } from '../chunks/utils.Cn0zI1t3.js';
|
|
3
3
|
import 'vite-node/client';
|
|
4
4
|
import '../chunks/execute.2pr0rHgK.js';
|
package/dist/workers/vmForks.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import v8 from 'node:v8';
|
|
2
2
|
import { c as createForksRpcOptions, u as unwrapSerializableConfig } from '../chunks/utils.Cn0zI1t3.js';
|
|
3
|
-
import { r as runVmTests } from '../chunks/vm.
|
|
3
|
+
import { r as runVmTests } from '../chunks/vm.DGhTouO3.js';
|
|
4
4
|
import '@vitest/utils';
|
|
5
5
|
import 'node:url';
|
|
6
6
|
import 'node:vm';
|
package/dist/workers.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { W as WorkerGlobalState, C as ContextRPC, B as BirpcOptions, R as RuntimeRPC } from './chunks/worker.
|
|
1
|
+
import { W as WorkerGlobalState, C as ContextRPC, B as BirpcOptions, R as RuntimeRPC } from './chunks/worker.o1PBoDdo.js';
|
|
2
2
|
import { Awaitable } from '@vitest/utils';
|
|
3
3
|
import * as v8 from 'v8';
|
|
4
|
-
import { S as SerializedConfig } from './chunks/config.
|
|
5
|
-
import { W as WorkerContext } from './chunks/worker.
|
|
4
|
+
import { S as SerializedConfig } from './chunks/config.BTPBhmK5.js';
|
|
5
|
+
import { W as WorkerContext } from './chunks/worker.ClntunZp.js';
|
|
6
6
|
import '@vitest/runner';
|
|
7
7
|
import 'vite-node';
|
|
8
|
-
import './chunks/environment.
|
|
8
|
+
import './chunks/environment.d8YfPkTm.js';
|
|
9
9
|
import '@vitest/snapshot';
|
|
10
10
|
import '@vitest/pretty-format';
|
|
11
11
|
import '@vitest/snapshot/environment';
|
package/dist/workers.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
export { p as provideWorkerState } from './chunks/utils.C8RiOc4B.js';
|
|
2
2
|
export { collect as collectVitestWorkerTests, run as runVitestWorker } from './worker.js';
|
|
3
|
-
export { r as runBaseTests } from './chunks/base.
|
|
3
|
+
export { r as runBaseTests } from './chunks/base.CUgXReRN.js';
|
|
4
4
|
export { c as createForksRpcOptions, a as createThreadsRpcOptions, u as unwrapSerializableConfig } from './chunks/utils.Cn0zI1t3.js';
|
|
5
|
-
export { r as runVmTests } from './chunks/vm.
|
|
5
|
+
export { r as runVmTests } from './chunks/vm.DGhTouO3.js';
|
|
6
6
|
import '@vitest/utils';
|
|
7
7
|
import 'node:url';
|
|
8
8
|
import '@vitest/utils/source-map';
|
|
@@ -12,7 +12,7 @@ import 'node:fs';
|
|
|
12
12
|
import 'pathe';
|
|
13
13
|
import './chunks/index.K90BXFOx.js';
|
|
14
14
|
import 'node:console';
|
|
15
|
-
import './chunks/inspector.
|
|
15
|
+
import './chunks/inspector.DKLceBVD.js';
|
|
16
16
|
import 'node:module';
|
|
17
17
|
import './chunks/rpc.C3q9uwRX.js';
|
|
18
18
|
import './chunks/index.68735LiX.js';
|