vitest 2.2.0-beta.1 → 2.2.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 +0 -75
- package/dist/browser.d.ts +6 -6
- package/dist/chunks/{RandomSequencer.CMRlh2v4.js → RandomSequencer.BPedXEug.js} +1 -0
- package/dist/chunks/{benchmark.geERunq4.d.ts → benchmark.CFFwLv-O.d.ts} +2 -2
- package/dist/chunks/{cac.Z91LBqmg.js → cac.Cs06pOqp.js} +5 -5
- package/dist/chunks/{cli-api.DVJJMJHj.js → cli-api.CB-jIbYQ.js} +570 -406
- package/dist/chunks/{index.DLRzErGF.js → index.bzFpKeaq.js} +568 -794
- package/dist/chunks/{reporters.B_9uUTGW.d.ts → reporters.F9D2idOT.d.ts} +1231 -1204
- package/dist/chunks/{resolveConfig.CQIc6fe7.js → resolveConfig.CLnvCvEs.js} +8 -8
- package/dist/chunks/{suite.B2jumIFP.d.ts → suite.BJU7kdY9.d.ts} +4 -4
- package/dist/chunks/{utils.DNoFbBUZ.js → utils.DJONn5B5.js} +15 -21
- package/dist/chunks/{vite.Bvms8Xir.d.ts → vite.DonA4fvH.d.ts} +1 -1
- package/dist/cli.js +1 -1
- package/dist/config.d.ts +10 -9
- package/dist/coverage.d.ts +6 -6
- package/dist/coverage.js +2 -2
- package/dist/index.d.ts +7 -6
- package/dist/node.d.ts +19 -10
- package/dist/node.js +9 -9
- package/dist/reporters.d.ts +6 -6
- package/dist/reporters.js +4 -5
- package/dist/runners.d.ts +2 -2
- package/dist/suite.d.ts +2 -2
- package/package.json +13 -12
|
@@ -13,7 +13,7 @@ import c from 'tinyrainbow';
|
|
|
13
13
|
import { e as extraInlineDeps, d as defaultPort, a as defaultBrowserPort, b as defaultInspectPort } from './constants.fzPh7AOq.js';
|
|
14
14
|
import * as nodeos from 'node:os';
|
|
15
15
|
import nodeos__default from 'node:os';
|
|
16
|
-
import { h as hash, w as wrapSerializableConfig, T as Typechecker, i as isWindows, R as RandomSequencer, B as BaseSequencer } from './RandomSequencer.
|
|
16
|
+
import { h as hash, w as wrapSerializableConfig, T as Typechecker, i as isWindows, R as RandomSequencer, B as BaseSequencer } from './RandomSequencer.BPedXEug.js';
|
|
17
17
|
import { isCI, provider } from 'std-env';
|
|
18
18
|
import { g as getDefaultExportFromCjs } from './_commonjsHelpers.BFTU3MAI.js';
|
|
19
19
|
import require$$0 from 'util';
|
|
@@ -6553,7 +6553,7 @@ async function groupFilesByEnv(files) {
|
|
|
6553
6553
|
const filesWithEnv = await Promise.all(
|
|
6554
6554
|
files.map(async (spec) => {
|
|
6555
6555
|
const file = spec.moduleId;
|
|
6556
|
-
const project = spec.project
|
|
6556
|
+
const project = spec.project;
|
|
6557
6557
|
const code = await promises$1.readFile(file, "utf-8");
|
|
6558
6558
|
let env = code.match(/@(?:vitest|jest)-environment\s+([\w-]+)\b/)?.[1];
|
|
6559
6559
|
if (!env) {
|
|
@@ -6601,14 +6601,14 @@ function createMethodsRPC(project, options = {}) {
|
|
|
6601
6601
|
},
|
|
6602
6602
|
resolveSnapshotPath(testPath) {
|
|
6603
6603
|
return ctx.snapshot.resolvePath(testPath, {
|
|
6604
|
-
config: project.
|
|
6604
|
+
config: project.serializedConfig
|
|
6605
6605
|
});
|
|
6606
6606
|
},
|
|
6607
6607
|
async getSourceMap(id, force) {
|
|
6608
6608
|
if (force) {
|
|
6609
|
-
const mod = project.
|
|
6609
|
+
const mod = project.vite.moduleGraph.getModuleById(id);
|
|
6610
6610
|
if (mod) {
|
|
6611
|
-
project.
|
|
6611
|
+
project.vite.moduleGraph.invalidateModule(mod);
|
|
6612
6612
|
}
|
|
6613
6613
|
}
|
|
6614
6614
|
const r = await project.vitenode.transformRequest(id);
|
|
@@ -7154,10 +7154,10 @@ function createTypecheckPool(ctx) {
|
|
|
7154
7154
|
for (const name in specsByProject) {
|
|
7155
7155
|
const project = specsByProject[name][0].project;
|
|
7156
7156
|
const files = specsByProject[name].map((spec) => spec.moduleId);
|
|
7157
|
-
const checker = await createWorkspaceTypechecker(project
|
|
7157
|
+
const checker = await createWorkspaceTypechecker(project, files);
|
|
7158
7158
|
checker.setFiles(files);
|
|
7159
7159
|
await checker.collectTests();
|
|
7160
|
-
ctx.state.collectFiles(project
|
|
7160
|
+
ctx.state.collectFiles(project, checker.getTestFiles());
|
|
7161
7161
|
await ctx.report("onCollected");
|
|
7162
7162
|
}
|
|
7163
7163
|
}
|
|
@@ -8206,7 +8206,7 @@ ${JSON.stringify({ browser: { provider: "playwright", name: "chromium" } }, null
|
|
|
8206
8206
|
if (resolved.cache !== false) {
|
|
8207
8207
|
let cacheDir = VitestCache.resolveCacheDir(
|
|
8208
8208
|
"",
|
|
8209
|
-
|
|
8209
|
+
viteConfig.cacheDir,
|
|
8210
8210
|
resolved.name
|
|
8211
8211
|
);
|
|
8212
8212
|
if (resolved.cache && resolved.cache.dir) {
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { a as BenchFunction, c as BenchmarkAPI } from './benchmark.
|
|
1
|
+
import { Test } from '@vitest/runner';
|
|
2
|
+
import { a as BenchFunction, c as BenchmarkAPI } from './benchmark.CFFwLv-O.js';
|
|
3
3
|
import { Options } from 'tinybench';
|
|
4
4
|
import '@vitest/runner/utils';
|
|
5
5
|
|
|
6
|
-
declare function getBenchOptions(key:
|
|
7
|
-
declare function getBenchFn(key:
|
|
6
|
+
declare function getBenchOptions(key: Test): Options;
|
|
7
|
+
declare function getBenchFn(key: Test): BenchFunction;
|
|
8
8
|
declare const bench: BenchmarkAPI;
|
|
9
9
|
|
|
10
10
|
export { getBenchOptions as a, bench as b, getBenchFn as g };
|
|
@@ -11,9 +11,10 @@ const F_DOT = "\xB7";
|
|
|
11
11
|
const F_CHECK = "\u2713";
|
|
12
12
|
const F_CROSS = "\xD7";
|
|
13
13
|
const F_LONG_DASH = "\u23AF";
|
|
14
|
+
const F_TREE_NODE_MIDDLE = "\u251C\u2500\u2500";
|
|
15
|
+
const F_TREE_NODE_END = "\u2514\u2500\u2500";
|
|
14
16
|
|
|
15
17
|
const spinnerMap = /* @__PURE__ */ new WeakMap();
|
|
16
|
-
const hookSpinnerMap = /* @__PURE__ */ new WeakMap();
|
|
17
18
|
const pointer = c.yellow(F_POINTER);
|
|
18
19
|
const skipped = c.dim(c.gray(F_DOWN));
|
|
19
20
|
const benchmarkPass = c.green(F_DOT);
|
|
@@ -144,22 +145,6 @@ function getStateSymbol(task) {
|
|
|
144
145
|
}
|
|
145
146
|
return " ";
|
|
146
147
|
}
|
|
147
|
-
function getHookStateSymbol(task, hookName) {
|
|
148
|
-
const state = task.result?.hooks?.[hookName];
|
|
149
|
-
if (state && state === "run") {
|
|
150
|
-
let spinnerMap2 = hookSpinnerMap.get(task);
|
|
151
|
-
if (!spinnerMap2) {
|
|
152
|
-
spinnerMap2 = /* @__PURE__ */ new Map();
|
|
153
|
-
hookSpinnerMap.set(task, spinnerMap2);
|
|
154
|
-
}
|
|
155
|
-
let spinner = spinnerMap2.get(hookName);
|
|
156
|
-
if (!spinner) {
|
|
157
|
-
spinner = elegantSpinner();
|
|
158
|
-
spinnerMap2.set(hookName, spinner);
|
|
159
|
-
}
|
|
160
|
-
return c.yellow(spinner());
|
|
161
|
-
}
|
|
162
|
-
}
|
|
163
148
|
const spinnerFrames = process.platform === "win32" ? ["-", "\\", "|", "/"] : ["\u280B", "\u2819", "\u2839", "\u2838", "\u283C", "\u2834", "\u2826", "\u2827", "\u2807", "\u280F"];
|
|
164
149
|
function elegantSpinner() {
|
|
165
150
|
let index = 0;
|
|
@@ -171,6 +156,12 @@ function elegantSpinner() {
|
|
|
171
156
|
function formatTimeString(date) {
|
|
172
157
|
return date.toTimeString().split(" ")[0];
|
|
173
158
|
}
|
|
159
|
+
function formatTime(time) {
|
|
160
|
+
if (time > 1e3) {
|
|
161
|
+
return `${(time / 1e3).toFixed(2)}s`;
|
|
162
|
+
}
|
|
163
|
+
return `${Math.round(time)}ms`;
|
|
164
|
+
}
|
|
174
165
|
function formatProjectName(name, suffix = " ") {
|
|
175
166
|
if (!name) {
|
|
176
167
|
return "";
|
|
@@ -180,7 +171,10 @@ function formatProjectName(name, suffix = " ") {
|
|
|
180
171
|
return colors[index % colors.length](`|${name}|`) + suffix;
|
|
181
172
|
}
|
|
182
173
|
function withLabel(color, label, message) {
|
|
183
|
-
return `${c.bold(c.inverse(c[color](` ${label} `)))} ${c[color](message)}`;
|
|
174
|
+
return `${c.bold(c.inverse(c[color](` ${label} `)))} ${message ? c[color](message) : ""}`;
|
|
175
|
+
}
|
|
176
|
+
function padSummaryTitle(str) {
|
|
177
|
+
return c.dim(`${str.padStart(11)} `);
|
|
184
178
|
}
|
|
185
179
|
|
|
186
180
|
var utils = /*#__PURE__*/Object.freeze({
|
|
@@ -191,12 +185,12 @@ var utils = /*#__PURE__*/Object.freeze({
|
|
|
191
185
|
elegantSpinner: elegantSpinner,
|
|
192
186
|
formatProjectName: formatProjectName,
|
|
193
187
|
formatTestPath: formatTestPath,
|
|
188
|
+
formatTime: formatTime,
|
|
194
189
|
formatTimeString: formatTimeString,
|
|
195
190
|
getCols: getCols,
|
|
196
|
-
getHookStateSymbol: getHookStateSymbol,
|
|
197
191
|
getStateString: getStateString,
|
|
198
192
|
getStateSymbol: getStateSymbol,
|
|
199
|
-
|
|
193
|
+
padSummaryTitle: padSummaryTitle,
|
|
200
194
|
pending: pending,
|
|
201
195
|
pointer: pointer,
|
|
202
196
|
renderSnapshotSummary: renderSnapshotSummary,
|
|
@@ -209,4 +203,4 @@ var utils = /*#__PURE__*/Object.freeze({
|
|
|
209
203
|
withLabel: withLabel
|
|
210
204
|
});
|
|
211
205
|
|
|
212
|
-
export { F_POINTER as F, formatTimeString as a, F_RIGHT as b, F_CHECK as c, divider as d, getStateString as e, formatProjectName as f, getStateSymbol as g,
|
|
206
|
+
export { F_POINTER as F, formatTimeString as a, F_RIGHT as b, F_CHECK as c, divider as d, getStateString as e, formatProjectName as f, getStateSymbol as g, formatTime as h, countTestErrors as i, F_TREE_NODE_END as j, F_TREE_NODE_MIDDLE as k, getCols as l, padSummaryTitle as p, renderSnapshotSummary as r, taskFail as t, utils as u, withLabel as w };
|
package/dist/cli.js
CHANGED
package/dist/config.d.ts
CHANGED
|
@@ -1,24 +1,25 @@
|
|
|
1
1
|
import { UserConfig as UserConfig$1, ConfigEnv } from 'vite';
|
|
2
2
|
export { ConfigEnv, Plugin, UserConfig as ViteUserConfig, mergeConfig } from 'vite';
|
|
3
|
-
import { R as ResolvedCoverageOptions, d as CoverageV8Options, U as UserWorkspaceConfig, e as UserProjectConfigFn, f as UserProjectConfigExport,
|
|
4
|
-
|
|
3
|
+
import { R as ResolvedCoverageOptions, d as CoverageV8Options, U as UserWorkspaceConfig, e as UserProjectConfigFn, f as UserProjectConfigExport, T as TestProjectConfiguration } from './chunks/reporters.F9D2idOT.js';
|
|
4
|
+
export { W as WorkspaceProjectConfiguration } from './chunks/reporters.F9D2idOT.js';
|
|
5
|
+
import './chunks/vite.DonA4fvH.js';
|
|
5
6
|
import '@vitest/runner';
|
|
6
7
|
import './chunks/environment.CT0jpO-1.js';
|
|
7
8
|
import 'node:stream';
|
|
8
9
|
import '@vitest/utils';
|
|
10
|
+
import 'vite-node';
|
|
11
|
+
import '@vitest/utils/source-map';
|
|
9
12
|
import './chunks/config.CPguQ7J1.js';
|
|
10
13
|
import '@vitest/pretty-format';
|
|
11
14
|
import '@vitest/snapshot';
|
|
12
15
|
import '@vitest/snapshot/environment';
|
|
13
16
|
import '@vitest/utils/diff';
|
|
14
|
-
import 'vite-node';
|
|
15
17
|
import 'chai';
|
|
16
|
-
import '
|
|
17
|
-
import 'vite-node/client';
|
|
18
|
-
import 'vite-node/server';
|
|
19
|
-
import './chunks/benchmark.geERunq4.js';
|
|
18
|
+
import './chunks/benchmark.CFFwLv-O.js';
|
|
20
19
|
import '@vitest/runner/utils';
|
|
21
20
|
import 'tinybench';
|
|
21
|
+
import 'vite-node/client';
|
|
22
|
+
import 'vite-node/server';
|
|
22
23
|
import '@vitest/snapshot/manager';
|
|
23
24
|
import 'node:fs';
|
|
24
25
|
|
|
@@ -89,6 +90,6 @@ declare function defineProject(config: UserWorkspaceConfig): UserWorkspaceConfig
|
|
|
89
90
|
declare function defineProject(config: Promise<UserWorkspaceConfig>): Promise<UserWorkspaceConfig>;
|
|
90
91
|
declare function defineProject(config: UserProjectConfigFn): UserProjectConfigFn;
|
|
91
92
|
declare function defineProject(config: UserProjectConfigExport): UserProjectConfigExport;
|
|
92
|
-
declare function defineWorkspace(config:
|
|
93
|
+
declare function defineWorkspace(config: TestProjectConfiguration[]): TestProjectConfiguration[];
|
|
93
94
|
|
|
94
|
-
export { type UserConfig, type UserConfigExport, type UserConfigFn, type UserConfigFnObject, type UserConfigFnPromise, UserProjectConfigExport, UserProjectConfigFn, UserWorkspaceConfig,
|
|
95
|
+
export { TestProjectConfiguration, type UserConfig, type UserConfigExport, type UserConfigFn, type UserConfigFnObject, type UserConfigFnPromise, UserProjectConfigExport, UserProjectConfigFn, UserWorkspaceConfig, configDefaults, coverageConfigDefaults, defaultBrowserPort, defaultExclude, defaultInclude, defineConfig, defineProject, defineWorkspace, extraInlineDeps };
|
package/dist/coverage.d.ts
CHANGED
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
import * as vite from 'vite';
|
|
2
|
-
import { R as ResolvedCoverageOptions, V as Vitest, C as CoverageMap, a as ReportContext } from './chunks/reporters.
|
|
2
|
+
import { R as ResolvedCoverageOptions, V as Vitest, C as CoverageMap, a as ReportContext } from './chunks/reporters.F9D2idOT.js';
|
|
3
3
|
import { A as AfterSuiteRunMeta } from './chunks/environment.CT0jpO-1.js';
|
|
4
4
|
import '@vitest/runner';
|
|
5
5
|
import 'node:stream';
|
|
6
6
|
import '@vitest/utils';
|
|
7
|
+
import 'vite-node';
|
|
8
|
+
import '@vitest/utils/source-map';
|
|
7
9
|
import './chunks/config.CPguQ7J1.js';
|
|
8
10
|
import '@vitest/pretty-format';
|
|
9
11
|
import '@vitest/snapshot';
|
|
10
12
|
import '@vitest/snapshot/environment';
|
|
11
13
|
import '@vitest/utils/diff';
|
|
12
|
-
import 'vite-node';
|
|
13
14
|
import 'chai';
|
|
14
|
-
import '
|
|
15
|
-
import 'vite-node/client';
|
|
16
|
-
import 'vite-node/server';
|
|
17
|
-
import './chunks/benchmark.geERunq4.js';
|
|
15
|
+
import './chunks/benchmark.CFFwLv-O.js';
|
|
18
16
|
import '@vitest/runner/utils';
|
|
19
17
|
import 'tinybench';
|
|
18
|
+
import 'vite-node/client';
|
|
19
|
+
import 'vite-node/server';
|
|
20
20
|
import '@vitest/snapshot/manager';
|
|
21
21
|
import 'node:fs';
|
|
22
22
|
|
package/dist/coverage.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { existsSync, promises, readdirSync, writeFileSync } from 'node:fs';
|
|
2
|
-
import { c as coverageConfigDefaults, r as resolveCoverageReporters, m as mm } from './chunks/resolveConfig.
|
|
2
|
+
import { c as coverageConfigDefaults, r as resolveCoverageReporters, m as mm } from './chunks/resolveConfig.CLnvCvEs.js';
|
|
3
3
|
import { resolve, relative } from 'pathe';
|
|
4
4
|
import c from 'tinyrainbow';
|
|
5
5
|
import '@vitest/utils';
|
|
@@ -13,7 +13,7 @@ import 'node:v8';
|
|
|
13
13
|
import 'node:util';
|
|
14
14
|
import './chunks/constants.fzPh7AOq.js';
|
|
15
15
|
import 'node:os';
|
|
16
|
-
import './chunks/RandomSequencer.
|
|
16
|
+
import './chunks/RandomSequencer.BPedXEug.js';
|
|
17
17
|
import 'std-env';
|
|
18
18
|
import 'node:perf_hooks';
|
|
19
19
|
import '@vitest/runner/utils';
|
package/dist/index.d.ts
CHANGED
|
@@ -1,25 +1,25 @@
|
|
|
1
1
|
import { TaskResultPack as TaskResultPack$1, File as File$1, TaskPopulated, Suite as Suite$1, Test as Test$1, Custom as Custom$1, Task as Task$1, TaskBase as TaskBase$1, TaskResult as TaskResult$1, DoneCallback as DoneCallback$1, RuntimeContext as RuntimeContext$1, SuiteHooks as SuiteHooks$1, SequenceHooks as SequenceHooks$1, SequenceSetupFiles as SequenceSetupFiles$1 } from '@vitest/runner';
|
|
2
2
|
export { CancelReason, ExtendedContext, HookCleanupCallback, HookListener, OnTestFailedHandler, OnTestFinishedHandler, RunMode, Custom as RunnerCustomCase, Task as RunnerTask, TaskBase as RunnerTaskBase, TaskResult as RunnerTaskResult, TaskResultPack as RunnerTaskResultPack, Test as RunnerTestCase, File as RunnerTestFile, Suite as RunnerTestSuite, SuiteAPI, SuiteCollector, SuiteFactory, TaskContext, TaskCustomOptions, TaskMeta, TaskState, TestAPI, TestContext, TestFunction, TestOptions, afterAll, afterEach, beforeAll, beforeEach, describe, it, onTestFailed, onTestFinished, suite, test } from '@vitest/runner';
|
|
3
|
-
import { g as VitestEnvironment$1, S as SerializedTestSpecification, h as RawErrsMap$1,
|
|
3
|
+
import { g as VitestEnvironment$1, S as SerializedTestSpecification, h as RawErrsMap$1, i as TscErrorInfo$1, j as CollectLineNumbers$1, k as CollectLines$1, l as RootAndTarget$1, m as Context$1, b as CoverageProvider$1, a as ReportContext$1, c as CoverageProviderModule$1, n as CoverageReporter$1, o as CoverageProviderName, p as CoverageOptions$1, R as ResolvedCoverageOptions$1, B as BaseCoverageOptions$1, q as CoverageIstanbulOptions$1, d as CoverageV8Options$1, r as CustomProviderOptions$1, s as Reporter$1, V as Vitest$1, t as BrowserScript$1, u as BrowserConfigOptions$1, v as BuiltinEnvironment$1, P as Pool$1, w as PoolOptions$1, x as CSSModuleScopeStrategy$1, A as ApiConfig$1, y as VitestRunMode$1, D as DepsOptimizationOptions$1, z as TransformModePatterns$1, I as InlineConfig$1, E as TypecheckConfig$1, F as UserConfig$1, G as ResolvedConfig$1, H as ProjectConfig$1, U as UserWorkspaceConfig$1, J as BenchmarkUserOptions$1 } from './chunks/reporters.F9D2idOT.js';
|
|
4
4
|
import { W as WorkerContext$1 } from './chunks/worker.Qz1UB4Fv.js';
|
|
5
5
|
import { U as UserConsoleLog, M as ModuleGraphData, b as Awaitable$1, P as ProvidedContext, N as Nullable$1, c as Arrayable$1, d as ArgumentsType$1, e as MutableArray$1, C as Constructable$1, O as OnServerRestartHandler$1, a as EnvironmentReturn$1, V as VmEnvironmentReturn$1, E as Environment$1, R as ResolvedTestEnvironment$1, J as JSDOMOptions$1, H as HappyDOMOptions$1, f as EnvironmentOptions$1 } from './chunks/environment.CT0jpO-1.js';
|
|
6
6
|
export { A as AfterSuiteRunMeta, g as ModuleCache } from './chunks/environment.CT0jpO-1.js';
|
|
7
7
|
import { a as BirpcReturn, b as WorkerRPC$1 } from './chunks/worker.9VY11NZs.js';
|
|
8
8
|
export { C as ContextRPC, d as ContextTestEnvironment, e as ResolveIdFunction, c as RunnerRPC, R as RuntimeRPC, W as WorkerGlobalState } from './chunks/worker.9VY11NZs.js';
|
|
9
|
-
import './chunks/vite.
|
|
9
|
+
import './chunks/vite.DonA4fvH.js';
|
|
10
10
|
import { PromisifyAssertion, Tester, ExpectStatic } from '@vitest/expect';
|
|
11
11
|
export { Assertion, AsymmetricMatchersContaining, ExpectPollOptions, ExpectStatic, JestAssertion } from '@vitest/expect';
|
|
12
12
|
import { Plugin } from '@vitest/pretty-format';
|
|
13
13
|
import { SnapshotState } from '@vitest/snapshot';
|
|
14
14
|
export { SnapshotData, SnapshotMatchOptions, SnapshotResult, SnapshotSerializer, SnapshotStateOptions, SnapshotSummary, SnapshotUpdateState, UncheckedSnapshot } from '@vitest/snapshot';
|
|
15
|
-
import { B as BenchmarkResult } from './chunks/benchmark.
|
|
16
|
-
export { a as BenchFunction, b as Benchmark, c as BenchmarkAPI } from './chunks/benchmark.
|
|
15
|
+
import { B as BenchmarkResult } from './chunks/benchmark.CFFwLv-O.js';
|
|
16
|
+
export { a as BenchFunction, b as Benchmark, c as BenchmarkAPI } from './chunks/benchmark.CFFwLv-O.js';
|
|
17
17
|
import { S as SerializedConfig, F as FakeTimerInstallOpts, R as RuntimeOptions } from './chunks/config.CPguQ7J1.js';
|
|
18
18
|
export { b as RuntimeConfig, a as SerializedCoverageConfig } from './chunks/config.CPguQ7J1.js';
|
|
19
19
|
import { spyOn, fn, MaybeMockedDeep, MaybeMocked, MaybePartiallyMocked, MaybePartiallyMockedDeep, MockInstance } from '@vitest/spy';
|
|
20
20
|
export { Mock, MockContext, MockInstance, Mocked, MockedClass, MockedFunction, MockedObject } from '@vitest/spy';
|
|
21
21
|
import { M as MockFactoryWithHelper, a as MockOptions } from './chunks/mocker.cRtM890J.js';
|
|
22
|
-
export { b as bench } from './chunks/suite.
|
|
22
|
+
export { b as bench } from './chunks/suite.BJU7kdY9.js';
|
|
23
23
|
export { ExpectTypeOf, expectTypeOf } from 'expect-type';
|
|
24
24
|
export { ErrorWithDiff, ParsedStack, SerializedError, TestError } from '@vitest/utils';
|
|
25
25
|
export { DiffOptions } from '@vitest/utils/diff';
|
|
@@ -170,7 +170,8 @@ interface WebSocketHandlers {
|
|
|
170
170
|
getTransformResult: (projectName: string, id: string, browser?: boolean) => Promise<TransformResultWithSource | undefined>;
|
|
171
171
|
readTestFile: (id: string) => Promise<string | null>;
|
|
172
172
|
saveTestFile: (id: string, content: string) => Promise<void>;
|
|
173
|
-
rerun: (files: string[]) => Promise<void>;
|
|
173
|
+
rerun: (files: string[], resetTestNamePattern?: boolean) => Promise<void>;
|
|
174
|
+
rerunTask: (id: string) => Promise<void>;
|
|
174
175
|
updateSnapshot: (file?: File$1) => Promise<void>;
|
|
175
176
|
getUnhandledErrors: () => unknown[];
|
|
176
177
|
}
|
package/dist/node.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export { B as BaseCoverageOptions,
|
|
1
|
+
import { y as VitestRunMode, K as VitestOptions, V as Vitest, F as UserConfig$1, A as ApiConfig, L as Logger, G as ResolvedConfig$1, M as TestProject, N as TestSequencer, O as WorkspaceSpec, Q as TestModule, X as ModuleDiagnostic } from './chunks/reporters.F9D2idOT.js';
|
|
2
|
+
export { B as BaseCoverageOptions, J as BenchmarkUserOptions, ae as BrowserBuiltinProvider, af as BrowserCommand, ag as BrowserCommandContext, u as BrowserConfigOptions, ah as BrowserOrchestrator, ai as BrowserProvider, aj as BrowserProviderInitializationOptions, ak as BrowserProviderModule, al as BrowserProviderOptions, t as BrowserScript, am as BrowserServer, an as BrowserServerState, ao as BrowserServerStateContext, v as BuiltinEnvironment, ap as CDPSession, x as CSSModuleScopeStrategy, q as CoverageIstanbulOptions, p as CoverageOptions, b as CoverageProvider, c as CoverageProviderModule, n as CoverageReporter, d as CoverageV8Options, r as CustomProviderOptions, D as DepsOptimizationOptions, a0 as HTMLOptions, I as InlineConfig, a2 as JUnitOptions, a1 as JsonOptions, P as Pool, w as PoolOptions, Z as ProcessPool, H as ProjectConfig, a as ReportContext, as as ResolveSnapshotPathHandler, at as ResolveSnapshotPathHandlerContext, aq as ResolvedBrowserOptions, R as ResolvedCoverageOptions, ar as ResolvedProjectConfig, $ as SerializedTestProject, a5 as TaskOptions, a3 as TestCase, a6 as TestCollection, a7 as TestDiagnostic, a8 as TestResult, a9 as TestResultFailed, aa as TestResultPassed, ab as TestResultSkipped, ac as TestSequencerConstructor, ad as TestSpecification, a4 as TestSuite, z as TransformModePatterns, j as TypeCheckCollectLineNumbers, k as TypeCheckCollectLines, m as TypeCheckContext, i as TypeCheckErrorInfo, h as TypeCheckRawErrorsMap, l as TypeCheckRootAndTarget, E as TypecheckConfig, U as UserWorkspaceConfig, g as VitestEnvironment, Y as VitestPackageInstaller, _ as getFilePoolName } from './chunks/reporters.F9D2idOT.js';
|
|
3
3
|
import { UserConfig, ResolvedConfig, Plugin, 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 };
|
|
@@ -13,17 +13,17 @@ import createDebug from 'debug';
|
|
|
13
13
|
export { b as RuntimeConfig } from './chunks/config.CPguQ7J1.js';
|
|
14
14
|
export { SequenceHooks, SequenceSetupFiles } from '@vitest/runner';
|
|
15
15
|
import '@vitest/utils';
|
|
16
|
+
import 'vite-node';
|
|
17
|
+
import '@vitest/utils/source-map';
|
|
16
18
|
import '@vitest/pretty-format';
|
|
17
19
|
import '@vitest/snapshot';
|
|
18
20
|
import '@vitest/utils/diff';
|
|
19
|
-
import 'vite-node';
|
|
20
21
|
import 'chai';
|
|
21
|
-
import '
|
|
22
|
-
import 'vite-node/client';
|
|
23
|
-
import 'vite-node/server';
|
|
24
|
-
import './chunks/benchmark.geERunq4.js';
|
|
22
|
+
import './chunks/benchmark.CFFwLv-O.js';
|
|
25
23
|
import '@vitest/runner/utils';
|
|
26
24
|
import 'tinybench';
|
|
25
|
+
import 'vite-node/client';
|
|
26
|
+
import 'vite-node/server';
|
|
27
27
|
import '@vitest/snapshot/manager';
|
|
28
28
|
import 'node:fs';
|
|
29
29
|
import 'node:worker_threads';
|
|
@@ -52,7 +52,7 @@ interface CliOptions extends UserConfig$1 {
|
|
|
52
52
|
*
|
|
53
53
|
* Returns a Vitest instance if initialized successfully.
|
|
54
54
|
*/
|
|
55
|
-
declare function startVitest(mode: VitestRunMode, cliFilters?: string[], options?: CliOptions, viteOverrides?: UserConfig, vitestOptions?: VitestOptions): Promise<Vitest
|
|
55
|
+
declare function startVitest(mode: VitestRunMode, cliFilters?: string[], options?: CliOptions, viteOverrides?: UserConfig, vitestOptions?: VitestOptions): Promise<Vitest>;
|
|
56
56
|
|
|
57
57
|
interface CLIOptions {
|
|
58
58
|
allowUnknownOptions?: boolean;
|
|
@@ -77,8 +77,17 @@ declare class GitNotFoundError extends Error {
|
|
|
77
77
|
}
|
|
78
78
|
|
|
79
79
|
interface GlobalSetupContext {
|
|
80
|
+
/**
|
|
81
|
+
* Config of the current project.
|
|
82
|
+
*/
|
|
80
83
|
config: ResolvedConfig$1;
|
|
84
|
+
/**
|
|
85
|
+
* Provide a value to the test context. This value will be available to all tests via `inject`.
|
|
86
|
+
*/
|
|
81
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
|
+
*/
|
|
82
91
|
onTestsRerun: (cb: OnTestsRerunHandler) => void;
|
|
83
92
|
}
|
|
84
93
|
|
|
@@ -89,7 +98,7 @@ declare function resolveFsAllow(projectRoot: string, rootConfigFile: string | fa
|
|
|
89
98
|
interface MethodsOptions {
|
|
90
99
|
cacheFs?: boolean;
|
|
91
100
|
}
|
|
92
|
-
declare function createMethodsRPC(project:
|
|
101
|
+
declare function createMethodsRPC(project: TestProject, options?: MethodsOptions): RuntimeRPC;
|
|
93
102
|
|
|
94
103
|
declare class BaseSequencer implements TestSequencer {
|
|
95
104
|
protected ctx: Vitest;
|
|
@@ -121,4 +130,4 @@ declare const TestFile: typeof TestModule;
|
|
|
121
130
|
*/
|
|
122
131
|
type FileDiagnostic = ModuleDiagnostic;
|
|
123
132
|
|
|
124
|
-
export { ApiConfig, BaseSequencer, type FileDiagnostic, GitNotFoundError, type GlobalSetupContext, ModuleDiagnostic, OnTestsRerunHandler, ResolvedConfig$1 as ResolvedConfig, TestFile, TestModule, TestSequencer, FilesNotFoundError as TestsNotFoundError, UserConfig$1 as UserConfig, Vitest, VitestPlugin, VitestRunMode, WorkspaceProject, WorkspaceSpec, createDebugger, createMethodsRPC, createServer, createViteLogger, createViteServer, createVitest, distDir, parseCLI, registerConsoleShortcuts, resolveApiServerConfig, resolveConfig, resolveFsAllow, rootDir, startVitest };
|
|
133
|
+
export { ApiConfig, BaseSequencer, type FileDiagnostic, GitNotFoundError, type GlobalSetupContext, ModuleDiagnostic, OnTestsRerunHandler, ResolvedConfig$1 as ResolvedConfig, TestFile, TestModule, TestProject, TestSequencer, FilesNotFoundError as TestsNotFoundError, UserConfig$1 as UserConfig, Vitest, VitestPlugin, VitestRunMode, TestProject as WorkspaceProject, WorkspaceSpec, createDebugger, createMethodsRPC, createServer, createViteLogger, createViteServer, createVitest, distDir, parseCLI, registerConsoleShortcuts, resolveApiServerConfig, resolveConfig, resolveFsAllow, rootDir, startVitest };
|
package/dist/node.js
CHANGED
|
@@ -1,32 +1,32 @@
|
|
|
1
1
|
import { createServer as createServer$1 } from 'vite';
|
|
2
2
|
export { isFileServingAllowed, parseAst, parseAstAsync } from 'vite';
|
|
3
|
-
import { f as TestModule } from './chunks/index.
|
|
4
|
-
export { e as TestCase,
|
|
5
|
-
export { p as parseCLI } from './chunks/cac.
|
|
6
|
-
export { G as GitNotFoundError, T as TestSpecification, F as TestsNotFoundError, V as VitestPackageInstaller, a as VitestPlugin, d as createViteLogger, c as createVitest, b as registerConsoleShortcuts, r as resolveFsAllow, s as startVitest } from './chunks/cli-api.
|
|
7
|
-
export { d as createMethodsRPC, g as getFilePoolName, a as resolveApiServerConfig, b as resolveConfig } from './chunks/resolveConfig.
|
|
8
|
-
export { B as BaseSequencer } from './chunks/RandomSequencer.
|
|
3
|
+
import { f as TestModule } from './chunks/index.bzFpKeaq.js';
|
|
4
|
+
export { e as TestCase, g as TestSuite } from './chunks/index.bzFpKeaq.js';
|
|
5
|
+
export { p as parseCLI } from './chunks/cac.Cs06pOqp.js';
|
|
6
|
+
export { G as GitNotFoundError, T as TestSpecification, F as TestsNotFoundError, V as VitestPackageInstaller, a as VitestPlugin, d as createViteLogger, c as createVitest, b as registerConsoleShortcuts, r as resolveFsAllow, s as startVitest } from './chunks/cli-api.CB-jIbYQ.js';
|
|
7
|
+
export { d as createMethodsRPC, g as getFilePoolName, a as resolveApiServerConfig, b as resolveConfig } from './chunks/resolveConfig.CLnvCvEs.js';
|
|
8
|
+
export { B as BaseSequencer } from './chunks/RandomSequencer.BPedXEug.js';
|
|
9
9
|
export { distDir, rootDir } from './path.js';
|
|
10
10
|
import createDebug from 'debug';
|
|
11
11
|
import 'node:fs';
|
|
12
12
|
import '@vitest/runner/utils';
|
|
13
13
|
import 'pathe';
|
|
14
14
|
import 'tinyrainbow';
|
|
15
|
-
import './chunks/utils.
|
|
15
|
+
import './chunks/utils.DJONn5B5.js';
|
|
16
16
|
import 'node:util';
|
|
17
17
|
import '@vitest/utils';
|
|
18
18
|
import 'node:perf_hooks';
|
|
19
19
|
import '@vitest/utils/source-map';
|
|
20
20
|
import 'std-env';
|
|
21
21
|
import 'node:fs/promises';
|
|
22
|
+
import 'restore-cursor';
|
|
22
23
|
import 'node:stream';
|
|
23
24
|
import 'node:console';
|
|
24
25
|
import 'node:process';
|
|
25
26
|
import './chunks/_commonjsHelpers.BFTU3MAI.js';
|
|
26
|
-
import 'assert';
|
|
27
|
-
import 'events';
|
|
28
27
|
import 'node:module';
|
|
29
28
|
import 'node:os';
|
|
29
|
+
import 'events';
|
|
30
30
|
import './chunks/constants.fzPh7AOq.js';
|
|
31
31
|
import './chunks/coverage.BoMDb1ip.js';
|
|
32
32
|
import 'node:path';
|
package/dist/reporters.d.ts
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
export { aE as BaseReporter, au as BasicReporter, aO as BenchmarkBuiltinReporters, aN as BenchmarkReportsMap, aJ as BuiltinReporterOptions, aI as BuiltinReporters, av as DefaultReporter, aw as DotReporter, aG as FileDiagnostic, ax as GithubActionsReporter, ay as HangingProcessReporter, aA as JUnitReporter, aK as JsonAssertionResult, az as JsonReporter, aL as JsonTestResult, aM as JsonTestResults,
|
|
1
|
+
export { aE as BaseReporter, au as BasicReporter, aO as BenchmarkBuiltinReporters, aN as BenchmarkReportsMap, aJ as BuiltinReporterOptions, aI as BuiltinReporters, av as DefaultReporter, aw as DotReporter, aG as FileDiagnostic, ax as GithubActionsReporter, ay as HangingProcessReporter, aA as JUnitReporter, aK as JsonAssertionResult, az as JsonReporter, aL as JsonTestResult, aM as JsonTestResults, s as Reporter, aH as ReportersMap, aB as TapFlatReporter, aC as TapReporter, a5 as TaskOptions, a3 as TestCase, a6 as TestCollection, a7 as TestDiagnostic, aF as TestFile, Q as TestModule, M as TestProject, a8 as TestResult, a9 as TestResultFailed, aa as TestResultPassed, ab as TestResultSkipped, a4 as TestSuite, aD as VerboseReporter } from './chunks/reporters.F9D2idOT.js';
|
|
2
2
|
import '@vitest/runner';
|
|
3
3
|
import './chunks/environment.CT0jpO-1.js';
|
|
4
4
|
import 'node:stream';
|
|
5
5
|
import 'vite';
|
|
6
6
|
import '@vitest/utils';
|
|
7
|
+
import 'vite-node';
|
|
8
|
+
import '@vitest/utils/source-map';
|
|
7
9
|
import './chunks/config.CPguQ7J1.js';
|
|
8
10
|
import '@vitest/pretty-format';
|
|
9
11
|
import '@vitest/snapshot';
|
|
10
12
|
import '@vitest/snapshot/environment';
|
|
11
13
|
import '@vitest/utils/diff';
|
|
12
|
-
import 'vite-node';
|
|
13
14
|
import 'chai';
|
|
14
|
-
import '
|
|
15
|
-
import 'vite-node/client';
|
|
16
|
-
import 'vite-node/server';
|
|
17
|
-
import './chunks/benchmark.geERunq4.js';
|
|
15
|
+
import './chunks/benchmark.CFFwLv-O.js';
|
|
18
16
|
import '@vitest/runner/utils';
|
|
19
17
|
import 'tinybench';
|
|
18
|
+
import 'vite-node/client';
|
|
19
|
+
import 'vite-node/server';
|
|
20
20
|
import '@vitest/snapshot/manager';
|
|
21
21
|
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.bzFpKeaq.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.DJONn5B5.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.BPedXEug.js';
|
|
12
12
|
import 'std-env';
|
|
13
13
|
import 'node:fs/promises';
|
|
14
14
|
import 'tinyexec';
|
|
@@ -20,9 +20,8 @@ import 'node:module';
|
|
|
20
20
|
import 'fs';
|
|
21
21
|
import 'vite-node/utils';
|
|
22
22
|
import 'node:crypto';
|
|
23
|
+
import 'restore-cursor';
|
|
23
24
|
import 'node:stream';
|
|
24
25
|
import 'node:console';
|
|
25
26
|
import 'node:process';
|
|
26
27
|
import './chunks/_commonjsHelpers.BFTU3MAI.js';
|
|
27
|
-
import 'assert';
|
|
28
|
-
import 'events';
|
package/dist/runners.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as tinybench from 'tinybench';
|
|
2
|
-
import { VitestRunner, VitestRunnerImportSource, Suite, File, Task, CancelReason, Test,
|
|
2
|
+
import { VitestRunner, VitestRunnerImportSource, Suite, File, Task, CancelReason, Test, TaskContext, ExtendedContext } from '@vitest/runner';
|
|
3
3
|
import { S as SerializedConfig } from './chunks/config.CPguQ7J1.js';
|
|
4
4
|
import '@vitest/pretty-format';
|
|
5
5
|
import '@vitest/snapshot';
|
|
@@ -37,7 +37,7 @@ declare class VitestTestRunner implements VitestRunner {
|
|
|
37
37
|
onBeforeRunSuite(suite: Suite): Promise<void>;
|
|
38
38
|
onBeforeTryTask(test: Task): void;
|
|
39
39
|
onAfterTryTask(test: Task): void;
|
|
40
|
-
extendTaskContext<T extends Test
|
|
40
|
+
extendTaskContext<T extends Test>(context: TaskContext<T>): ExtendedContext<T>;
|
|
41
41
|
}
|
|
42
42
|
|
|
43
43
|
export { NodeBenchmarkRunner, VitestTestRunner };
|
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.BJU7kdY9.js';
|
|
2
2
|
export { 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.CFFwLv-O.js';
|
|
5
5
|
import 'tinybench';
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vitest",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "2.2.0-beta.
|
|
4
|
+
"version": "2.2.0-beta.2",
|
|
5
5
|
"description": "Next generation testing framework powered by Vite",
|
|
6
6
|
"author": "Anthony Fu <anthonyfu117@hotmail.com>",
|
|
7
7
|
"license": "MIT",
|
|
@@ -122,8 +122,8 @@
|
|
|
122
122
|
"@types/node": "^18.0.0 || >=20.0.0",
|
|
123
123
|
"happy-dom": "*",
|
|
124
124
|
"jsdom": "*",
|
|
125
|
-
"@vitest/browser": "2.2.0-beta.
|
|
126
|
-
"@vitest/ui": "2.2.0-beta.
|
|
125
|
+
"@vitest/browser": "2.2.0-beta.2",
|
|
126
|
+
"@vitest/ui": "2.2.0-beta.2"
|
|
127
127
|
},
|
|
128
128
|
"peerDependenciesMeta": {
|
|
129
129
|
"@edge-runtime/vm": {
|
|
@@ -151,21 +151,22 @@
|
|
|
151
151
|
"expect-type": "^1.1.0",
|
|
152
152
|
"magic-string": "^0.30.12",
|
|
153
153
|
"pathe": "^1.1.2",
|
|
154
|
+
"restore-cursor": "^5.1.0",
|
|
154
155
|
"std-env": "^3.8.0",
|
|
155
156
|
"tinybench": "^2.9.0",
|
|
156
157
|
"tinyexec": "^0.3.1",
|
|
157
|
-
"tinypool": "^1.0.
|
|
158
|
+
"tinypool": "^1.0.2",
|
|
158
159
|
"tinyrainbow": "^1.2.0",
|
|
159
160
|
"vite": "^5.0.0",
|
|
160
161
|
"why-is-node-running": "^2.3.0",
|
|
161
|
-
"@vitest/mocker": "2.2.0-beta.
|
|
162
|
-
"@vitest/pretty-format": "^2.2.0-beta.
|
|
163
|
-
"@vitest/
|
|
164
|
-
"@vitest/
|
|
165
|
-
"@vitest/
|
|
166
|
-
"@vitest/utils": "2.2.0-beta.
|
|
167
|
-
"
|
|
168
|
-
"
|
|
162
|
+
"@vitest/mocker": "2.2.0-beta.2",
|
|
163
|
+
"@vitest/pretty-format": "^2.2.0-beta.2",
|
|
164
|
+
"@vitest/expect": "2.2.0-beta.2",
|
|
165
|
+
"@vitest/runner": "2.2.0-beta.2",
|
|
166
|
+
"@vitest/snapshot": "2.2.0-beta.2",
|
|
167
|
+
"@vitest/utils": "2.2.0-beta.2",
|
|
168
|
+
"@vitest/spy": "2.2.0-beta.2",
|
|
169
|
+
"vite-node": "2.2.0-beta.2"
|
|
169
170
|
},
|
|
170
171
|
"devDependencies": {
|
|
171
172
|
"@ampproject/remapping": "^2.3.0",
|