vitest 2.0.0-beta.11 → 2.0.0-beta.12
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 +1 -1
- package/dist/browser.js +1 -1
- package/dist/chunks/browser-creator.Bw94IHrL.js +673 -0
- package/dist/chunks/{environments-node.39w4gmlF.js → environments-node.XE5FbRPQ.js} +1 -1
- package/dist/chunks/{integrations-globals.CC2ed6Py.js → integrations-globals.DSNOaUHv.js} +5 -5
- package/dist/chunks/{runtime-console.Ckl0vEQr.js → runtime-console.O41g23Zj.js} +1 -1
- package/dist/chunks/{runtime-runBaseTests.BXW_BJeO.js → runtime-runBaseTests.BDt9gQFB.js} +8 -8
- package/dist/cli.js +1 -1
- package/dist/config.cjs +3 -2
- package/dist/config.d.ts +1 -1
- package/dist/config.js +3 -2
- package/dist/coverage.d.ts +3 -2
- package/dist/coverage.js +3 -2
- package/dist/environments.d.ts +1 -1
- package/dist/execute.d.ts +1 -1
- package/dist/index.d.ts +6 -6
- package/dist/index.js +6 -6
- package/dist/node.d.ts +3 -3
- package/dist/node.js +10 -9
- package/dist/{reporters-fiIq_dT9.d.ts → reporters-Cd1vkLMZ.d.ts} +18 -5
- package/dist/reporters.d.ts +1 -1
- package/dist/reporters.js +4 -4
- package/dist/runners.d.ts +1 -1
- package/dist/runners.js +4 -4
- package/dist/snapshot.js +2 -2
- package/dist/{suite-D4aoU9rI.d.ts → suite-BS2CV79a.d.ts} +1 -1
- package/dist/suite.d.ts +2 -2
- package/dist/suite.js +3 -3
- package/dist/vendor/{base.C2DbLEfT.js → base.Cy97mmVC.js} +1 -1
- package/dist/vendor/{benchmark.CMp8QfyL.js → benchmark.B6pblCp2.js} +1 -1
- package/dist/vendor/{cac.BcJW7n2j.js → cac.DRNUX42m.js} +13 -3
- package/dist/vendor/{cli-api.C8t8m4__.js → cli-api.Bu-PSdzx.js} +39 -6586
- package/dist/vendor/env.2ltrQNq0.js +8 -0
- package/dist/vendor/{index.-dbR4KUi.js → index.B7pSlOSa.js} +2 -2
- package/dist/vendor/{index.C9Thslzw.js → index.BJmtb_7W.js} +1 -1
- package/dist/vendor/index.D6GZqexG.js +6575 -0
- package/dist/vendor/{index.CQJ2m700.js → index.Hqvcg1pf.js} +2 -2
- package/dist/vendor/{index.BC5zhX9y.js → index.ZtQtNPP2.js} +4 -4
- package/dist/vendor/{setup-common.uqZOEWuR.js → setup-common.CWnv_2-5.js} +1 -1
- package/dist/vendor/{vi.BPjl8cAZ.js → vi.DXACdGTu.js} +1 -1
- package/dist/vendor/{vm.CycSoHnJ.js → vm.D9wVR14y.js} +2 -2
- package/dist/workers/forks.js +1 -1
- package/dist/workers/runVmTests.js +7 -7
- package/dist/workers/threads.js +1 -1
- package/dist/workers/vmForks.js +3 -3
- package/dist/workers/vmThreads.js +3 -3
- package/dist/workers.d.ts +1 -1
- package/dist/workers.js +4 -4
- package/package.json +9 -9
- package/dist/vendor/env.bmJgw1qP.js +0 -7
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { g as globalApis } from '../vendor/constants.BWsVtsAj.js';
|
|
2
|
-
import { V as VitestIndex } from '../vendor/index.
|
|
2
|
+
import { V as VitestIndex } from '../vendor/index.Hqvcg1pf.js';
|
|
3
3
|
import '@vitest/runner';
|
|
4
|
-
import '../vendor/benchmark.
|
|
4
|
+
import '../vendor/benchmark.B6pblCp2.js';
|
|
5
5
|
import '@vitest/runner/utils';
|
|
6
6
|
import '@vitest/utils';
|
|
7
|
-
import '../vendor/index.
|
|
7
|
+
import '../vendor/index.BJmtb_7W.js';
|
|
8
8
|
import 'pathe';
|
|
9
9
|
import '../vendor/global.7bFbnyXl.js';
|
|
10
|
-
import '../vendor/env.
|
|
10
|
+
import '../vendor/env.2ltrQNq0.js';
|
|
11
11
|
import 'std-env';
|
|
12
12
|
import '../vendor/run-once.Db8Hgq9X.js';
|
|
13
|
-
import '../vendor/vi.
|
|
13
|
+
import '../vendor/vi.DXACdGTu.js';
|
|
14
14
|
import 'chai';
|
|
15
15
|
import '../vendor/_commonjsHelpers.BFTU3MAI.js';
|
|
16
16
|
import '@vitest/expect';
|
|
@@ -6,7 +6,7 @@ import { R as RealDate } from '../vendor/date.W2xKR2qe.js';
|
|
|
6
6
|
import 'pathe';
|
|
7
7
|
import '@vitest/runner/utils';
|
|
8
8
|
import { g as getWorkerState } from '../vendor/global.7bFbnyXl.js';
|
|
9
|
-
import '../vendor/env.
|
|
9
|
+
import '../vendor/env.2ltrQNq0.js';
|
|
10
10
|
import 'std-env';
|
|
11
11
|
|
|
12
12
|
const UNKNOWN_TEST_ID = "__vitest__unknown_test__";
|
|
@@ -4,17 +4,17 @@ import 'pathe';
|
|
|
4
4
|
import '@vitest/runner/utils';
|
|
5
5
|
import { setupColors, createColors, getSafeTimers } from '@vitest/utils';
|
|
6
6
|
import { g as getWorkerState } from '../vendor/global.7bFbnyXl.js';
|
|
7
|
-
import '../vendor/env.
|
|
8
|
-
import { a as globalExpect, r as resetModules, v as vi } from '../vendor/vi.
|
|
7
|
+
import '../vendor/env.2ltrQNq0.js';
|
|
8
|
+
import { a as globalExpect, r as resetModules, v as vi } from '../vendor/vi.DXACdGTu.js';
|
|
9
9
|
import { a as startCoverageInsideWorker, s as stopCoverageInsideWorker } from '../vendor/coverage.BhYSDdTT.js';
|
|
10
|
-
import { a as resolveSnapshotEnvironment, s as setupChaiConfig, r as resolveTestRunner } from '../vendor/index
|
|
10
|
+
import { a as resolveSnapshotEnvironment, s as setupChaiConfig, r as resolveTestRunner } from '../vendor/index.B7pSlOSa.js';
|
|
11
11
|
import { createRequire } from 'node:module';
|
|
12
12
|
import util from 'node:util';
|
|
13
13
|
import timers from 'node:timers';
|
|
14
14
|
import { isatty } from 'node:tty';
|
|
15
15
|
import { installSourcemapsSupport } from 'vite-node/source-map';
|
|
16
|
-
import { V as VitestIndex } from '../vendor/index.
|
|
17
|
-
import { s as setupCommonEnv } from '../vendor/setup-common.
|
|
16
|
+
import { V as VitestIndex } from '../vendor/index.Hqvcg1pf.js';
|
|
17
|
+
import { s as setupCommonEnv } from '../vendor/setup-common.CWnv_2-5.js';
|
|
18
18
|
import { c as closeInspector } from '../vendor/inspector.hPQncR7V.js';
|
|
19
19
|
import 'std-env';
|
|
20
20
|
import 'chai';
|
|
@@ -31,8 +31,8 @@ import '../path.js';
|
|
|
31
31
|
import 'node:url';
|
|
32
32
|
import '../vendor/rpc.BGx7q_k2.js';
|
|
33
33
|
import '../vendor/index.BpSiYbpB.js';
|
|
34
|
-
import '../vendor/benchmark.
|
|
35
|
-
import '../vendor/index.
|
|
34
|
+
import '../vendor/benchmark.B6pblCp2.js';
|
|
35
|
+
import '../vendor/index.BJmtb_7W.js';
|
|
36
36
|
import '../vendor/run-once.Db8Hgq9X.js';
|
|
37
37
|
|
|
38
38
|
let globalSetup = false;
|
|
@@ -73,7 +73,7 @@ async function setupGlobalEnv(config, { environment }, executor) {
|
|
|
73
73
|
}
|
|
74
74
|
}
|
|
75
75
|
async function setupConsoleLogSpy() {
|
|
76
|
-
const { createCustomConsole } = await import('./runtime-console.
|
|
76
|
+
const { createCustomConsole } = await import('./runtime-console.O41g23Zj.js');
|
|
77
77
|
globalThis.console = createCustomConsole();
|
|
78
78
|
}
|
|
79
79
|
async function withEnv({ environment }, options, fn) {
|
package/dist/cli.js
CHANGED
package/dist/config.cjs
CHANGED
|
@@ -4,9 +4,10 @@ var os = require('node:os');
|
|
|
4
4
|
var stdEnv = require('std-env');
|
|
5
5
|
var vite = require('vite');
|
|
6
6
|
|
|
7
|
-
var _a$1;
|
|
7
|
+
var _a$1, _b$1;
|
|
8
8
|
const isNode = typeof process < "u" && typeof process.stdout < "u" && !((_a$1 = process.versions) == null ? void 0 : _a$1.deno) && !globalThis.window;
|
|
9
|
-
|
|
9
|
+
const isDeno = typeof process < "u" && typeof process.stdout < "u" && ((_b$1 = process.versions) == null ? void 0 : _b$1.deno) !== void 0;
|
|
10
|
+
(isNode || isDeno) && process.platform === "win32";
|
|
10
11
|
|
|
11
12
|
const defaultBrowserPort = 63315;
|
|
12
13
|
const extraInlineDeps = [
|
package/dist/config.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { ConfigEnv, Plugin, UserConfig, mergeConfig } from 'vite';
|
|
2
|
-
export {
|
|
2
|
+
export { aO as UserConfigExport, aN as UserConfigFn, aL as UserConfigFnObject, aM as UserConfigFnPromise, aQ as UserProjectConfigExport, aP as UserProjectConfigFn, K as UserWorkspaceConfig, aV as configDefaults, aY as coverageConfigDefaults, aU as defaultBrowserPort, aX as defaultExclude, aW as defaultInclude, aR as defineConfig, aS as defineProject, aT as defineWorkspace, aZ as extraInlineDeps } from './reporters-Cd1vkLMZ.js';
|
|
3
3
|
import '@vitest/runner';
|
|
4
4
|
import 'vite-node';
|
|
5
5
|
import '@vitest/snapshot';
|
package/dist/config.js
CHANGED
|
@@ -2,9 +2,10 @@ import os from 'node:os';
|
|
|
2
2
|
import { isCI } from 'std-env';
|
|
3
3
|
export { mergeConfig } from 'vite';
|
|
4
4
|
|
|
5
|
-
var _a$1;
|
|
5
|
+
var _a$1, _b$1;
|
|
6
6
|
const isNode = typeof process < "u" && typeof process.stdout < "u" && !((_a$1 = process.versions) == null ? void 0 : _a$1.deno) && !globalThis.window;
|
|
7
|
-
|
|
7
|
+
const isDeno = typeof process < "u" && typeof process.stdout < "u" && ((_b$1 = process.versions) == null ? void 0 : _b$1.deno) !== void 0;
|
|
8
|
+
(isNode || isDeno) && process.platform === "win32";
|
|
8
9
|
|
|
9
10
|
const defaultBrowserPort = 63315;
|
|
10
11
|
const extraInlineDeps = [
|
package/dist/coverage.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { B as BaseCoverageOptions, a as ResolvedCoverageOptions } from './reporters-
|
|
1
|
+
import { B as BaseCoverageOptions, a as ResolvedCoverageOptions } from './reporters-Cd1vkLMZ.js';
|
|
2
2
|
import 'vite';
|
|
3
3
|
import '@vitest/runner';
|
|
4
4
|
import 'vite-node';
|
|
@@ -138,9 +138,10 @@ declare class BaseCoverageProvider {
|
|
|
138
138
|
/**
|
|
139
139
|
* Check collected coverage against configured thresholds. Sets exit code to 1 when thresholds not reached.
|
|
140
140
|
*/
|
|
141
|
-
checkThresholds({ thresholds: allThresholds, perFile, }: {
|
|
141
|
+
checkThresholds({ thresholds: allThresholds, perFile, onError, }: {
|
|
142
142
|
thresholds: ResolvedThreshold[];
|
|
143
143
|
perFile?: boolean;
|
|
144
|
+
onError: (error: string) => void;
|
|
144
145
|
}): void;
|
|
145
146
|
/**
|
|
146
147
|
* Constructs collected coverage and users' threshold options into separate sets
|
package/dist/coverage.js
CHANGED
|
@@ -63,7 +63,8 @@ class BaseCoverageProvider {
|
|
|
63
63
|
*/
|
|
64
64
|
checkThresholds({
|
|
65
65
|
thresholds: allThresholds,
|
|
66
|
-
perFile
|
|
66
|
+
perFile,
|
|
67
|
+
onError
|
|
67
68
|
}) {
|
|
68
69
|
for (const { coverageMap, thresholds, name } of allThresholds) {
|
|
69
70
|
if (thresholds.branches === void 0 && thresholds.functions === void 0 && thresholds.lines === void 0 && thresholds.statements === void 0) {
|
|
@@ -97,7 +98,7 @@ class BaseCoverageProvider {
|
|
|
97
98
|
"/"
|
|
98
99
|
)}`;
|
|
99
100
|
}
|
|
100
|
-
|
|
101
|
+
onError(errorMessage);
|
|
101
102
|
}
|
|
102
103
|
}
|
|
103
104
|
}
|
package/dist/environments.d.ts
CHANGED
package/dist/execute.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import vm from 'node:vm';
|
|
2
2
|
import { ViteNodeRunner } from 'vite-node/client';
|
|
3
3
|
import { ViteNodeRunnerOptions } from 'vite-node';
|
|
4
|
-
import {
|
|
4
|
+
import { aI as PendingSuiteMock, aJ as MockFactory, e as RuntimeRPC, W as WorkerGlobalState, aK as MockMap } from './reporters-Cd1vkLMZ.js';
|
|
5
5
|
import 'vite';
|
|
6
6
|
import '@vitest/runner';
|
|
7
7
|
import '@vitest/snapshot';
|
package/dist/index.d.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { TaskPopulated, File, TaskResultPack } from '@vitest/runner';
|
|
2
2
|
export { CancelReason, Custom, DoneCallback, ExtendedContext, File, HookCleanupCallback, HookListener, OnTestFailedHandler, RunMode, RuntimeContext, SequenceHooks, SequenceSetupFiles, Suite, SuiteAPI, SuiteCollector, SuiteFactory, SuiteHooks, Task, TaskBase, TaskContext, TaskCustomOptions, TaskMeta, TaskResult, TaskResultPack, TaskState, Test, TestAPI, TestContext, TestFunction, TestOptions, afterAll, afterEach, beforeAll, beforeEach, describe, it, onTestFailed, onTestFinished, suite, test } from '@vitest/runner';
|
|
3
|
-
export { b as bench } from './suite-
|
|
3
|
+
export { b as bench } from './suite-BS2CV79a.js';
|
|
4
4
|
import { ExpectStatic } from '@vitest/expect';
|
|
5
|
-
export { Assertion, AsymmetricMatchersContaining, ExpectStatic, JestAssertion } from '@vitest/expect';
|
|
6
|
-
import { F as FakeTimerInstallOpts, M as MockFactoryWithHelper, h as RuntimeConfig, P as ProvidedContext, R as ResolvedConfig, i as ModuleGraphData, j as Reporter, k as BirpcReturn } from './reporters-
|
|
7
|
-
export { Y as AfterSuiteRunMeta, A as ApiConfig, a1 as ArgumentsType, a0 as Arrayable, _ as Awaitable, B as BaseCoverageOptions, ah as BenchFunction, af as Benchmark, ai as BenchmarkAPI, ag as BenchmarkResult, ae as BenchmarkUserOptions, G as BrowserConfigOptions, z as BrowserScript, s as BuiltinEnvironment, t as CSSModuleScopeStrategy, m as CollectLineNumbers, n as CollectLines, a3 as Constructable, p as Context, f as ContextRPC, N as ContextTestEnvironment, ab as CoverageIstanbulOptions, C as CoverageOptions, b as CoverageProvider, c as CoverageProviderModule, aa as CoverageReporter, ac as CoverageV8Options, ad as CustomProviderOptions, D as DepsOptimizationOptions, E as Environment, u as EnvironmentOptions, a5 as EnvironmentReturn, H as HappyDOMOptions, I as InlineConfig, J as JSDOMOptions, a4 as ModuleCache, a2 as MutableArray, $ as Nullable, a8 as OnServerRestartHandler, q as Pool, r as PoolOptions, y as ProjectConfig, l as RawErrsMap, a9 as ReportContext, X as ResolveIdFunction, a as ResolvedCoverageOptions, O as ResolvedTestEnvironment, o as RootAndTarget, L as RunnerRPC, e as RuntimeRPC, S as SerializableSpec, w as TransformModePatterns, T as TscErrorInfo, x as TypecheckConfig, U as UserConfig, a7 as UserConsoleLog, K as UserWorkspaceConfig, Q as Vitest, V as VitestEnvironment, v as VitestRunMode, a6 as VmEnvironmentReturn, g as WorkerContext, W as WorkerGlobalState, Z as WorkerRPC } from './reporters-
|
|
5
|
+
export { Assertion, AsymmetricMatchersContaining, ExpectPollOptions, ExpectStatic, JestAssertion } from '@vitest/expect';
|
|
6
|
+
import { F as FakeTimerInstallOpts, M as MockFactoryWithHelper, h as RuntimeConfig, P as ProvidedContext, R as ResolvedConfig, i as ModuleGraphData, j as Reporter, k as BirpcReturn } from './reporters-Cd1vkLMZ.js';
|
|
7
|
+
export { Y as AfterSuiteRunMeta, A as ApiConfig, a1 as ArgumentsType, a0 as Arrayable, _ as Awaitable, B as BaseCoverageOptions, ah as BenchFunction, af as Benchmark, ai as BenchmarkAPI, ag as BenchmarkResult, ae as BenchmarkUserOptions, G as BrowserConfigOptions, z as BrowserScript, s as BuiltinEnvironment, t as CSSModuleScopeStrategy, m as CollectLineNumbers, n as CollectLines, a3 as Constructable, p as Context, f as ContextRPC, N as ContextTestEnvironment, ab as CoverageIstanbulOptions, C as CoverageOptions, b as CoverageProvider, c as CoverageProviderModule, aa as CoverageReporter, ac as CoverageV8Options, ad as CustomProviderOptions, D as DepsOptimizationOptions, E as Environment, u as EnvironmentOptions, a5 as EnvironmentReturn, H as HappyDOMOptions, I as InlineConfig, J as JSDOMOptions, a4 as ModuleCache, a2 as MutableArray, $ as Nullable, a8 as OnServerRestartHandler, q as Pool, r as PoolOptions, y as ProjectConfig, l as RawErrsMap, a9 as ReportContext, X as ResolveIdFunction, a as ResolvedCoverageOptions, O as ResolvedTestEnvironment, o as RootAndTarget, L as RunnerRPC, e as RuntimeRPC, S as SerializableSpec, w as TransformModePatterns, T as TscErrorInfo, x as TypecheckConfig, U as UserConfig, a7 as UserConsoleLog, K as UserWorkspaceConfig, Q as Vitest, V as VitestEnvironment, v as VitestRunMode, a6 as VmEnvironmentReturn, g as WorkerContext, W as WorkerGlobalState, Z as WorkerRPC } from './reporters-Cd1vkLMZ.js';
|
|
8
8
|
import { spyOn, fn, MaybeMockedDeep, MaybeMocked, MaybePartiallyMocked, MaybePartiallyMockedDeep, MockInstance } from '@vitest/spy';
|
|
9
|
-
export { Mock, MockContext, MockInstance, Mocked, MockedClass, MockedFunction, MockedObject
|
|
9
|
+
export { Mock, MockContext, MockInstance, Mocked, MockedClass, MockedFunction, MockedObject } from '@vitest/spy';
|
|
10
10
|
export { SnapshotData, SnapshotMatchOptions, SnapshotResult, SnapshotSerializer, SnapshotStateOptions, SnapshotSummary, SnapshotUpdateState, UncheckedSnapshot } from '@vitest/snapshot';
|
|
11
11
|
export { DiffOptions } from '@vitest/utils/diff';
|
|
12
12
|
import { TransformResult } from 'vite';
|
|
@@ -1420,7 +1420,7 @@ declare function isWatchMode(): boolean;
|
|
|
1420
1420
|
* Gives access to injected context provided from the main thread.
|
|
1421
1421
|
* This usually returns a value provided by `globalSetup` or an external library.
|
|
1422
1422
|
*/
|
|
1423
|
-
declare function inject<T extends keyof ProvidedContext>(key: T): ProvidedContext[T];
|
|
1423
|
+
declare function inject<T extends keyof ProvidedContext & string>(key: T): ProvidedContext[T];
|
|
1424
1424
|
|
|
1425
1425
|
interface TransformResultWithSource extends TransformResult {
|
|
1426
1426
|
source?: string;
|
package/dist/index.js
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
export { afterAll, afterEach, beforeAll, beforeEach, describe, it, onTestFailed, onTestFinished, suite, test } from '@vitest/runner';
|
|
2
|
-
export { b as bench } from './vendor/benchmark.
|
|
2
|
+
export { b as bench } from './vendor/benchmark.B6pblCp2.js';
|
|
3
3
|
export { i as isFirstRun, a as runOnce } from './vendor/run-once.Db8Hgq9X.js';
|
|
4
|
-
export { c as createExpect, a as expect, v as vi, b as vitest } from './vendor/vi.
|
|
5
|
-
import { d as dist } from './vendor/index.
|
|
6
|
-
export { b as assertType, g as getRunningMode, i as inject, a as isWatchMode } from './vendor/index.
|
|
4
|
+
export { c as createExpect, a as expect, v as vi, b as vitest } from './vendor/vi.DXACdGTu.js';
|
|
5
|
+
import { d as dist } from './vendor/index.Hqvcg1pf.js';
|
|
6
|
+
export { b as assertType, g as getRunningMode, i as inject, a as isWatchMode } from './vendor/index.Hqvcg1pf.js';
|
|
7
7
|
import * as chai from 'chai';
|
|
8
8
|
export { chai };
|
|
9
9
|
export { assert, should } from 'chai';
|
|
10
10
|
import '@vitest/runner/utils';
|
|
11
11
|
import '@vitest/utils';
|
|
12
|
-
import './vendor/index.
|
|
12
|
+
import './vendor/index.BJmtb_7W.js';
|
|
13
13
|
import 'pathe';
|
|
14
14
|
import './vendor/global.7bFbnyXl.js';
|
|
15
|
-
import './vendor/env.
|
|
15
|
+
import './vendor/env.2ltrQNq0.js';
|
|
16
16
|
import 'std-env';
|
|
17
17
|
import './vendor/_commonjsHelpers.BFTU3MAI.js';
|
|
18
18
|
import '@vitest/expect';
|
package/dist/node.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { v as VitestRunMode, U as UserConfig, aj as VitestOptions, Q as Vitest, R as ResolvedConfig, P as ProvidedContext, ak as WorkspaceProject, e as RuntimeRPC, A as ApiConfig, al as Logger, am as TestSequencer, an as WorkspaceSpec } from './reporters-
|
|
2
|
-
export {
|
|
1
|
+
import { v as VitestRunMode, U as UserConfig, aj as VitestOptions, Q as Vitest, R as ResolvedConfig, P as ProvidedContext, ak as WorkspaceProject, e as RuntimeRPC, A as ApiConfig, al as Logger, am as TestSequencer, an as WorkspaceSpec } from './reporters-Cd1vkLMZ.js';
|
|
2
|
+
export { ay as BrowserBuiltinProvider, az as BrowserCommand, aA as BrowserCommandContext, aE as BrowserOrchestrator, at as BrowserProvider, as as BrowserProviderInitializationOptions, av as BrowserProviderModule, ax as BrowserProviderOptions, z as BrowserScript, aB as BrowserServer, aC as BrowserServerState, aD as BrowserServerStateContext, au as CDPSession, aH as HTMLOptions, aG as JUnitOptions, aF as JsonOptions, ao as ProcessPool, aw as ResolvedBrowserOptions, ar as TestSequencerConstructor, aq as VitestPackageInstaller, ap as getFilePoolName } from './reporters-Cd1vkLMZ.js';
|
|
3
3
|
import { UserConfig as UserConfig$1, Plugin, ResolvedConfig as ResolvedConfig$1 } from 'vite';
|
|
4
4
|
import * as vite from 'vite';
|
|
5
5
|
export { vite as Vite };
|
|
@@ -53,7 +53,7 @@ declare function registerConsoleShortcuts(ctx: Vitest, stdin: NodeJS.ReadStream
|
|
|
53
53
|
|
|
54
54
|
interface GlobalSetupContext {
|
|
55
55
|
config: ResolvedConfig;
|
|
56
|
-
provide: <T extends keyof ProvidedContext>(key: T, value: ProvidedContext[T]) => void;
|
|
56
|
+
provide: <T extends keyof ProvidedContext & string>(key: T, value: ProvidedContext[T]) => void;
|
|
57
57
|
}
|
|
58
58
|
|
|
59
59
|
interface MethodsOptions {
|
package/dist/node.js
CHANGED
|
@@ -1,26 +1,28 @@
|
|
|
1
|
-
export { b as VitestPackageInstaller, V as VitestPlugin, a as createMethodsRPC, c as createVitest, g as getFilePoolName, r as registerConsoleShortcuts, e as resolveApiServerConfig, f as resolveConfig, d as resolveFsAllow, s as startVitest } from './vendor/cli-api.
|
|
2
|
-
export { p as parseCLI } from './vendor/cac.
|
|
1
|
+
export { b as VitestPackageInstaller, V as VitestPlugin, a as createMethodsRPC, c as createVitest, g as getFilePoolName, r as registerConsoleShortcuts, e as resolveApiServerConfig, f as resolveConfig, d as resolveFsAllow, s as startVitest } from './vendor/cli-api.Bu-PSdzx.js';
|
|
2
|
+
export { p as parseCLI } from './vendor/cac.DRNUX42m.js';
|
|
3
3
|
import createDebug from 'debug';
|
|
4
4
|
export { distDir, rootDir } from './path.js';
|
|
5
|
-
export { e as BaseSequencer } from './vendor/index.
|
|
5
|
+
export { e as BaseSequencer } from './vendor/index.ZtQtNPP2.js';
|
|
6
6
|
export { createServer, isFileServingAllowed } from 'vite';
|
|
7
7
|
import 'pathe';
|
|
8
8
|
import './vendor/constants.BWsVtsAj.js';
|
|
9
9
|
import './vendor/coverage.BhYSDdTT.js';
|
|
10
10
|
import './vendor/index.D4nqnQWz.js';
|
|
11
11
|
import 'node:console';
|
|
12
|
+
import './vendor/index.D6GZqexG.js';
|
|
12
13
|
import 'node:path';
|
|
13
14
|
import 'node:url';
|
|
14
15
|
import 'node:process';
|
|
15
16
|
import 'node:fs';
|
|
16
|
-
import 'node:worker_threads';
|
|
17
17
|
import './vendor/_commonjsHelpers.BFTU3MAI.js';
|
|
18
|
+
import 'readline';
|
|
19
|
+
import 'events';
|
|
20
|
+
import 'node:worker_threads';
|
|
18
21
|
import 'os';
|
|
19
22
|
import 'path';
|
|
20
23
|
import 'util';
|
|
21
24
|
import './vendor/index.BMmMjLIQ.js';
|
|
22
25
|
import 'stream';
|
|
23
|
-
import 'events';
|
|
24
26
|
import 'fs';
|
|
25
27
|
import 'picocolors';
|
|
26
28
|
import 'vite-node/client';
|
|
@@ -29,7 +31,7 @@ import 'vite-node/server';
|
|
|
29
31
|
import '@vitest/runner/utils';
|
|
30
32
|
import './vendor/base.CTYV4Gnz.js';
|
|
31
33
|
import '@vitest/utils';
|
|
32
|
-
import './vendor/env.
|
|
34
|
+
import './vendor/env.2ltrQNq0.js';
|
|
33
35
|
import 'std-env';
|
|
34
36
|
import './vendor/index.BpSiYbpB.js';
|
|
35
37
|
import 'zlib';
|
|
@@ -53,14 +55,13 @@ import 'node:util';
|
|
|
53
55
|
import 'vite-node/utils';
|
|
54
56
|
import 'magic-string';
|
|
55
57
|
import '@vitest/utils/ast';
|
|
56
|
-
import './vendor/index.
|
|
58
|
+
import './vendor/index.BJmtb_7W.js';
|
|
57
59
|
import './vendor/global.7bFbnyXl.js';
|
|
58
60
|
import 'node:readline';
|
|
59
|
-
import 'readline';
|
|
60
61
|
import './vendor/utils.DSO2UK15.js';
|
|
61
62
|
import './vendor/tasks.DhVtQBtW.js';
|
|
62
63
|
import 'node:perf_hooks';
|
|
63
|
-
import './chunks/runtime-console.
|
|
64
|
+
import './chunks/runtime-console.O41g23Zj.js';
|
|
64
65
|
import 'node:stream';
|
|
65
66
|
import './vendor/date.W2xKR2qe.js';
|
|
66
67
|
import 'execa';
|
|
@@ -646,6 +646,12 @@ interface BrowserProviderInitializationOptions {
|
|
|
646
646
|
browser: string;
|
|
647
647
|
options?: BrowserProviderOptions;
|
|
648
648
|
}
|
|
649
|
+
interface CDPSession {
|
|
650
|
+
send: (method: string, params?: Record<string, unknown>) => Promise<unknown>;
|
|
651
|
+
on: (event: string, listener: (...args: unknown[]) => void) => void;
|
|
652
|
+
once: (event: string, listener: (...args: unknown[]) => void) => void;
|
|
653
|
+
off: (event: string, listener: (...args: unknown[]) => void) => void;
|
|
654
|
+
}
|
|
649
655
|
interface BrowserProvider {
|
|
650
656
|
name: string;
|
|
651
657
|
/**
|
|
@@ -657,6 +663,7 @@ interface BrowserProvider {
|
|
|
657
663
|
afterCommand?: (command: string, args: unknown[]) => Awaitable$1<void>;
|
|
658
664
|
getCommandsContext: (contextId: string) => Record<string, unknown>;
|
|
659
665
|
openPage: (contextId: string, url: string) => Promise<void>;
|
|
666
|
+
getCDPSession?: (contextId: string) => Promise<CDPSession>;
|
|
660
667
|
close: () => Awaitable$1<void>;
|
|
661
668
|
initialize(ctx: WorkspaceProject, options: BrowserProviderInitializationOptions): Awaitable$1<void>;
|
|
662
669
|
}
|
|
@@ -665,6 +672,7 @@ interface BrowserProviderModule {
|
|
|
665
672
|
}
|
|
666
673
|
interface BrowserProviderOptions {
|
|
667
674
|
}
|
|
675
|
+
type BrowserBuiltinProvider = 'webdriverio' | 'playwright' | 'preview';
|
|
668
676
|
interface BrowserConfigOptions {
|
|
669
677
|
/**
|
|
670
678
|
* if running tests in the browser should be the default
|
|
@@ -681,7 +689,7 @@ interface BrowserConfigOptions {
|
|
|
681
689
|
*
|
|
682
690
|
* @default 'preview'
|
|
683
691
|
*/
|
|
684
|
-
provider?:
|
|
692
|
+
provider?: BrowserBuiltinProvider | (string & {});
|
|
685
693
|
/**
|
|
686
694
|
* Options that are passed down to a browser provider.
|
|
687
695
|
* To support type hinting, add one of the types to your tsconfig.json "compilerOptions.types" field:
|
|
@@ -746,6 +754,11 @@ interface BrowserConfigOptions {
|
|
|
746
754
|
* @default __screenshots__
|
|
747
755
|
*/
|
|
748
756
|
screenshotDirectory?: string;
|
|
757
|
+
/**
|
|
758
|
+
* Should Vitest take screenshots if the test fails
|
|
759
|
+
* @default !browser.ui
|
|
760
|
+
*/
|
|
761
|
+
screenshotFailures?: boolean;
|
|
749
762
|
/**
|
|
750
763
|
* Scripts injected into the tester iframe.
|
|
751
764
|
*/
|
|
@@ -856,7 +869,7 @@ declare class WorkspaceProject {
|
|
|
856
869
|
constructor(path: string | number, ctx: Vitest, options?: InitializeProjectOptions | undefined);
|
|
857
870
|
getName(): string;
|
|
858
871
|
isCore(): boolean;
|
|
859
|
-
provide
|
|
872
|
+
provide<T extends keyof ProvidedContext & string>(key: T, value: ProvidedContext[T]): void;
|
|
860
873
|
getProvidedContext(): ProvidedContext;
|
|
861
874
|
initializeGlobalSetup(): Promise<void>;
|
|
862
875
|
teardownGlobalSetup(): Promise<void>;
|
|
@@ -1058,7 +1071,7 @@ declare class Vitest {
|
|
|
1058
1071
|
private _onSetServer;
|
|
1059
1072
|
private _onCancelListeners;
|
|
1060
1073
|
setServer(options: UserConfig, server: ViteDevServer, cliOptions: UserConfig): Promise<void>;
|
|
1061
|
-
provide<T extends keyof ProvidedContext>(key: T, value: ProvidedContext[T]): void;
|
|
1074
|
+
provide<T extends keyof ProvidedContext & string>(key: T, value: ProvidedContext[T]): void;
|
|
1062
1075
|
private createCoreProject;
|
|
1063
1076
|
getCoreWorkspaceProject(): WorkspaceProject;
|
|
1064
1077
|
getProjectByTaskId(taskId: string): WorkspaceProject;
|
|
@@ -2931,7 +2944,7 @@ interface ResolvedConfig extends Omit<Required<UserConfig>, 'config' | 'filters'
|
|
|
2931
2944
|
};
|
|
2932
2945
|
runner?: string;
|
|
2933
2946
|
}
|
|
2934
|
-
type ProjectConfig = Omit<UserConfig, 'sequencer' | 'shard' | 'watch' | 'run' | 'cache' | 'update' | 'reporters' | 'outputFile' | 'poolOptions' | 'teardownTimeout' | 'silent' | 'forceRerunTriggers' | 'testNamePattern' | 'ui' | 'open' | 'uiBase' | 'snapshotFormat' | 'resolveSnapshotPath' | 'passWithNoTests' | 'onConsoleLog' | 'onStackTrace' | 'dangerouslyIgnoreUnhandledErrors' | 'slowTestThreshold' | 'inspect' | 'inspectBrk' | 'deps' | 'coverage'> & {
|
|
2947
|
+
type ProjectConfig = Omit<UserConfig, 'sequencer' | 'shard' | 'watch' | 'run' | 'cache' | 'update' | 'reporters' | 'outputFile' | 'poolOptions' | 'teardownTimeout' | 'silent' | 'forceRerunTriggers' | 'testNamePattern' | 'ui' | 'open' | 'uiBase' | 'snapshotFormat' | 'resolveSnapshotPath' | 'passWithNoTests' | 'onConsoleLog' | 'onStackTrace' | 'dangerouslyIgnoreUnhandledErrors' | 'slowTestThreshold' | 'inspect' | 'inspectBrk' | 'deps' | 'coverage' | 'maxWorkers' | 'minWorkers' | 'fileParallelism'> & {
|
|
2935
2948
|
sequencer?: Omit<SequenceOptions, 'sequencer' | 'seed'>;
|
|
2936
2949
|
deps?: Omit<DepsOptions, 'moduleDirectories'>;
|
|
2937
2950
|
poolOptions?: {
|
|
@@ -3053,4 +3066,4 @@ type Context = RootAndTarget & {
|
|
|
3053
3066
|
lastActivePath?: string;
|
|
3054
3067
|
};
|
|
3055
3068
|
|
|
3056
|
-
export { type Nullable as $, type ApiConfig as A, type BaseCoverageOptions as B, type CoverageOptions as C, type DepsOptimizationOptions as D, type Environment as E, type FakeTimerInstallOpts as F, type BrowserConfigOptions as G, type HappyDOMOptions as H, type InlineConfig as I, type JSDOMOptions as J, type UserWorkspaceConfig as K, type RunnerRPC as L, type MockFactoryWithHelper as M, type ContextTestEnvironment as N, type ResolvedTestEnvironment as O, type ProvidedContext as P, Vitest as Q, type ResolvedConfig as R, type SerializableSpec as S, type TscErrorInfo as T, type UserConfig as U, type VitestEnvironment as V, type WorkerGlobalState as W, type ResolveIdFunction as X, type AfterSuiteRunMeta as Y, type WorkerRPC as Z, type Awaitable as _, type ResolvedCoverageOptions as a,
|
|
3069
|
+
export { type Nullable as $, type ApiConfig as A, type BaseCoverageOptions as B, type CoverageOptions as C, type DepsOptimizationOptions as D, type Environment as E, type FakeTimerInstallOpts as F, type BrowserConfigOptions as G, type HappyDOMOptions as H, type InlineConfig as I, type JSDOMOptions as J, type UserWorkspaceConfig as K, type RunnerRPC as L, type MockFactoryWithHelper as M, type ContextTestEnvironment as N, type ResolvedTestEnvironment as O, type ProvidedContext as P, Vitest as Q, type ResolvedConfig as R, type SerializableSpec as S, type TscErrorInfo as T, type UserConfig as U, type VitestEnvironment as V, type WorkerGlobalState as W, type ResolveIdFunction as X, type AfterSuiteRunMeta as Y, type WorkerRPC as Z, type Awaitable as _, type ResolvedCoverageOptions as a, BasicReporter as a$, type Arrayable as a0, type ArgumentsType$1 as a1, type MutableArray as a2, type Constructable as a3, type ModuleCache as a4, type EnvironmentReturn as a5, type VmEnvironmentReturn as a6, type UserConsoleLog as a7, type OnServerRestartHandler as a8, type ReportContext as a9, type BrowserCommandContext as aA, type BrowserServer as aB, type BrowserServerState as aC, type BrowserServerStateContext as aD, type BrowserOrchestrator as aE, type JsonOptions$1 as aF, type JUnitOptions as aG, type HTMLOptions as aH, type PendingSuiteMock as aI, type MockFactory as aJ, type MockMap as aK, type UserConfigFnObject as aL, type UserConfigFnPromise as aM, type UserConfigFn as aN, type UserConfigExport as aO, type UserProjectConfigFn as aP, type UserProjectConfigExport as aQ, defineConfig as aR, defineProject as aS, defineWorkspace as aT, defaultBrowserPort as aU, configDefaults as aV, defaultInclude as aW, defaultExclude as aX, coverageConfigDefaults as aY, extraInlineDeps as aZ, DefaultReporter as a_, type CoverageReporter as aa, type CoverageIstanbulOptions as ab, type CoverageV8Options as ac, type CustomProviderOptions as ad, type BenchmarkUserOptions as ae, type Benchmark as af, type BenchmarkResult as ag, type BenchFunction as ah, type BenchmarkAPI as ai, type VitestOptions as aj, WorkspaceProject as ak, Logger as al, type TestSequencer as am, type WorkspaceSpec as an, type ProcessPool as ao, getFilePoolName as ap, VitestPackageInstaller as aq, type TestSequencerConstructor as ar, type BrowserProviderInitializationOptions as as, type BrowserProvider as at, type CDPSession as au, type BrowserProviderModule as av, type ResolvedBrowserOptions as aw, type BrowserProviderOptions as ax, type BrowserBuiltinProvider as ay, type BrowserCommand as az, type CoverageProvider as b, DotReporter as b0, JsonReporter as b1, VerboseReporter as b2, TapReporter as b3, JUnitReporter as b4, TapFlatReporter as b5, HangingProcessReporter as b6, GithubActionsReporter as b7, BaseReporter as b8, ReportersMap as b9, type BuiltinReporters as ba, type BuiltinReporterOptions as bb, type JsonAssertionResult as bc, type JsonTestResult as bd, type JsonTestResults as be, BenchmarkReportsMap as bf, type BenchmarkBuiltinReporters as bg, type CoverageProviderModule as c, type BirpcOptions as d, type RuntimeRPC as e, type ContextRPC as f, type WorkerContext as g, type RuntimeConfig as h, type ModuleGraphData as i, type Reporter as j, type BirpcReturn as k, type RawErrsMap as l, type CollectLineNumbers as m, type CollectLines as n, type RootAndTarget as o, type Context as p, type Pool as q, type PoolOptions as r, type BuiltinEnvironment as s, type CSSModuleScopeStrategy as t, type EnvironmentOptions as u, type VitestRunMode as v, type TransformModePatterns as w, type TypecheckConfig as x, type ProjectConfig as y, type BrowserScript as z };
|
package/dist/reporters.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { b8 as BaseReporter, a$ as BasicReporter, bg as BenchmarkBuiltinReporters, bf as BenchmarkReportsMap, bb as BuiltinReporterOptions, ba as BuiltinReporters, a_ as DefaultReporter, b0 as DotReporter, b7 as GithubActionsReporter, b6 as HangingProcessReporter, b4 as JUnitReporter, bc as JsonAssertionResult, b1 as JsonReporter, bd as JsonTestResult, be as JsonTestResults, j as Reporter, b9 as ReportersMap, b5 as TapFlatReporter, b3 as TapReporter, b2 as VerboseReporter } from './reporters-Cd1vkLMZ.js';
|
|
2
2
|
import 'vite';
|
|
3
3
|
import '@vitest/runner';
|
|
4
4
|
import 'vite-node';
|
package/dist/reporters.js
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
export { B as BasicReporter, d as BenchmarkReportsMap, D as DefaultReporter, a as DotReporter, G as GithubActionsReporter, H as HangingProcessReporter, b as JUnitReporter, J as JsonReporter, R as ReportersMap, c as TapFlatReporter, T as TapReporter, V as VerboseReporter } from './vendor/index.
|
|
1
|
+
export { B as BasicReporter, d as BenchmarkReportsMap, D as DefaultReporter, a as DotReporter, G as GithubActionsReporter, H as HangingProcessReporter, b as JUnitReporter, J as JsonReporter, R as ReportersMap, c as TapFlatReporter, T as TapReporter, V as VerboseReporter } from './vendor/index.ZtQtNPP2.js';
|
|
2
2
|
import 'node:fs';
|
|
3
3
|
import 'picocolors';
|
|
4
4
|
import 'pathe';
|
|
5
5
|
import './vendor/tasks.DhVtQBtW.js';
|
|
6
6
|
import '@vitest/runner/utils';
|
|
7
7
|
import '@vitest/utils';
|
|
8
|
-
import './vendor/env.
|
|
8
|
+
import './vendor/env.2ltrQNq0.js';
|
|
9
9
|
import 'std-env';
|
|
10
10
|
import './vendor/utils.DSO2UK15.js';
|
|
11
11
|
import './vendor/base.CTYV4Gnz.js';
|
|
12
12
|
import 'node:perf_hooks';
|
|
13
13
|
import '@vitest/utils/source-map';
|
|
14
|
-
import './vendor/index.
|
|
14
|
+
import './vendor/index.BJmtb_7W.js';
|
|
15
15
|
import './vendor/global.7bFbnyXl.js';
|
|
16
|
-
import './chunks/runtime-console.
|
|
16
|
+
import './chunks/runtime-console.O41g23Zj.js';
|
|
17
17
|
import 'node:stream';
|
|
18
18
|
import 'node:console';
|
|
19
19
|
import 'node:path';
|
package/dist/runners.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { VitestRunner, VitestRunnerImportSource, File, Suite, Task, CancelReason, Test, Custom, TaskContext, ExtendedContext } from '@vitest/runner';
|
|
2
|
-
import { R as ResolvedConfig } from './reporters-
|
|
2
|
+
import { R as ResolvedConfig } from './reporters-Cd1vkLMZ.js';
|
|
3
3
|
import * as tinybench from 'tinybench';
|
|
4
4
|
import 'vite';
|
|
5
5
|
import 'vite-node';
|
package/dist/runners.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { setState, GLOBAL_EXPECT, getState } from '@vitest/expect';
|
|
2
|
-
import { g as getSnapshotClient, c as createExpect, v as vi } from './vendor/vi.
|
|
2
|
+
import { g as getSnapshotClient, c as createExpect, v as vi } from './vendor/vi.DXACdGTu.js';
|
|
3
3
|
import 'pathe';
|
|
4
4
|
import { g as getTestName } from './vendor/tasks.DhVtQBtW.js';
|
|
5
5
|
import { createDefer, getSafeTimers } from '@vitest/utils';
|
|
6
6
|
import { g as getWorkerState } from './vendor/global.7bFbnyXl.js';
|
|
7
|
-
import './vendor/env.
|
|
7
|
+
import './vendor/env.2ltrQNq0.js';
|
|
8
8
|
import { r as rpc } from './vendor/rpc.BGx7q_k2.js';
|
|
9
9
|
import { getTests, getNames } from '@vitest/runner/utils';
|
|
10
10
|
import { updateTask } from '@vitest/runner';
|
|
11
|
-
import { a as getBenchOptions, g as getBenchFn } from './vendor/benchmark.
|
|
11
|
+
import { a as getBenchOptions, g as getBenchFn } from './vendor/benchmark.B6pblCp2.js';
|
|
12
12
|
import 'chai';
|
|
13
13
|
import './vendor/_commonjsHelpers.BFTU3MAI.js';
|
|
14
14
|
import '@vitest/snapshot';
|
|
@@ -19,7 +19,7 @@ import './vendor/date.W2xKR2qe.js';
|
|
|
19
19
|
import '@vitest/spy';
|
|
20
20
|
import 'std-env';
|
|
21
21
|
import './vendor/index.BpSiYbpB.js';
|
|
22
|
-
import './vendor/index.
|
|
22
|
+
import './vendor/index.BJmtb_7W.js';
|
|
23
23
|
|
|
24
24
|
class VitestTestRunner {
|
|
25
25
|
constructor(config) {
|
package/dist/snapshot.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
export { VitestNodeSnapshotEnvironment as VitestSnapshotEnvironment } from './chunks/environments-node.
|
|
1
|
+
export { VitestNodeSnapshotEnvironment as VitestSnapshotEnvironment } from './chunks/environments-node.XE5FbRPQ.js';
|
|
2
2
|
import '@vitest/snapshot/environment';
|
|
3
3
|
import 'pathe';
|
|
4
4
|
import '@vitest/runner/utils';
|
|
5
5
|
import '@vitest/utils';
|
|
6
6
|
import './vendor/global.7bFbnyXl.js';
|
|
7
|
-
import './vendor/env.
|
|
7
|
+
import './vendor/env.2ltrQNq0.js';
|
|
8
8
|
import 'std-env';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Custom } from '@vitest/runner';
|
|
2
2
|
import '@vitest/runner/utils';
|
|
3
|
-
import { ah as BenchFunction, ai as BenchmarkAPI } from './reporters-
|
|
3
|
+
import { ah as BenchFunction, ai as BenchmarkAPI } from './reporters-Cd1vkLMZ.js';
|
|
4
4
|
import { Options } from 'tinybench';
|
|
5
5
|
|
|
6
6
|
declare function getBenchOptions(key: Custom): Options;
|
package/dist/suite.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export { createTaskCollector, getCurrentSuite, getCurrentTest, getFn, getHooks, setFn, setHooks } from '@vitest/runner';
|
|
2
2
|
export { createChainable } from '@vitest/runner/utils';
|
|
3
|
-
export { g as getBenchFn, a as getBenchOptions } from './suite-
|
|
4
|
-
import './reporters-
|
|
3
|
+
export { g as getBenchFn, a as getBenchOptions } from './suite-BS2CV79a.js';
|
|
4
|
+
import './reporters-Cd1vkLMZ.js';
|
|
5
5
|
import 'vite';
|
|
6
6
|
import 'vite-node';
|
|
7
7
|
import '@vitest/snapshot';
|
package/dist/suite.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
export { createTaskCollector, getCurrentSuite, getCurrentTest, getFn, getHooks, setFn, setHooks } from '@vitest/runner';
|
|
2
2
|
export { createChainable } from '@vitest/runner/utils';
|
|
3
|
-
export { g as getBenchFn, a as getBenchOptions } from './vendor/benchmark.
|
|
3
|
+
export { g as getBenchFn, a as getBenchOptions } from './vendor/benchmark.B6pblCp2.js';
|
|
4
4
|
import '@vitest/utils';
|
|
5
|
-
import './vendor/index.
|
|
5
|
+
import './vendor/index.BJmtb_7W.js';
|
|
6
6
|
import 'pathe';
|
|
7
7
|
import './vendor/global.7bFbnyXl.js';
|
|
8
|
-
import './vendor/env.
|
|
8
|
+
import './vendor/env.2ltrQNq0.js';
|
|
9
9
|
import 'std-env';
|
|
@@ -26,7 +26,7 @@ async function runBaseTests(state) {
|
|
|
26
26
|
ctx.files.forEach((i) => state.moduleCache.delete(i));
|
|
27
27
|
const [executor, { run }] = await Promise.all([
|
|
28
28
|
startViteNode({ state, requestStubs: getDefaultRequestStubs() }),
|
|
29
|
-
import('../chunks/runtime-runBaseTests.
|
|
29
|
+
import('../chunks/runtime-runBaseTests.BDt9gQFB.js')
|
|
30
30
|
]);
|
|
31
31
|
await run(
|
|
32
32
|
ctx.files,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { getCurrentSuite } from '@vitest/runner';
|
|
2
2
|
import { createChainable } from '@vitest/runner/utils';
|
|
3
3
|
import { noop } from '@vitest/utils';
|
|
4
|
-
import { i as isRunningInBenchmark } from './index.
|
|
4
|
+
import { i as isRunningInBenchmark } from './index.BJmtb_7W.js';
|
|
5
5
|
|
|
6
6
|
const benchFns = /* @__PURE__ */ new WeakMap();
|
|
7
7
|
const benchOptsMap = /* @__PURE__ */ new WeakMap();
|
|
@@ -618,7 +618,7 @@ class CAC extends EventEmitter {
|
|
|
618
618
|
|
|
619
619
|
const cac = (name = "") => new CAC(name);
|
|
620
620
|
|
|
621
|
-
var version = "2.0.0-beta.
|
|
621
|
+
var version = "2.0.0-beta.12";
|
|
622
622
|
|
|
623
623
|
const apiConfig = (port) => ({
|
|
624
624
|
port: {
|
|
@@ -955,7 +955,8 @@ const cliOptionsConfig = {
|
|
|
955
955
|
testerScripts: null,
|
|
956
956
|
commands: null,
|
|
957
957
|
viewport: null,
|
|
958
|
-
screenshotDirectory: null
|
|
958
|
+
screenshotDirectory: null,
|
|
959
|
+
screenshotFailures: null
|
|
959
960
|
}
|
|
960
961
|
},
|
|
961
962
|
pool: {
|
|
@@ -1426,6 +1427,7 @@ function createCLI(options = {}) {
|
|
|
1426
1427
|
cli.command("bench [...filters]", void 0, options).action(benchmark),
|
|
1427
1428
|
benchCliOptionsConfig
|
|
1428
1429
|
);
|
|
1430
|
+
cli.command("init <project>", void 0, options).action(init);
|
|
1429
1431
|
cli.command("[...filters]", void 0, options).action((filters, options2) => start("test", filters, options2));
|
|
1430
1432
|
return cli;
|
|
1431
1433
|
}
|
|
@@ -1485,7 +1487,7 @@ async function start(mode, cliFilters, options) {
|
|
|
1485
1487
|
} catch {
|
|
1486
1488
|
}
|
|
1487
1489
|
try {
|
|
1488
|
-
const { startVitest } = await import('./cli-api.
|
|
1490
|
+
const { startVitest } = await import('./cli-api.Bu-PSdzx.js').then(function (n) { return n.h; });
|
|
1489
1491
|
const ctx = await startVitest(mode, cliFilters.map(normalize), normalizeCliOptions(options));
|
|
1490
1492
|
if (!(ctx == null ? void 0 : ctx.shouldKeepServer())) {
|
|
1491
1493
|
await (ctx == null ? void 0 : ctx.exit());
|
|
@@ -1500,5 +1502,13 @@ ${c.red(divider(c.bold(c.inverse(" Unhandled Error "))))}`);
|
|
|
1500
1502
|
process.exit(1);
|
|
1501
1503
|
}
|
|
1502
1504
|
}
|
|
1505
|
+
async function init(project) {
|
|
1506
|
+
if (project !== "browser") {
|
|
1507
|
+
console.error(new Error('Only the "browser" project is supported. Use "vitest init browser" to create a new project.'));
|
|
1508
|
+
process.exit(1);
|
|
1509
|
+
}
|
|
1510
|
+
const { create } = await import('../chunks/browser-creator.Bw94IHrL.js');
|
|
1511
|
+
await create();
|
|
1512
|
+
}
|
|
1503
1513
|
|
|
1504
1514
|
export { createCLI as c, parseCLI as p, version as v };
|