vitest 3.0.8 → 3.1.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/dist/browser.d.ts +12 -23
- package/dist/browser.js +2 -2
- package/dist/chunks/{base.XvKTsMeK.js → base.DV59CbtV.js} +1 -1
- package/dist/chunks/{benchmark.Cdu9hjj4.js → benchmark.DL72EVN-.js} +1 -1
- package/dist/chunks/{benchmark.CFFwLv-O.d.ts → benchmark.d.BwvBVTda.d.ts} +11 -11
- package/dist/chunks/{cac.VN5q-TPC.js → cac.BjmXy7OV.js} +11 -6
- package/dist/chunks/{cli-api.Dis64jtY.js → cli-api.BwkkJsRe.js} +13 -8
- package/dist/chunks/config.d.DevWltVl.d.ts +218 -0
- package/dist/chunks/{constants.fzPh7AOq.js → constants.DTYd6dNH.js} +1 -1
- package/dist/chunks/{coverage.DnNIv-kJ.js → coverage.A3sS5-Wm.js} +1 -29
- package/dist/chunks/coverage.d.S9RMNXIe.d.ts +35 -0
- package/dist/chunks/{resolveConfig.L1_HR0_0.js → coverage.gV8doR2Y.js} +496 -127
- package/dist/chunks/{creator.2CFRE1Yx.js → creator.BsBnpTzI.js} +1 -1
- package/dist/chunks/defaults.C2Ndd9wx.js +119 -0
- package/dist/chunks/env.D4Lgay0q.js +8 -0
- package/dist/chunks/environment.d.C8UItCbf.d.ts +170 -0
- package/dist/chunks/global.d.Cg2sEPIm.d.ts +127 -0
- package/dist/chunks/{globals.CydvVTgC.js → globals.BEpDe-k3.js} +4 -4
- package/dist/chunks/{index.CNRemkXW.js → index.D7Ny8f_s.js} +2 -2
- package/dist/chunks/{index.B7vJpkTD.js → index.DOyx6FYJ.js} +48 -18
- package/dist/chunks/{index.BmFgJtkv.js → index.uXkkC4xl.js} +1 -2
- package/dist/chunks/{mocker.cRtM890J.d.ts → mocker.d.BE_2ls6u.d.ts} +6 -6
- package/dist/chunks/reporters.d.r7poTZjA.d.ts +3012 -0
- package/dist/chunks/{runBaseTests.DnaAUBKD.js → runBaseTests.BVrL_ow3.js} +8 -8
- package/dist/chunks/{setup-common.Uaw6Zgv9.js → setup-common.CPvtqi8q.js} +25 -2
- package/dist/chunks/{suite.qtkXWc6R.d.ts → suite.d.FvehnV49.d.ts} +1 -1
- package/dist/chunks/{typechecker.cZ0LjdSi.js → typechecker.BlF3eHsb.js} +2 -7
- package/dist/chunks/{vi.B5EKKJdE.js → vi.nSCvwQ7l.js} +3 -3
- package/dist/chunks/vite.d.Fvq-NZoa.d.ts +11 -0
- package/dist/chunks/{worker.BmVno_ab.d.ts → worker.d.C58isfFm.d.ts} +62 -62
- package/dist/chunks/{worker.BT4v-DKx.d.ts → worker.d.CSFlSYJg.d.ts} +2 -2
- package/dist/cli.js +2 -2
- package/dist/config.d.ts +48 -45
- package/dist/config.js +6 -123
- package/dist/coverage.d.ts +82 -79
- package/dist/coverage.js +19 -469
- package/dist/environments.d.ts +11 -11
- package/dist/execute.d.ts +109 -109
- package/dist/index.d.ts +414 -412
- package/dist/index.js +3 -3
- package/dist/node.d.ts +51 -48
- package/dist/node.js +13 -10
- package/dist/reporters.d.ts +7 -4
- package/dist/reporters.js +3 -2
- package/dist/runners.d.ts +28 -28
- package/dist/runners.js +2 -3
- package/dist/snapshot.d.ts +2 -2
- package/dist/suite.d.ts +2 -2
- package/dist/suite.js +1 -1
- package/dist/workers/forks.js +1 -1
- package/dist/workers/runVmTests.js +8 -8
- package/dist/workers/threads.js +1 -1
- package/dist/workers.d.ts +13 -13
- package/dist/workers.js +1 -1
- package/package.json +11 -11
- package/dist/chunks/config.BCv-fVdT.d.ts +0 -215
- package/dist/chunks/environment.d8YfPkTm.d.ts +0 -173
- package/dist/chunks/global.CnI8_G5V.d.ts +0 -133
- package/dist/chunks/reporters.66aFHiyX.d.ts +0 -3051
- package/dist/chunks/vite.BCQa3xFG.d.ts +0 -11
package/dist/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export { c as createExpect, a as expect, i as inject, v as vi, b as vitest } from './chunks/vi.
|
|
1
|
+
export { c as createExpect, a as expect, i as inject, v as vi, b as vitest } from './chunks/vi.nSCvwQ7l.js';
|
|
2
2
|
export { i as isFirstRun, a as runOnce } from './chunks/run-once.2ogXb3JV.js';
|
|
3
|
-
export { a as assertType, g as getRunningMode, i as isWatchMode } from './chunks/index.
|
|
4
|
-
export { b as bench } from './chunks/benchmark.
|
|
3
|
+
export { a as assertType, g as getRunningMode, i as isWatchMode } from './chunks/index.D7Ny8f_s.js';
|
|
4
|
+
export { b as bench } from './chunks/benchmark.DL72EVN-.js';
|
|
5
5
|
export { expectTypeOf } from 'expect-type';
|
|
6
6
|
export { afterAll, afterEach, beforeAll, beforeEach, describe, it, onTestFailed, onTestFinished, suite, test } from '@vitest/runner';
|
|
7
7
|
import * as chai from 'chai';
|
package/dist/node.d.ts
CHANGED
|
@@ -1,29 +1,32 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export { B as BaseCoverageOptions,
|
|
1
|
+
import { w as ResolvedConfig, v as UserConfig, s as VitestRunMode, z as VitestOptions, V as Vitest, A as ApiConfig, E as TestProject, F as TestSequencer, G as TestSpecification, L as Logger, H as TestModule, M as ModuleDiagnostic } from './chunks/reporters.d.r7poTZjA.js';
|
|
2
|
+
export { B as BaseCoverageOptions, y as BenchmarkUserOptions, ad as BrowserBuiltinProvider, ae as BrowserCommand, af as BrowserCommandContext, n as BrowserConfigOptions, ag as BrowserInstanceOption, ah as BrowserOrchestrator, ai as BrowserProvider, aj as BrowserProviderInitializationOptions, ak as BrowserProviderModule, al as BrowserProviderOptions, m as BrowserScript, am as BrowserServerState, an as BrowserServerStateSession, o as BuiltinEnvironment, ao as CDPSession, r as CSSModuleScopeStrategy, j as CoverageIstanbulOptions, i as CoverageOptions, e as CoverageProvider, f as CoverageProviderModule, g as CoverageReporter, b as CoverageV8Options, k as CustomProviderOptions, D as DepsOptimizationOptions, Z as HTMLOptions, I as InlineConfig, $ as JUnitOptions, _ as JsonOptions, O as OnServerRestartHandler, J as OnTestsRerunHandler, ap as ParentProjectBrowser, P as Pool, q as PoolOptions, N as ProcessPool, aq as ProjectBrowser, x as ProjectConfig, a as ReportContext, aw as ReportedHookContext, l as Reporter, at as ResolveSnapshotPathHandler, au as ResolveSnapshotPathHandlerContext, ar as ResolvedBrowserOptions, R as ResolvedCoverageOptions, as as ResolvedProjectConfig, Y as SerializedTestProject, a0 as TaskOptions, a1 as TestCase, a2 as TestCollection, a3 as TestDiagnostic, a4 as TestModuleState, a5 as TestResult, a6 as TestResultFailed, a7 as TestResultPassed, a8 as TestResultSkipped, ax as TestRunEndReason, av as TestRunResult, ac as TestSequencerConstructor, a9 as TestState, aa as TestSuite, ab as TestSuiteState, t as TransformModePatterns, u as TypecheckConfig, U as UserWorkspaceConfig, p as VitestEnvironment, K as VitestPackageInstaller, Q as WorkspaceSpec, X as getFilePoolName } from './chunks/reporters.d.r7poTZjA.js';
|
|
3
3
|
import { UserConfig as UserConfig$1, 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
6
|
export { esbuildVersion, isFileServingAllowed, parseAst, parseAstAsync, rollupVersion, version as viteVersion } from 'vite';
|
|
7
7
|
import { IncomingMessage } from 'node:http';
|
|
8
|
-
import { R as RuntimeRPC } from './chunks/worker.
|
|
8
|
+
import { R as RuntimeRPC } from './chunks/worker.d.C58isfFm.js';
|
|
9
9
|
import { Writable } from 'node:stream';
|
|
10
|
-
export { W as WorkerContext } from './chunks/worker.
|
|
11
|
-
export { C as TypeCheckCollectLineNumbers, a as TypeCheckCollectLines, c as TypeCheckContext, T as TypeCheckErrorInfo, R as TypeCheckRawErrorsMap, b as TypeCheckRootAndTarget } from './chunks/global.
|
|
10
|
+
export { W as WorkerContext } from './chunks/worker.d.CSFlSYJg.js';
|
|
11
|
+
export { C as TypeCheckCollectLineNumbers, a as TypeCheckCollectLines, c as TypeCheckContext, T as TypeCheckErrorInfo, R as TypeCheckRawErrorsMap, b as TypeCheckRootAndTarget } from './chunks/global.d.Cg2sEPIm.js';
|
|
12
12
|
import { Debugger } from 'debug';
|
|
13
13
|
export { Task as RunnerTask, TaskResult as RunnerTaskResult, TaskResultPack as RunnerTaskResultPack, Test as RunnerTestCase, File as RunnerTestFile, Suite as RunnerTestSuite, SequenceHooks, SequenceSetupFiles } from '@vitest/runner';
|
|
14
|
-
export { f as EnvironmentOptions, H as HappyDOMOptions, J as JSDOMOptions } from './chunks/environment.
|
|
14
|
+
export { f as EnvironmentOptions, H as HappyDOMOptions, J as JSDOMOptions } from './chunks/environment.d.C8UItCbf.js';
|
|
15
15
|
export { SerializedError } from '@vitest/utils';
|
|
16
|
-
export { b as RuntimeConfig } from './chunks/config.
|
|
17
|
-
import './chunks/vite.
|
|
16
|
+
export { b as RuntimeConfig } from './chunks/config.d.DevWltVl.js';
|
|
17
|
+
import './chunks/vite.d.Fvq-NZoa.js';
|
|
18
18
|
export { generateFileHash } from '@vitest/runner/utils';
|
|
19
|
+
import 'node:console';
|
|
19
20
|
import '@vitest/utils/source-map';
|
|
20
21
|
import '@vitest/pretty-format';
|
|
21
22
|
import '@vitest/snapshot';
|
|
22
23
|
import '@vitest/utils/diff';
|
|
23
24
|
import 'vite-node';
|
|
24
25
|
import 'chai';
|
|
25
|
-
import './chunks/benchmark.
|
|
26
|
+
import './chunks/benchmark.d.BwvBVTda.js';
|
|
26
27
|
import 'tinybench';
|
|
28
|
+
import './chunks/coverage.d.S9RMNXIe.js';
|
|
29
|
+
import 'vite-node/client';
|
|
27
30
|
import '@vitest/snapshot/manager';
|
|
28
31
|
import 'node:fs';
|
|
29
32
|
import 'node:worker_threads';
|
|
@@ -33,36 +36,36 @@ import '@vitest/snapshot/environment';
|
|
|
33
36
|
declare function isValidApiRequest(config: ResolvedConfig, req: IncomingMessage): boolean;
|
|
34
37
|
|
|
35
38
|
interface CliOptions extends UserConfig {
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
39
|
+
/**
|
|
40
|
+
* Override the watch mode
|
|
41
|
+
*/
|
|
42
|
+
run?: boolean;
|
|
43
|
+
/**
|
|
44
|
+
* Removes colors from the console output
|
|
45
|
+
*/
|
|
46
|
+
color?: boolean;
|
|
47
|
+
/**
|
|
48
|
+
* Output collected tests as JSON or to a file
|
|
49
|
+
*/
|
|
50
|
+
json?: string | boolean;
|
|
51
|
+
/**
|
|
52
|
+
* Output collected test files only
|
|
53
|
+
*/
|
|
54
|
+
filesOnly?: boolean;
|
|
52
55
|
}
|
|
53
56
|
/**
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
57
|
+
* Start Vitest programmatically
|
|
58
|
+
*
|
|
59
|
+
* Returns a Vitest instance if initialized successfully.
|
|
60
|
+
*/
|
|
58
61
|
declare function startVitest(mode: VitestRunMode, cliFilters?: string[], options?: CliOptions, viteOverrides?: UserConfig$1, vitestOptions?: VitestOptions): Promise<Vitest>;
|
|
59
62
|
|
|
60
63
|
interface CliParseOptions {
|
|
61
|
-
|
|
64
|
+
allowUnknownOptions?: boolean;
|
|
62
65
|
}
|
|
63
66
|
declare function parseCLI(argv: string | string[], config?: CliParseOptions): {
|
|
64
|
-
|
|
65
|
-
|
|
67
|
+
filter: string[]
|
|
68
|
+
options: CliOptions
|
|
66
69
|
};
|
|
67
70
|
|
|
68
71
|
declare function resolveApiServerConfig<Options extends ApiConfig & UserConfig>(options: Options, defaultPort: number): ApiConfig | undefined;
|
|
@@ -70,12 +73,12 @@ declare function resolveApiServerConfig<Options extends ApiConfig & UserConfig>(
|
|
|
70
73
|
declare function createVitest(mode: VitestRunMode, options: UserConfig, viteOverrides?: UserConfig$1, vitestOptions?: VitestOptions): Promise<Vitest>;
|
|
71
74
|
|
|
72
75
|
declare class FilesNotFoundError extends Error {
|
|
73
|
-
|
|
74
|
-
|
|
76
|
+
code: string;
|
|
77
|
+
constructor(mode: "test" | "benchmark");
|
|
75
78
|
}
|
|
76
79
|
declare class GitNotFoundError extends Error {
|
|
77
|
-
|
|
78
|
-
|
|
80
|
+
code: string;
|
|
81
|
+
constructor();
|
|
79
82
|
}
|
|
80
83
|
|
|
81
84
|
/** @deprecated use `TestProject` instead */
|
|
@@ -84,23 +87,23 @@ type GlobalSetupContext = TestProject;
|
|
|
84
87
|
declare function VitestPlugin(options?: UserConfig, ctx?: Vitest): Promise<Plugin[]>;
|
|
85
88
|
|
|
86
89
|
declare function resolveConfig(options?: UserConfig, viteOverrides?: UserConfig$1): Promise<{
|
|
87
|
-
|
|
88
|
-
|
|
90
|
+
vitestConfig: ResolvedConfig
|
|
91
|
+
viteConfig: ResolvedConfig$1
|
|
89
92
|
}>;
|
|
90
93
|
|
|
91
94
|
declare function resolveFsAllow(projectRoot: string, rootConfigFile: string | false | undefined): string[];
|
|
92
95
|
|
|
93
96
|
interface MethodsOptions {
|
|
94
|
-
|
|
95
|
-
|
|
97
|
+
cacheFs?: boolean;
|
|
98
|
+
collect?: boolean;
|
|
96
99
|
}
|
|
97
100
|
declare function createMethodsRPC(project: TestProject, options?: MethodsOptions): RuntimeRPC;
|
|
98
101
|
|
|
99
102
|
declare class BaseSequencer implements TestSequencer {
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
103
|
+
protected ctx: Vitest;
|
|
104
|
+
constructor(ctx: Vitest);
|
|
105
|
+
shard(files: TestSpecification[]): Promise<TestSpecification[]>;
|
|
106
|
+
sort(files: TestSpecification[]): Promise<TestSpecification[]>;
|
|
104
107
|
}
|
|
105
108
|
|
|
106
109
|
declare function registerConsoleShortcuts(ctx: Vitest, stdin: NodeJS.ReadStream | undefined, stdout: NodeJS.WriteStream | Writable): () => void;
|
|
@@ -119,13 +122,13 @@ declare const createServer: typeof createServer$1;
|
|
|
119
122
|
declare const createViteServer: typeof createServer$1;
|
|
120
123
|
|
|
121
124
|
/**
|
|
122
|
-
|
|
123
|
-
|
|
125
|
+
* @deprecated Use `TestModule` instead
|
|
126
|
+
*/
|
|
124
127
|
declare const TestFile: typeof TestModule;
|
|
125
128
|
|
|
126
129
|
/**
|
|
127
|
-
|
|
128
|
-
|
|
130
|
+
* @deprecated Use `ModuleDiagnostic` instead
|
|
131
|
+
*/
|
|
129
132
|
type FileDiagnostic = ModuleDiagnostic;
|
|
130
133
|
|
|
131
134
|
export { ApiConfig, BaseSequencer, type CliParseOptions, type FileDiagnostic, GitNotFoundError, type GlobalSetupContext, ModuleDiagnostic, ResolvedConfig, TestFile, TestModule, TestProject, TestSequencer, TestSpecification, FilesNotFoundError as TestsNotFoundError, UserConfig, Vitest, VitestOptions, VitestPlugin, VitestRunMode, TestProject as WorkspaceProject, createDebugger, createMethodsRPC, createServer, createViteLogger, createViteServer, createVitest, distDir, isValidApiRequest, parseCLI, registerConsoleShortcuts, resolveApiServerConfig, resolveConfig, resolveFsAllow, rootDir, startVitest, version };
|
package/dist/node.js
CHANGED
|
@@ -1,32 +1,33 @@
|
|
|
1
1
|
import { resolveConfig as resolveConfig$1, mergeConfig, createServer as createServer$1 } from 'vite';
|
|
2
2
|
export { esbuildVersion, isFileServingAllowed, parseAst, parseAstAsync, rollupVersion, version as viteVersion } from 'vite';
|
|
3
|
-
import { V as Vitest, a as VitestPlugin, T as TestModule } from './chunks/cli-api.
|
|
4
|
-
export { G as GitNotFoundError, F as TestsNotFoundError, b as VitestPackageInstaller, e as createViteLogger, c as createVitest, i as isValidApiRequest, d as registerConsoleShortcuts, r as resolveFsAllow, s as startVitest } from './chunks/cli-api.
|
|
5
|
-
export { p as parseCLI } from './chunks/cac.
|
|
6
|
-
import {
|
|
7
|
-
export {
|
|
3
|
+
import { V as Vitest, a as VitestPlugin, T as TestModule } from './chunks/cli-api.BwkkJsRe.js';
|
|
4
|
+
export { G as GitNotFoundError, F as TestsNotFoundError, b as VitestPackageInstaller, e as createViteLogger, c as createVitest, i as isValidApiRequest, d as registerConsoleShortcuts, r as resolveFsAllow, s as startVitest } from './chunks/cli-api.BwkkJsRe.js';
|
|
5
|
+
export { p as parseCLI } from './chunks/cac.BjmXy7OV.js';
|
|
6
|
+
import { r as resolveConfig$2 } from './chunks/coverage.gV8doR2Y.js';
|
|
7
|
+
export { b as BaseSequencer, c as createMethodsRPC, g as getFilePoolName, a as resolveApiServerConfig } from './chunks/coverage.gV8doR2Y.js';
|
|
8
8
|
import { slash } from '@vitest/utils';
|
|
9
9
|
import { f as findUp } from './chunks/index.DBIGubLC.js';
|
|
10
10
|
import { resolve } from 'pathe';
|
|
11
|
-
import { c as configFiles } from './chunks/constants.
|
|
11
|
+
import { c as configFiles } from './chunks/constants.DTYd6dNH.js';
|
|
12
12
|
export { distDir, rootDir } from './path.js';
|
|
13
13
|
import createDebug from 'debug';
|
|
14
14
|
export { generateFileHash } from '@vitest/runner/utils';
|
|
15
15
|
import 'node:fs';
|
|
16
|
-
import './chunks/coverage.
|
|
16
|
+
import './chunks/coverage.A3sS5-Wm.js';
|
|
17
17
|
import 'node:path';
|
|
18
18
|
import '@vitest/snapshot/manager';
|
|
19
19
|
import 'vite-node/client';
|
|
20
20
|
import 'vite-node/server';
|
|
21
21
|
import './chunks/index.68735LiX.js';
|
|
22
|
-
import './chunks/index.
|
|
22
|
+
import './chunks/index.DOyx6FYJ.js';
|
|
23
23
|
import 'tinyrainbow';
|
|
24
24
|
import './chunks/utils.bLM2atbD.js';
|
|
25
25
|
import 'node:util';
|
|
26
26
|
import 'node:perf_hooks';
|
|
27
27
|
import '@vitest/utils/source-map';
|
|
28
|
-
import './chunks/
|
|
28
|
+
import './chunks/env.D4Lgay0q.js';
|
|
29
29
|
import 'std-env';
|
|
30
|
+
import './chunks/typechecker.BlF3eHsb.js';
|
|
30
31
|
import 'node:fs/promises';
|
|
31
32
|
import 'tinyexec';
|
|
32
33
|
import 'node:os';
|
|
@@ -50,14 +51,15 @@ import 'node:crypto';
|
|
|
50
51
|
import 'path';
|
|
51
52
|
import 'vite-node/utils';
|
|
52
53
|
import '@vitest/mocker/node';
|
|
54
|
+
import './chunks/defaults.C2Ndd9wx.js';
|
|
53
55
|
import 'magic-string';
|
|
54
56
|
import 'node:assert';
|
|
55
57
|
import '@vitest/utils/error';
|
|
56
58
|
import 'node:readline';
|
|
59
|
+
import 'util';
|
|
57
60
|
import 'node:process';
|
|
58
61
|
import 'node:v8';
|
|
59
62
|
import 'node:tty';
|
|
60
|
-
import 'util';
|
|
61
63
|
import 'node:events';
|
|
62
64
|
import 'tinypool';
|
|
63
65
|
import 'node:worker_threads';
|
|
@@ -88,6 +90,7 @@ async function resolveConfig(options = {}, viteOverrides = {}) {
|
|
|
88
90
|
updatedOptions,
|
|
89
91
|
config
|
|
90
92
|
);
|
|
93
|
+
await vitest.close();
|
|
91
94
|
return {
|
|
92
95
|
viteConfig: config,
|
|
93
96
|
vitestConfig
|
package/dist/reporters.d.ts
CHANGED
|
@@ -1,19 +1,22 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { aM as BaseReporter, ay as BasicReporter, aN as BenchmarkBuiltinReporters, az as BenchmarkReporter, aA as BenchmarkReportsMap, aO as BuiltinReporterOptions, aP as BuiltinReporters, aB as DefaultReporter, aC as DotReporter, aD as GithubActionsReporter, aE as HangingProcessReporter, aG as JUnitReporter, aQ as JsonAssertionResult, aF as JsonReporter, aR as JsonTestResult, aS as JsonTestResults, aw as ReportedHookContext, l as Reporter, aH as ReportersMap, aI as TapFlatReporter, aJ as TapReporter, ax as TestRunEndReason, aK as VerboseBenchmarkReporter, aL as VerboseReporter } from './chunks/reporters.d.r7poTZjA.js';
|
|
2
2
|
import '@vitest/runner';
|
|
3
|
-
import './chunks/environment.
|
|
3
|
+
import './chunks/environment.d.C8UItCbf.js';
|
|
4
4
|
import '@vitest/utils';
|
|
5
5
|
import 'node:stream';
|
|
6
6
|
import 'vite';
|
|
7
|
+
import 'node:console';
|
|
7
8
|
import '@vitest/utils/source-map';
|
|
8
|
-
import './chunks/config.
|
|
9
|
+
import './chunks/config.d.DevWltVl.js';
|
|
9
10
|
import '@vitest/pretty-format';
|
|
10
11
|
import '@vitest/snapshot';
|
|
11
12
|
import '@vitest/snapshot/environment';
|
|
12
13
|
import '@vitest/utils/diff';
|
|
13
14
|
import 'vite-node';
|
|
14
15
|
import 'chai';
|
|
15
|
-
import './chunks/benchmark.
|
|
16
|
+
import './chunks/benchmark.d.BwvBVTda.js';
|
|
16
17
|
import '@vitest/runner/utils';
|
|
17
18
|
import 'tinybench';
|
|
19
|
+
import './chunks/coverage.d.S9RMNXIe.js';
|
|
20
|
+
import 'vite-node/client';
|
|
18
21
|
import '@vitest/snapshot/manager';
|
|
19
22
|
import 'node:fs';
|
package/dist/reporters.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { B as BasicReporter, a as BenchmarkReporter, b as BenchmarkReportsMap, D as DefaultReporter, c as DotReporter, G as GithubActionsReporter, H as HangingProcessReporter, d as JUnitReporter, J as JsonReporter, R as ReportersMap, T as TapFlatReporter, e as TapReporter, V as VerboseBenchmarkReporter, f as VerboseReporter } from './chunks/index.
|
|
1
|
+
export { B as BasicReporter, a as BenchmarkReporter, b as BenchmarkReportsMap, D as DefaultReporter, c as DotReporter, G as GithubActionsReporter, H as HangingProcessReporter, d as JUnitReporter, J as JsonReporter, R as ReportersMap, T as TapFlatReporter, e as TapReporter, V as VerboseBenchmarkReporter, f as VerboseReporter } from './chunks/index.DOyx6FYJ.js';
|
|
2
2
|
import 'node:fs';
|
|
3
3
|
import '@vitest/runner/utils';
|
|
4
4
|
import 'pathe';
|
|
@@ -8,8 +8,9 @@ import 'node:util';
|
|
|
8
8
|
import '@vitest/utils';
|
|
9
9
|
import 'node:perf_hooks';
|
|
10
10
|
import '@vitest/utils/source-map';
|
|
11
|
-
import './chunks/
|
|
11
|
+
import './chunks/env.D4Lgay0q.js';
|
|
12
12
|
import 'std-env';
|
|
13
|
+
import './chunks/typechecker.BlF3eHsb.js';
|
|
13
14
|
import 'node:fs/promises';
|
|
14
15
|
import 'tinyexec';
|
|
15
16
|
import 'vite';
|
package/dist/runners.d.ts
CHANGED
|
@@ -1,43 +1,43 @@
|
|
|
1
1
|
import * as tinybench from 'tinybench';
|
|
2
2
|
import { VitestRunner, VitestRunnerImportSource, Suite, File, Task, CancelReason, TestContext } from '@vitest/runner';
|
|
3
3
|
export { VitestRunner } from '@vitest/runner';
|
|
4
|
-
import { a as SerializedConfig } from './chunks/config.
|
|
4
|
+
import { a as SerializedConfig } from './chunks/config.d.DevWltVl.js';
|
|
5
5
|
import '@vitest/pretty-format';
|
|
6
6
|
import '@vitest/snapshot';
|
|
7
7
|
import '@vitest/snapshot/environment';
|
|
8
8
|
import '@vitest/utils/diff';
|
|
9
9
|
|
|
10
10
|
declare class NodeBenchmarkRunner implements VitestRunner {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
11
|
+
config: SerializedConfig;
|
|
12
|
+
private __vitest_executor;
|
|
13
|
+
constructor(config: SerializedConfig);
|
|
14
|
+
importTinybench(): Promise<typeof tinybench>;
|
|
15
|
+
importFile(filepath: string, source: VitestRunnerImportSource): unknown;
|
|
16
|
+
runSuite(suite: Suite): Promise<void>;
|
|
17
|
+
runTask(): Promise<void>;
|
|
18
18
|
}
|
|
19
19
|
|
|
20
20
|
declare class VitestTestRunner implements VitestRunner {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
21
|
+
config: SerializedConfig;
|
|
22
|
+
private snapshotClient;
|
|
23
|
+
private workerState;
|
|
24
|
+
private __vitest_executor;
|
|
25
|
+
private cancelRun;
|
|
26
|
+
private assertionsErrors;
|
|
27
|
+
pool: string;
|
|
28
|
+
constructor(config: SerializedConfig);
|
|
29
|
+
importFile(filepath: string, source: VitestRunnerImportSource): unknown;
|
|
30
|
+
onCollectStart(file: File): void;
|
|
31
|
+
onAfterRunFiles(): void;
|
|
32
|
+
onAfterRunSuite(suite: Suite): Promise<void>;
|
|
33
|
+
onAfterRunTask(test: Task): void;
|
|
34
|
+
onCancel(_reason: CancelReason): void;
|
|
35
|
+
injectValue(key: string): any;
|
|
36
|
+
onBeforeRunTask(test: Task): Promise<void>;
|
|
37
|
+
onBeforeRunSuite(suite: Suite): Promise<void>;
|
|
38
|
+
onBeforeTryTask(test: Task): void;
|
|
39
|
+
onAfterTryTask(test: Task): void;
|
|
40
|
+
extendTaskContext(context: TestContext): TestContext;
|
|
41
41
|
}
|
|
42
42
|
|
|
43
43
|
export { NodeBenchmarkRunner, VitestTestRunner };
|
package/dist/runners.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { updateTask } from '@vitest/runner';
|
|
2
2
|
import { createDefer, getSafeTimers } from '@vitest/utils';
|
|
3
|
-
import { a as getBenchOptions, g as getBenchFn } from './chunks/benchmark.
|
|
3
|
+
import { a as getBenchOptions, g as getBenchFn } from './chunks/benchmark.DL72EVN-.js';
|
|
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.nSCvwQ7l.js';
|
|
8
8
|
import { r as rpc } from './chunks/rpc.TVf73xOu.js';
|
|
9
9
|
import 'chai';
|
|
10
10
|
import './chunks/_commonjsHelpers.BFTU3MAI.js';
|
|
@@ -224,7 +224,6 @@ class VitestTestRunner {
|
|
|
224
224
|
isExpectingAssertionsError: null,
|
|
225
225
|
expectedAssertionsNumber: null,
|
|
226
226
|
expectedAssertionsNumberErrorGen: null,
|
|
227
|
-
testPath: test.file.filepath,
|
|
228
227
|
currentTestName: getTestName(test),
|
|
229
228
|
snapshotState: this.snapshotClient.getSnapshotState(test.file.filepath)
|
|
230
229
|
},
|
package/dist/snapshot.d.ts
CHANGED
|
@@ -2,8 +2,8 @@ import { NodeSnapshotEnvironment } from '@vitest/snapshot/environment';
|
|
|
2
2
|
export { SnapshotEnvironment } from '@vitest/snapshot/environment';
|
|
3
3
|
|
|
4
4
|
declare class VitestNodeSnapshotEnvironment extends NodeSnapshotEnvironment {
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
getHeader(): string;
|
|
6
|
+
resolvePath(filepath: string): Promise<string>;
|
|
7
7
|
}
|
|
8
8
|
|
|
9
9
|
export { VitestNodeSnapshotEnvironment as VitestSnapshotEnvironment };
|
package/dist/suite.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export { g as getBenchFn, a as getBenchOptions } from './chunks/suite.
|
|
1
|
+
export { g as getBenchFn, a as getBenchOptions } from './chunks/suite.d.FvehnV49.js';
|
|
2
2
|
export { VitestRunner, VitestRunnerConfig, createTaskCollector, getCurrentSuite, getCurrentTest, getFn, getHooks, setFn, setHooks } from '@vitest/runner';
|
|
3
3
|
export { createChainable } from '@vitest/runner/utils';
|
|
4
|
-
import './chunks/benchmark.
|
|
4
|
+
import './chunks/benchmark.d.BwvBVTda.js';
|
|
5
5
|
import 'tinybench';
|
package/dist/suite.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { g as getBenchFn, a as getBenchOptions } from './chunks/benchmark.
|
|
1
|
+
export { g as getBenchFn, a as getBenchOptions } from './chunks/benchmark.DL72EVN-.js';
|
|
2
2
|
export { createTaskCollector, getCurrentSuite, getCurrentTest, getFn, getHooks, setFn, setHooks } from '@vitest/runner';
|
|
3
3
|
export { createChainable } from '@vitest/runner/utils';
|
|
4
4
|
import '@vitest/utils';
|
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.DV59CbtV.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.eDH0aFFd.js';
|
|
@@ -6,11 +6,10 @@ import util from 'node:util';
|
|
|
6
6
|
import { startTests, collectTests } from '@vitest/runner';
|
|
7
7
|
import { KNOWN_ASSET_TYPES } from 'vite-node/constants';
|
|
8
8
|
import { installSourcemapsSupport } from 'vite-node/source-map';
|
|
9
|
-
import { s as setupChaiConfig, r as resolveTestRunner, a as resolveSnapshotEnvironment } from '../chunks/index.
|
|
10
|
-
import { s as startCoverageInsideWorker, a as stopCoverageInsideWorker } from '../chunks/
|
|
11
|
-
import { V as VitestIndex } from '../chunks/index.
|
|
9
|
+
import { s as setupChaiConfig, r as resolveTestRunner, a as resolveSnapshotEnvironment } from '../chunks/index.uXkkC4xl.js';
|
|
10
|
+
import { c as setupCommonEnv, s as startCoverageInsideWorker, a as stopCoverageInsideWorker } from '../chunks/setup-common.CPvtqi8q.js';
|
|
11
|
+
import { V as VitestIndex } from '../chunks/index.D7Ny8f_s.js';
|
|
12
12
|
import { c as closeInspector } from '../chunks/inspector.DKLceBVD.js';
|
|
13
|
-
import { s as setupCommonEnv } from '../chunks/setup-common.Uaw6Zgv9.js';
|
|
14
13
|
import { g as getWorkerState } from '../chunks/utils.C8RiOc4B.js';
|
|
15
14
|
import 'chai';
|
|
16
15
|
import 'node:path';
|
|
@@ -19,17 +18,18 @@ import 'node:url';
|
|
|
19
18
|
import '../chunks/rpc.TVf73xOu.js';
|
|
20
19
|
import '@vitest/utils';
|
|
21
20
|
import '../chunks/index.68735LiX.js';
|
|
22
|
-
import '../chunks/
|
|
21
|
+
import '../chunks/coverage.A3sS5-Wm.js';
|
|
22
|
+
import '@vitest/snapshot';
|
|
23
|
+
import '../chunks/run-once.2ogXb3JV.js';
|
|
24
|
+
import '../chunks/vi.nSCvwQ7l.js';
|
|
23
25
|
import '@vitest/expect';
|
|
24
26
|
import '@vitest/runner/utils';
|
|
25
27
|
import '../chunks/_commonjsHelpers.BFTU3MAI.js';
|
|
26
|
-
import '@vitest/snapshot';
|
|
27
28
|
import '@vitest/utils/error';
|
|
28
29
|
import '@vitest/spy';
|
|
29
30
|
import '@vitest/utils/source-map';
|
|
30
31
|
import '../chunks/date.W2xKR2qe.js';
|
|
31
|
-
import '../chunks/
|
|
32
|
-
import '../chunks/benchmark.Cdu9hjj4.js';
|
|
32
|
+
import '../chunks/benchmark.DL72EVN-.js';
|
|
33
33
|
import 'expect-type';
|
|
34
34
|
|
|
35
35
|
async function run(method, files, config, executor) {
|
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.DV59CbtV.js';
|
|
2
2
|
import { a as createThreadsRpcOptions } from '../chunks/utils.Cn0zI1t3.js';
|
|
3
3
|
import 'vite-node/client';
|
|
4
4
|
import '../chunks/execute.eDH0aFFd.js';
|
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.d.C58isfFm.js';
|
|
2
2
|
import { Awaitable } from '@vitest/utils';
|
|
3
3
|
import * as v8 from 'v8';
|
|
4
|
-
import { a as SerializedConfig } from './chunks/config.
|
|
5
|
-
import { W as WorkerContext } from './chunks/worker.
|
|
4
|
+
import { a as SerializedConfig } from './chunks/config.d.DevWltVl.js';
|
|
5
|
+
import { W as WorkerContext } from './chunks/worker.d.CSFlSYJg.js';
|
|
6
6
|
import '@vitest/runner';
|
|
7
7
|
import 'vite-node';
|
|
8
|
-
import './chunks/environment.
|
|
8
|
+
import './chunks/environment.d.C8UItCbf.js';
|
|
9
9
|
import '@vitest/snapshot';
|
|
10
10
|
import '@vitest/pretty-format';
|
|
11
11
|
import '@vitest/snapshot/environment';
|
|
@@ -17,22 +17,22 @@ declare function provideWorkerState(context: any, state: WorkerGlobalState): Wor
|
|
|
17
17
|
declare function run(ctx: ContextRPC): Promise<void>;
|
|
18
18
|
declare function collect(ctx: ContextRPC): Promise<void>;
|
|
19
19
|
|
|
20
|
-
declare function runBaseTests(method:
|
|
20
|
+
declare function runBaseTests(method: "run" | "collect", state: WorkerGlobalState): Promise<void>;
|
|
21
21
|
|
|
22
|
-
type WorkerRpcOptions = Pick<BirpcOptions<RuntimeRPC>,
|
|
22
|
+
type WorkerRpcOptions = Pick<BirpcOptions<RuntimeRPC>, "on" | "post" | "serialize" | "deserialize">;
|
|
23
23
|
interface VitestWorker {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
24
|
+
getRpcOptions: (ctx: ContextRPC) => WorkerRpcOptions;
|
|
25
|
+
runTests: (state: WorkerGlobalState) => Awaitable<unknown>;
|
|
26
|
+
collectTests: (state: WorkerGlobalState) => Awaitable<unknown>;
|
|
27
27
|
}
|
|
28
28
|
|
|
29
|
-
declare function createThreadsRpcOptions({ port
|
|
29
|
+
declare function createThreadsRpcOptions({ port }: WorkerContext): WorkerRpcOptions;
|
|
30
30
|
declare function createForksRpcOptions(nodeV8: typeof v8): WorkerRpcOptions;
|
|
31
31
|
/**
|
|
32
|
-
|
|
33
|
-
|
|
32
|
+
* Reverts the wrapping done by `utils/config-helpers.ts`'s `wrapSerializableConfig`
|
|
33
|
+
*/
|
|
34
34
|
declare function unwrapSerializableConfig(config: SerializedConfig): SerializedConfig;
|
|
35
35
|
|
|
36
|
-
declare function runVmTests(method:
|
|
36
|
+
declare function runVmTests(method: "run" | "collect", state: WorkerGlobalState): Promise<void>;
|
|
37
37
|
|
|
38
38
|
export { type VitestWorker, type WorkerRpcOptions, collect as collectVitestWorkerTests, createForksRpcOptions, createThreadsRpcOptions, provideWorkerState, runBaseTests, run as runVitestWorker, runVmTests, unwrapSerializableConfig };
|
package/dist/workers.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
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.DV59CbtV.js';
|
|
4
4
|
export { c as createForksRpcOptions, a as createThreadsRpcOptions, u as unwrapSerializableConfig } from './chunks/utils.Cn0zI1t3.js';
|
|
5
5
|
export { r as runVmTests } from './chunks/vm.jEFQDlX_.js';
|
|
6
6
|
import '@vitest/utils';
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vitest",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "3.0.
|
|
4
|
+
"version": "3.1.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",
|
|
@@ -123,8 +123,8 @@
|
|
|
123
123
|
"@types/node": "^18.0.0 || ^20.0.0 || >=22.0.0",
|
|
124
124
|
"happy-dom": "*",
|
|
125
125
|
"jsdom": "*",
|
|
126
|
-
"@vitest/
|
|
127
|
-
"@vitest/
|
|
126
|
+
"@vitest/browser": "3.1.0-beta.1",
|
|
127
|
+
"@vitest/ui": "3.1.0-beta.1"
|
|
128
128
|
},
|
|
129
129
|
"peerDependenciesMeta": {
|
|
130
130
|
"@edge-runtime/vm": {
|
|
@@ -162,14 +162,14 @@
|
|
|
162
162
|
"tinyrainbow": "^2.0.0",
|
|
163
163
|
"vite": "^5.0.0 || ^6.0.0",
|
|
164
164
|
"why-is-node-running": "^2.3.0",
|
|
165
|
-
"@vitest/expect": "3.0.
|
|
166
|
-
"@vitest/
|
|
167
|
-
"@vitest/
|
|
168
|
-
"@vitest/runner": "3.0.
|
|
169
|
-
"@vitest/spy": "3.0.
|
|
170
|
-
"
|
|
171
|
-
"@vitest/utils": "3.0.
|
|
172
|
-
"
|
|
165
|
+
"@vitest/expect": "3.1.0-beta.1",
|
|
166
|
+
"@vitest/pretty-format": "^3.1.0-beta.1",
|
|
167
|
+
"@vitest/mocker": "3.1.0-beta.1",
|
|
168
|
+
"@vitest/runner": "3.1.0-beta.1",
|
|
169
|
+
"@vitest/spy": "3.1.0-beta.1",
|
|
170
|
+
"@vitest/snapshot": "3.1.0-beta.1",
|
|
171
|
+
"@vitest/utils": "3.1.0-beta.1",
|
|
172
|
+
"vite-node": "3.1.0-beta.1"
|
|
173
173
|
},
|
|
174
174
|
"devDependencies": {
|
|
175
175
|
"@ampproject/remapping": "^2.3.0",
|