vitest 2.0.0-beta.5 → 2.0.0-beta.7
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 +3 -3
- package/dist/cli.js +1 -1
- package/dist/config.d.ts +1 -1
- package/dist/coverage.d.ts +1 -1
- package/dist/coverage.js +30 -5
- package/dist/environments.d.ts +1 -1
- package/dist/execute.d.ts +1 -1
- package/dist/{index-C7JhjWOq.d.ts → index-DJww03qd.d.ts} +10 -4
- package/dist/index.d.ts +3 -3
- package/dist/node.d.ts +2 -2
- package/dist/node.js +3 -3
- package/dist/{reporters-qky6mwBH.d.ts → reporters-BUiJebWB.d.ts} +4 -3
- package/dist/reporters.d.ts +1 -1
- package/dist/reporters.js +1 -1
- package/dist/runners.d.ts +1 -1
- package/dist/{suite-B5_jYIf8.d.ts → suite-BMKo7M1F.d.ts} +1 -1
- package/dist/suite.d.ts +2 -2
- package/dist/vendor/{cac.sXjWMctD.js → cac.m8B4jDZA.js} +4 -4
- package/dist/vendor/{cli-api.BH9TJcYU.js → cli-api.BRiY1IY3.js} +16 -7
- package/dist/vendor/{index.CyGfDRbW.js → index.TBU3GqRP.js} +2 -1
- package/dist/workers.d.ts +1 -1
- package/package.json +9 -10
package/dist/browser.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export { processError, startTests } from '@vitest/runner';
|
|
2
|
-
import { R as ResolvedConfig, C as CoverageOptions, b as CoverageProvider, c as CoverageProviderModule } from './reporters-
|
|
2
|
+
import { R as ResolvedConfig, C as CoverageOptions, b as CoverageProvider, c as CoverageProviderModule } from './reporters-BUiJebWB.js';
|
|
3
3
|
import { VitestExecutor } from './execute.js';
|
|
4
|
-
export { i as Vitest } from './index-
|
|
4
|
+
export { i as Vitest } from './index-DJww03qd.js';
|
|
5
5
|
import 'vite';
|
|
6
6
|
import 'vite-node';
|
|
7
7
|
import '@vitest/snapshot';
|
|
@@ -17,7 +17,7 @@ import 'node:worker_threads';
|
|
|
17
17
|
import 'node:fs';
|
|
18
18
|
import 'chai';
|
|
19
19
|
import 'node:vm';
|
|
20
|
-
import './suite-
|
|
20
|
+
import './suite-BMKo7M1F.js';
|
|
21
21
|
import '@vitest/spy';
|
|
22
22
|
import '@vitest/utils/diff';
|
|
23
23
|
|
package/dist/cli.js
CHANGED
package/dist/config.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { ConfigEnv, Plugin, UserConfig, mergeConfig } from 'vite';
|
|
2
|
-
export { aJ as UserConfigExport, aI as UserConfigFn, aG as UserConfigFnObject, aH as UserConfigFnPromise, aL as UserProjectConfigExport, aK as UserProjectConfigFn, at as UserWorkspaceConfig, aP as configDefaults, aS as coverageConfigDefaults, aR as defaultExclude, aQ as defaultInclude, aM as defineConfig, aN as defineProject, aO as defineWorkspace, aT as extraInlineDeps } from './reporters-
|
|
2
|
+
export { aJ as UserConfigExport, aI as UserConfigFn, aG as UserConfigFnObject, aH as UserConfigFnPromise, aL as UserProjectConfigExport, aK as UserProjectConfigFn, at as UserWorkspaceConfig, aP as configDefaults, aS as coverageConfigDefaults, aR as defaultExclude, aQ as defaultInclude, aM as defineConfig, aN as defineProject, aO as defineWorkspace, aT as extraInlineDeps } from './reporters-BUiJebWB.js';
|
|
3
3
|
import '@vitest/runner';
|
|
4
4
|
import 'vite-node';
|
|
5
5
|
import '@vitest/snapshot';
|
package/dist/coverage.d.ts
CHANGED
package/dist/coverage.js
CHANGED
|
@@ -171,16 +171,41 @@ function resolveConfig(configModule) {
|
|
|
171
171
|
try {
|
|
172
172
|
if (mod.$type === "object")
|
|
173
173
|
return mod;
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
174
|
+
let config = resolveDefineConfig(mod);
|
|
175
|
+
if (config)
|
|
176
|
+
return config;
|
|
177
|
+
if (mod.$type === "function-call" && mod.$callee === "mergeConfig") {
|
|
178
|
+
config = resolveMergeConfig(mod);
|
|
179
|
+
if (config)
|
|
180
|
+
return config;
|
|
179
181
|
}
|
|
180
182
|
} catch (error) {
|
|
181
183
|
throw new Error(error instanceof Error ? error.message : String(error));
|
|
182
184
|
}
|
|
183
185
|
throw new Error("Failed to update coverage thresholds. Configuration file is too complex.");
|
|
184
186
|
}
|
|
187
|
+
function resolveDefineConfig(mod) {
|
|
188
|
+
if (mod.$type === "function-call" && mod.$callee === "defineConfig") {
|
|
189
|
+
if (mod.$args[0].$type === "object")
|
|
190
|
+
return mod.$args[0];
|
|
191
|
+
if (mod.$args[0].$type === "arrow-function-expression") {
|
|
192
|
+
if (mod.$args[0].$body.$type === "object") {
|
|
193
|
+
return mod.$args[0].$body;
|
|
194
|
+
}
|
|
195
|
+
const config = resolveMergeConfig(mod.$args[0].$body);
|
|
196
|
+
if (config)
|
|
197
|
+
return config;
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
function resolveMergeConfig(mod) {
|
|
202
|
+
if (mod.$type === "function-call" && mod.$callee === "mergeConfig") {
|
|
203
|
+
for (const arg of mod.$args) {
|
|
204
|
+
const config = resolveDefineConfig(arg);
|
|
205
|
+
if (config)
|
|
206
|
+
return config;
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
}
|
|
185
210
|
|
|
186
211
|
export { BaseCoverageProvider };
|
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 { aD as PendingSuiteMock, aE as MockFactory, e as RuntimeRPC, W as WorkerGlobalState, aF as MockMap } from './reporters-
|
|
4
|
+
import { aD as PendingSuiteMock, aE as MockFactory, e as RuntimeRPC, W as WorkerGlobalState, aF as MockMap } from './reporters-BUiJebWB.js';
|
|
5
5
|
import 'vite';
|
|
6
6
|
import '@vitest/runner';
|
|
7
7
|
import '@vitest/snapshot';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { TaskPopulated, Custom, DoneCallback, ExtendedContext, File, HookCleanupCallback, HookListener, OnTestFailedHandler, RunMode, RuntimeContext, SequenceHooks, SequenceSetupFiles, Suite, SuiteAPI, SuiteCollector, SuiteFactory, SuiteHooks, Task as Task$1, TaskBase, TaskContext, TaskCustomOptions, TaskMeta, TaskResult as TaskResult$1, TaskResultPack, TaskState, Test, TestAPI, TestContext, TestFunction, TestOptions, afterAll, afterEach, beforeAll, beforeEach, describe, it, onTestFailed, onTestFinished, suite, test } from '@vitest/runner';
|
|
2
|
-
import { b as bench } from './suite-
|
|
2
|
+
import { b as bench } from './suite-BMKo7M1F.js';
|
|
3
3
|
import { ExpectStatic, Assertion, AsymmetricMatchersContaining, JestAssertion } from '@vitest/expect';
|
|
4
|
-
import { F as FakeTimerInstallOpts, M as MockFactoryWithHelper, u as RuntimeConfig, P as ProvidedContext, A as AfterSuiteRunMeta, v as ApiConfig, w as ArgumentsType, x as Arrayable, y as Awaitable, B as BaseCoverageOptions, z as BenchFunction, D as Benchmark, G as BenchmarkAPI, I as BenchmarkResult, K as BenchmarkUserOptions, L as BrowserConfigOptions, r as BrowserScript, N as BuiltinEnvironment, O as CSSModuleScopeStrategy, Q as CollectLineNumbers, S as CollectLines, X as Constructable, Y as Context, f as ContextRPC, Z as ContextTestEnvironment, _ as CoverageIstanbulOptions, C as CoverageOptions, b as CoverageProvider, c as CoverageProviderModule, $ as CoverageReporter, a0 as CoverageV8Options, a1 as CustomProviderOptions, a2 as DepsOptimizationOptions, E as Environment, a3 as EnvironmentOptions, a4 as EnvironmentReturn, a5 as HappyDOMOptions, a6 as InlineConfig, a7 as JSDOMOptions, a8 as ModuleCache, a9 as ModuleGraphData, aa as MutableArray, ab as Nullable, ac as OnServerRestartHandler, ad as Pool, ae as PoolOptions, af as ProjectConfig, ag as RawErrsMap, ah as ReportContext, ai as Reporter, aj as ResolveIdFunction, R as ResolvedConfig, a as ResolvedCoverageOptions, ak as ResolvedTestEnvironment, al as RootAndTarget, am as RunnerRPC, e as RuntimeRPC, an as SerializableSpec, ao as TransformModePatterns, ap as TransformResultWithSource, aq as TscErrorInfo, ar as TypecheckConfig, U as UserConfig, as as UserConsoleLog, at as UserWorkspaceConfig, i as Vitest, au as VitestEnvironment, V as VitestRunMode, av as VmEnvironmentReturn, aw as WebSocketBrowserEvents, ax as WebSocketBrowserHandlers, ay as WebSocketBrowserRPC, az as WebSocketEvents, aA as WebSocketHandlers, aB as WebSocketRPC, g as WorkerContext, W as WorkerGlobalState, aC as WorkerRPC } from './reporters-
|
|
4
|
+
import { F as FakeTimerInstallOpts, M as MockFactoryWithHelper, u as RuntimeConfig, P as ProvidedContext, A as AfterSuiteRunMeta, v as ApiConfig, w as ArgumentsType, x as Arrayable, y as Awaitable, B as BaseCoverageOptions, z as BenchFunction, D as Benchmark, G as BenchmarkAPI, I as BenchmarkResult, K as BenchmarkUserOptions, L as BrowserConfigOptions, r as BrowserScript, N as BuiltinEnvironment, O as CSSModuleScopeStrategy, Q as CollectLineNumbers, S as CollectLines, X as Constructable, Y as Context, f as ContextRPC, Z as ContextTestEnvironment, _ as CoverageIstanbulOptions, C as CoverageOptions, b as CoverageProvider, c as CoverageProviderModule, $ as CoverageReporter, a0 as CoverageV8Options, a1 as CustomProviderOptions, a2 as DepsOptimizationOptions, E as Environment, a3 as EnvironmentOptions, a4 as EnvironmentReturn, a5 as HappyDOMOptions, a6 as InlineConfig, a7 as JSDOMOptions, a8 as ModuleCache, a9 as ModuleGraphData, aa as MutableArray, ab as Nullable, ac as OnServerRestartHandler, ad as Pool, ae as PoolOptions, af as ProjectConfig, ag as RawErrsMap, ah as ReportContext, ai as Reporter, aj as ResolveIdFunction, R as ResolvedConfig, a as ResolvedCoverageOptions, ak as ResolvedTestEnvironment, al as RootAndTarget, am as RunnerRPC, e as RuntimeRPC, an as SerializableSpec, ao as TransformModePatterns, ap as TransformResultWithSource, aq as TscErrorInfo, ar as TypecheckConfig, U as UserConfig, as as UserConsoleLog, at as UserWorkspaceConfig, i as Vitest, au as VitestEnvironment, V as VitestRunMode, av as VmEnvironmentReturn, aw as WebSocketBrowserEvents, ax as WebSocketBrowserHandlers, ay as WebSocketBrowserRPC, az as WebSocketEvents, aA as WebSocketHandlers, aB as WebSocketRPC, g as WorkerContext, W as WorkerGlobalState, aC as WorkerRPC } from './reporters-BUiJebWB.js';
|
|
5
5
|
import { spyOn, fn, MaybeMockedDeep, MaybeMocked, MaybePartiallyMocked, MaybePartiallyMockedDeep, MockInstance, Mock, MockContext, Mocked, MockedClass, MockedFunction, MockedObject, SpyInstance } from '@vitest/spy';
|
|
6
6
|
import { SnapshotData, SnapshotMatchOptions, SnapshotResult, SnapshotSerializer, SnapshotStateOptions, SnapshotSummary, SnapshotUpdateState, UncheckedSnapshot } from '@vitest/snapshot';
|
|
7
7
|
import { DiffOptions } from '@vitest/utils/diff';
|
|
@@ -1040,6 +1040,11 @@ interface AssertType {
|
|
|
1040
1040
|
}
|
|
1041
1041
|
declare const assertType: AssertType;
|
|
1042
1042
|
|
|
1043
|
+
interface BrowserUI {
|
|
1044
|
+
setCurrentFileId: (fileId: string) => void;
|
|
1045
|
+
setIframeViewport: (width: number, height: number) => Promise<void>;
|
|
1046
|
+
}
|
|
1047
|
+
|
|
1043
1048
|
/**
|
|
1044
1049
|
* This utils allows computational intensive tasks to only be ran once
|
|
1045
1050
|
* across test reruns to improve the watch mode performance.
|
|
@@ -1419,6 +1424,7 @@ declare const index_BenchmarkResult: typeof BenchmarkResult;
|
|
|
1419
1424
|
declare const index_BenchmarkUserOptions: typeof BenchmarkUserOptions;
|
|
1420
1425
|
declare const index_BrowserConfigOptions: typeof BrowserConfigOptions;
|
|
1421
1426
|
declare const index_BrowserScript: typeof BrowserScript;
|
|
1427
|
+
type index_BrowserUI = BrowserUI;
|
|
1422
1428
|
declare const index_BuiltinEnvironment: typeof BuiltinEnvironment;
|
|
1423
1429
|
declare const index_CSSModuleScopeStrategy: typeof CSSModuleScopeStrategy;
|
|
1424
1430
|
declare const index_CollectLineNumbers: typeof CollectLineNumbers;
|
|
@@ -1559,7 +1565,7 @@ declare const index_test: typeof test;
|
|
|
1559
1565
|
declare const index_vi: typeof vi;
|
|
1560
1566
|
declare const index_vitest: typeof vitest;
|
|
1561
1567
|
declare namespace index {
|
|
1562
|
-
export { index_AfterSuiteRunMeta as AfterSuiteRunMeta, index_ApiConfig as ApiConfig, index_ArgumentsType as ArgumentsType, index_Arrayable as Arrayable, type index_AssertType as AssertType, index_Assertion as Assertion, index_AsymmetricMatchersContaining as AsymmetricMatchersContaining, index_Awaitable as Awaitable, index_BaseCoverageOptions as BaseCoverageOptions, Bench as BenchFactory, index_BenchFunction as BenchFunction, Options as BenchOptions, Task as BenchTask, TaskResult as BenchTaskResult, index_Benchmark as Benchmark, index_BenchmarkAPI as BenchmarkAPI, index_BenchmarkResult as BenchmarkResult, index_BenchmarkUserOptions as BenchmarkUserOptions, index_BrowserConfigOptions as BrowserConfigOptions, index_BrowserScript as BrowserScript, index_BuiltinEnvironment as BuiltinEnvironment, index_CSSModuleScopeStrategy as CSSModuleScopeStrategy, index_CollectLineNumbers as CollectLineNumbers, index_CollectLines as CollectLines, index_Constructable as Constructable, index_Context as Context, index_ContextRPC as ContextRPC, index_ContextTestEnvironment as ContextTestEnvironment, index_CoverageIstanbulOptions as CoverageIstanbulOptions, index_CoverageOptions as CoverageOptions, index_CoverageProvider as CoverageProvider, index_CoverageProviderModule as CoverageProviderModule, index_CoverageReporter as CoverageReporter, index_CoverageV8Options as CoverageV8Options, index_Custom as Custom, index_CustomProviderOptions as CustomProviderOptions, index_DepsOptimizationOptions as DepsOptimizationOptions, index_DiffOptions as DiffOptions, index_DoneCallback as DoneCallback, index_Environment as Environment, index_EnvironmentOptions as EnvironmentOptions, index_EnvironmentReturn as EnvironmentReturn, index_ErrorWithDiff as ErrorWithDiff, index_ExpectStatic as ExpectStatic, type index_ExpectTypeOf as ExpectTypeOf, index_ExtendedContext as ExtendedContext, index_File as File, index_HappyDOMOptions as HappyDOMOptions, index_HookCleanupCallback as HookCleanupCallback, index_HookListener as HookListener, index_InlineConfig as InlineConfig, index_JSDOMOptions as JSDOMOptions, index_JestAssertion as JestAssertion, index_Mock as Mock, index_MockContext as MockContext, index_MockInstance as MockInstance, index_Mocked as Mocked, index_MockedClass as MockedClass, index_MockedFunction as MockedFunction, index_MockedObject as MockedObject, index_ModuleCache as ModuleCache, index_ModuleGraphData as ModuleGraphData, index_MutableArray as MutableArray, index_Nullable as Nullable, index_OnServerRestartHandler as OnServerRestartHandler, index_OnTestFailedHandler as OnTestFailedHandler, index_ParsedStack as ParsedStack, index_Pool as Pool, index_PoolOptions as PoolOptions, index_ProjectConfig as ProjectConfig, index_ProvidedContext as ProvidedContext, index_RawErrsMap as RawErrsMap, index_ReportContext as ReportContext, index_Reporter as Reporter, index_ResolveIdFunction as ResolveIdFunction, index_ResolvedConfig as ResolvedConfig, index_ResolvedCoverageOptions as ResolvedCoverageOptions, index_ResolvedTestEnvironment as ResolvedTestEnvironment, index_RootAndTarget as RootAndTarget, index_RunMode as RunMode, index_RunnerRPC as RunnerRPC, index_RuntimeConfig as RuntimeConfig, index_RuntimeContext as RuntimeContext, index_RuntimeRPC as RuntimeRPC, index_SequenceHooks as SequenceHooks, index_SequenceSetupFiles as SequenceSetupFiles, index_SerializableSpec as SerializableSpec, index_SnapshotData as SnapshotData, index_SnapshotMatchOptions as SnapshotMatchOptions, index_SnapshotResult as SnapshotResult, index_SnapshotSerializer as SnapshotSerializer, index_SnapshotStateOptions as SnapshotStateOptions, index_SnapshotSummary as SnapshotSummary, index_SnapshotUpdateState as SnapshotUpdateState, index_SpyInstance as SpyInstance, index_Suite as Suite, index_SuiteAPI as SuiteAPI, index_SuiteCollector as SuiteCollector, index_SuiteFactory as SuiteFactory, index_SuiteHooks as SuiteHooks, Task$1 as Task, index_TaskBase as TaskBase, index_TaskContext as TaskContext, index_TaskCustomOptions as TaskCustomOptions, index_TaskMeta as TaskMeta, TaskResult$1 as TaskResult, index_TaskResultPack as TaskResultPack, index_TaskState as TaskState, index_Test as Test, index_TestAPI as TestAPI, index_TestContext as TestContext, index_TestFunction as TestFunction, index_TestOptions as TestOptions, index_TransformModePatterns as TransformModePatterns, index_TransformResultWithSource as TransformResultWithSource, index_TscErrorInfo as TscErrorInfo, index_TypecheckConfig as TypecheckConfig, index_UncheckedSnapshot as UncheckedSnapshot, index_UserConfig as UserConfig, index_UserConsoleLog as UserConsoleLog, index_UserWorkspaceConfig as UserWorkspaceConfig, index_Vitest as Vitest, index_VitestEnvironment as VitestEnvironment, index_VitestRunMode as VitestRunMode, type index_VitestUtils as VitestUtils, index_VmEnvironmentReturn as VmEnvironmentReturn, index_WebSocketBrowserEvents as WebSocketBrowserEvents, index_WebSocketBrowserHandlers as WebSocketBrowserHandlers, index_WebSocketBrowserRPC as WebSocketBrowserRPC, index_WebSocketEvents as WebSocketEvents, index_WebSocketHandlers as WebSocketHandlers, index_WebSocketRPC as WebSocketRPC, index_WorkerContext as WorkerContext, index_WorkerGlobalState as WorkerGlobalState, index_WorkerRPC as WorkerRPC, index_afterAll as afterAll, index_afterEach as afterEach, index_assert as assert, index_assertType as assertType, index_beforeAll as beforeAll, index_beforeEach as beforeEach, index_bench as bench, index_chai as chai, index_createExpect as createExpect, index_describe as describe, globalExpect as expect, index_expectTypeOf as expectTypeOf, index_getRunningMode as getRunningMode, index_inject as inject, index_isFirstRun as isFirstRun, index_isWatchMode as isWatchMode, index_it as it, index_onTestFailed as onTestFailed, index_onTestFinished as onTestFinished, index_runOnce as runOnce, index_should as should, index_suite as suite, index_test as test, index_vi as vi, index_vitest as vitest };
|
|
1568
|
+
export { index_AfterSuiteRunMeta as AfterSuiteRunMeta, index_ApiConfig as ApiConfig, index_ArgumentsType as ArgumentsType, index_Arrayable as Arrayable, type index_AssertType as AssertType, index_Assertion as Assertion, index_AsymmetricMatchersContaining as AsymmetricMatchersContaining, index_Awaitable as Awaitable, index_BaseCoverageOptions as BaseCoverageOptions, Bench as BenchFactory, index_BenchFunction as BenchFunction, Options as BenchOptions, Task as BenchTask, TaskResult as BenchTaskResult, index_Benchmark as Benchmark, index_BenchmarkAPI as BenchmarkAPI, index_BenchmarkResult as BenchmarkResult, index_BenchmarkUserOptions as BenchmarkUserOptions, index_BrowserConfigOptions as BrowserConfigOptions, index_BrowserScript as BrowserScript, type index_BrowserUI as BrowserUI, index_BuiltinEnvironment as BuiltinEnvironment, index_CSSModuleScopeStrategy as CSSModuleScopeStrategy, index_CollectLineNumbers as CollectLineNumbers, index_CollectLines as CollectLines, index_Constructable as Constructable, index_Context as Context, index_ContextRPC as ContextRPC, index_ContextTestEnvironment as ContextTestEnvironment, index_CoverageIstanbulOptions as CoverageIstanbulOptions, index_CoverageOptions as CoverageOptions, index_CoverageProvider as CoverageProvider, index_CoverageProviderModule as CoverageProviderModule, index_CoverageReporter as CoverageReporter, index_CoverageV8Options as CoverageV8Options, index_Custom as Custom, index_CustomProviderOptions as CustomProviderOptions, index_DepsOptimizationOptions as DepsOptimizationOptions, index_DiffOptions as DiffOptions, index_DoneCallback as DoneCallback, index_Environment as Environment, index_EnvironmentOptions as EnvironmentOptions, index_EnvironmentReturn as EnvironmentReturn, index_ErrorWithDiff as ErrorWithDiff, index_ExpectStatic as ExpectStatic, type index_ExpectTypeOf as ExpectTypeOf, index_ExtendedContext as ExtendedContext, index_File as File, index_HappyDOMOptions as HappyDOMOptions, index_HookCleanupCallback as HookCleanupCallback, index_HookListener as HookListener, index_InlineConfig as InlineConfig, index_JSDOMOptions as JSDOMOptions, index_JestAssertion as JestAssertion, index_Mock as Mock, index_MockContext as MockContext, index_MockInstance as MockInstance, index_Mocked as Mocked, index_MockedClass as MockedClass, index_MockedFunction as MockedFunction, index_MockedObject as MockedObject, index_ModuleCache as ModuleCache, index_ModuleGraphData as ModuleGraphData, index_MutableArray as MutableArray, index_Nullable as Nullable, index_OnServerRestartHandler as OnServerRestartHandler, index_OnTestFailedHandler as OnTestFailedHandler, index_ParsedStack as ParsedStack, index_Pool as Pool, index_PoolOptions as PoolOptions, index_ProjectConfig as ProjectConfig, index_ProvidedContext as ProvidedContext, index_RawErrsMap as RawErrsMap, index_ReportContext as ReportContext, index_Reporter as Reporter, index_ResolveIdFunction as ResolveIdFunction, index_ResolvedConfig as ResolvedConfig, index_ResolvedCoverageOptions as ResolvedCoverageOptions, index_ResolvedTestEnvironment as ResolvedTestEnvironment, index_RootAndTarget as RootAndTarget, index_RunMode as RunMode, index_RunnerRPC as RunnerRPC, index_RuntimeConfig as RuntimeConfig, index_RuntimeContext as RuntimeContext, index_RuntimeRPC as RuntimeRPC, index_SequenceHooks as SequenceHooks, index_SequenceSetupFiles as SequenceSetupFiles, index_SerializableSpec as SerializableSpec, index_SnapshotData as SnapshotData, index_SnapshotMatchOptions as SnapshotMatchOptions, index_SnapshotResult as SnapshotResult, index_SnapshotSerializer as SnapshotSerializer, index_SnapshotStateOptions as SnapshotStateOptions, index_SnapshotSummary as SnapshotSummary, index_SnapshotUpdateState as SnapshotUpdateState, index_SpyInstance as SpyInstance, index_Suite as Suite, index_SuiteAPI as SuiteAPI, index_SuiteCollector as SuiteCollector, index_SuiteFactory as SuiteFactory, index_SuiteHooks as SuiteHooks, Task$1 as Task, index_TaskBase as TaskBase, index_TaskContext as TaskContext, index_TaskCustomOptions as TaskCustomOptions, index_TaskMeta as TaskMeta, TaskResult$1 as TaskResult, index_TaskResultPack as TaskResultPack, index_TaskState as TaskState, index_Test as Test, index_TestAPI as TestAPI, index_TestContext as TestContext, index_TestFunction as TestFunction, index_TestOptions as TestOptions, index_TransformModePatterns as TransformModePatterns, index_TransformResultWithSource as TransformResultWithSource, index_TscErrorInfo as TscErrorInfo, index_TypecheckConfig as TypecheckConfig, index_UncheckedSnapshot as UncheckedSnapshot, index_UserConfig as UserConfig, index_UserConsoleLog as UserConsoleLog, index_UserWorkspaceConfig as UserWorkspaceConfig, index_Vitest as Vitest, index_VitestEnvironment as VitestEnvironment, index_VitestRunMode as VitestRunMode, type index_VitestUtils as VitestUtils, index_VmEnvironmentReturn as VmEnvironmentReturn, index_WebSocketBrowserEvents as WebSocketBrowserEvents, index_WebSocketBrowserHandlers as WebSocketBrowserHandlers, index_WebSocketBrowserRPC as WebSocketBrowserRPC, index_WebSocketEvents as WebSocketEvents, index_WebSocketHandlers as WebSocketHandlers, index_WebSocketRPC as WebSocketRPC, index_WorkerContext as WorkerContext, index_WorkerGlobalState as WorkerGlobalState, index_WorkerRPC as WorkerRPC, index_afterAll as afterAll, index_afterEach as afterEach, index_assert as assert, index_assertType as assertType, index_beforeAll as beforeAll, index_beforeEach as beforeEach, index_bench as bench, index_chai as chai, index_createExpect as createExpect, index_describe as describe, globalExpect as expect, index_expectTypeOf as expectTypeOf, index_getRunningMode as getRunningMode, index_inject as inject, index_isFirstRun as isFirstRun, index_isWatchMode as isWatchMode, index_it as it, index_onTestFailed as onTestFailed, index_onTestFinished as onTestFinished, index_runOnce as runOnce, index_should as should, index_suite as suite, index_test as test, index_vi as vi, index_vitest as vitest };
|
|
1563
1569
|
}
|
|
1564
1570
|
|
|
1565
|
-
export { type AssertType as A, type ExpectTypeOf as E, type VitestUtils as V, isFirstRun as a, inject as b, createExpect as c, vi as d, getRunningMode as e, isWatchMode as f, globalExpect as g, expectTypeOf as h, index as i, assertType as j, runOnce as r, vitest as v };
|
|
1571
|
+
export { type AssertType as A, type BrowserUI as B, type ExpectTypeOf as E, type VitestUtils as V, isFirstRun as a, inject as b, createExpect as c, vi as d, getRunningMode as e, isWatchMode as f, globalExpect as g, expectTypeOf as h, index as i, assertType as j, runOnce as r, vitest as v };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export { 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';
|
|
2
|
-
export { b as bench } from './suite-
|
|
3
|
-
export { A as AssertType, E as ExpectTypeOf, V as VitestUtils, j as assertType, c as createExpect, g as expect, h as expectTypeOf, e as getRunningMode, b as inject, a as isFirstRun, f as isWatchMode, r as runOnce, d as vi, v as vitest } from './index-
|
|
4
|
-
export { A as AfterSuiteRunMeta, v as ApiConfig, w as ArgumentsType, x as Arrayable, y as Awaitable, B as BaseCoverageOptions, z as BenchFunction, D as Benchmark, G as BenchmarkAPI, I as BenchmarkResult, K as BenchmarkUserOptions, L as BrowserConfigOptions, r as BrowserScript, N as BuiltinEnvironment, O as CSSModuleScopeStrategy, Q as CollectLineNumbers, S as CollectLines, X as Constructable, Y as Context, f as ContextRPC, Z as ContextTestEnvironment, _ as CoverageIstanbulOptions, C as CoverageOptions, b as CoverageProvider, c as CoverageProviderModule, $ as CoverageReporter, a0 as CoverageV8Options, a1 as CustomProviderOptions, a2 as DepsOptimizationOptions, E as Environment, a3 as EnvironmentOptions, a4 as EnvironmentReturn, a5 as HappyDOMOptions, a6 as InlineConfig, a7 as JSDOMOptions, a8 as ModuleCache, a9 as ModuleGraphData, aa as MutableArray, ab as Nullable, ac as OnServerRestartHandler, ad as Pool, ae as PoolOptions, af as ProjectConfig, P as ProvidedContext, ag as RawErrsMap, ah as ReportContext, ai as Reporter, aj as ResolveIdFunction, R as ResolvedConfig, a as ResolvedCoverageOptions, ak as ResolvedTestEnvironment, al as RootAndTarget, am as RunnerRPC, u as RuntimeConfig, e as RuntimeRPC, an as SerializableSpec, ao as TransformModePatterns, ap as TransformResultWithSource, aq as TscErrorInfo, ar as TypecheckConfig, U as UserConfig, as as UserConsoleLog, at as UserWorkspaceConfig, i as Vitest, au as VitestEnvironment, V as VitestRunMode, av as VmEnvironmentReturn, aw as WebSocketBrowserEvents, ax as WebSocketBrowserHandlers, ay as WebSocketBrowserRPC, az as WebSocketEvents, aA as WebSocketHandlers, aB as WebSocketRPC, g as WorkerContext, W as WorkerGlobalState, aC as WorkerRPC } from './reporters-
|
|
2
|
+
export { b as bench } from './suite-BMKo7M1F.js';
|
|
3
|
+
export { A as AssertType, B as BrowserUI, E as ExpectTypeOf, V as VitestUtils, j as assertType, c as createExpect, g as expect, h as expectTypeOf, e as getRunningMode, b as inject, a as isFirstRun, f as isWatchMode, r as runOnce, d as vi, v as vitest } from './index-DJww03qd.js';
|
|
4
|
+
export { A as AfterSuiteRunMeta, v as ApiConfig, w as ArgumentsType, x as Arrayable, y as Awaitable, B as BaseCoverageOptions, z as BenchFunction, D as Benchmark, G as BenchmarkAPI, I as BenchmarkResult, K as BenchmarkUserOptions, L as BrowserConfigOptions, r as BrowserScript, N as BuiltinEnvironment, O as CSSModuleScopeStrategy, Q as CollectLineNumbers, S as CollectLines, X as Constructable, Y as Context, f as ContextRPC, Z as ContextTestEnvironment, _ as CoverageIstanbulOptions, C as CoverageOptions, b as CoverageProvider, c as CoverageProviderModule, $ as CoverageReporter, a0 as CoverageV8Options, a1 as CustomProviderOptions, a2 as DepsOptimizationOptions, E as Environment, a3 as EnvironmentOptions, a4 as EnvironmentReturn, a5 as HappyDOMOptions, a6 as InlineConfig, a7 as JSDOMOptions, a8 as ModuleCache, a9 as ModuleGraphData, aa as MutableArray, ab as Nullable, ac as OnServerRestartHandler, ad as Pool, ae as PoolOptions, af as ProjectConfig, P as ProvidedContext, ag as RawErrsMap, ah as ReportContext, ai as Reporter, aj as ResolveIdFunction, R as ResolvedConfig, a as ResolvedCoverageOptions, ak as ResolvedTestEnvironment, al as RootAndTarget, am as RunnerRPC, u as RuntimeConfig, e as RuntimeRPC, an as SerializableSpec, ao as TransformModePatterns, ap as TransformResultWithSource, aq as TscErrorInfo, ar as TypecheckConfig, U as UserConfig, as as UserConsoleLog, at as UserWorkspaceConfig, i as Vitest, au as VitestEnvironment, V as VitestRunMode, av as VmEnvironmentReturn, aw as WebSocketBrowserEvents, ax as WebSocketBrowserHandlers, ay as WebSocketBrowserRPC, az as WebSocketEvents, aA as WebSocketHandlers, aB as WebSocketRPC, g as WorkerContext, W as WorkerGlobalState, aC as WorkerRPC } from './reporters-BUiJebWB.js';
|
|
5
5
|
export { SnapshotData, SnapshotMatchOptions, SnapshotResult, SnapshotSerializer, SnapshotStateOptions, SnapshotSummary, SnapshotUpdateState, UncheckedSnapshot } from '@vitest/snapshot';
|
|
6
6
|
export { DiffOptions } from '@vitest/utils/diff';
|
|
7
7
|
export { Mock, MockContext, MockInstance, Mocked, MockedClass, MockedFunction, MockedObject, SpyInstance } from '@vitest/spy';
|
package/dist/node.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { V as VitestRunMode, U as UserConfig, h as VitestOptions, i as Vitest, R as ResolvedConfig, P as ProvidedContext, j as WorkspaceProject, e as RuntimeRPC, T as TestSequencer, k as WorkspaceSpec } from './reporters-
|
|
2
|
-
export { s as BrowserCommand, p as BrowserProvider, o as BrowserProviderInitializationOptions, q as BrowserProviderOptions, r as BrowserScript, H as HTMLOptions, t as JUnitOptions, J as JsonOptions, l as ProcessPool, n as TestSequencerConstructor, m as VitestPackageInstaller } from './reporters-
|
|
1
|
+
import { V as VitestRunMode, U as UserConfig, h as VitestOptions, i as Vitest, R as ResolvedConfig, P as ProvidedContext, j as WorkspaceProject, e as RuntimeRPC, T as TestSequencer, k as WorkspaceSpec } from './reporters-BUiJebWB.js';
|
|
2
|
+
export { s as BrowserCommand, p as BrowserProvider, o as BrowserProviderInitializationOptions, q as BrowserProviderOptions, r as BrowserScript, H as HTMLOptions, t as JUnitOptions, J as JsonOptions, l as ProcessPool, n as TestSequencerConstructor, m as VitestPackageInstaller } from './reporters-BUiJebWB.js';
|
|
3
3
|
import { UserConfig as UserConfig$1, Plugin } from 'vite';
|
|
4
4
|
export { isFileServingAllowed } from 'vite';
|
|
5
5
|
import { Writable } from 'node:stream';
|
package/dist/node.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export { b as VitestPackageInstaller, V as VitestPlugin, a as createMethodsRPC, c as createVitest, r as registerConsoleShortcuts, s as startVitest } from './vendor/cli-api.
|
|
2
|
-
export { p as parseCLI } from './vendor/cac.
|
|
3
|
-
export { B as BaseSequencer } from './vendor/index.
|
|
1
|
+
export { b as VitestPackageInstaller, V as VitestPlugin, a as createMethodsRPC, c as createVitest, r as registerConsoleShortcuts, s as startVitest } from './vendor/cli-api.BRiY1IY3.js';
|
|
2
|
+
export { p as parseCLI } from './vendor/cac.m8B4jDZA.js';
|
|
3
|
+
export { B as BaseSequencer } from './vendor/index.TBU3GqRP.js';
|
|
4
4
|
export { isFileServingAllowed } from 'vite';
|
|
5
5
|
import 'pathe';
|
|
6
6
|
import './vendor/constants.TCjCaw2D.js';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as vite from 'vite';
|
|
2
2
|
import { TransformResult as TransformResult$1, ViteDevServer, UserConfig as UserConfig$1, ConfigEnv, ServerOptions, DepOptimizationConfig, AliasOptions } from 'vite';
|
|
3
3
|
import * as _vitest_runner from '@vitest/runner';
|
|
4
|
-
import { File, Test as Test$1, Suite, TaskResultPack, CancelReason, Task, Custom, SequenceHooks, SequenceSetupFiles } from '@vitest/runner';
|
|
4
|
+
import { File, Test as Test$1, Suite, TaskResultPack, CancelReason, Task, TaskMeta, Custom, SequenceHooks, SequenceSetupFiles } from '@vitest/runner';
|
|
5
5
|
import { RawSourceMap, ViteNodeResolveId, FetchResult, ModuleCacheMap, ViteNodeServerOptions } from 'vite-node';
|
|
6
6
|
import { SnapshotResult, SnapshotSummary, SnapshotStateOptions, SnapshotState } from '@vitest/snapshot';
|
|
7
7
|
import { PromisifyAssertion, Tester, ExpectStatic } from '@vitest/expect';
|
|
@@ -668,9 +668,9 @@ interface BrowserConfigOptions {
|
|
|
668
668
|
/**
|
|
669
669
|
* Browser provider
|
|
670
670
|
*
|
|
671
|
-
* @default '
|
|
671
|
+
* @default 'preview'
|
|
672
672
|
*/
|
|
673
|
-
provider?: 'webdriverio' | 'playwright' | '
|
|
673
|
+
provider?: 'webdriverio' | 'playwright' | 'preview' | (string & {});
|
|
674
674
|
/**
|
|
675
675
|
* Options that are passed down to a browser provider.
|
|
676
676
|
* To support type hinting, add one of the types to your tsconfig.json "compilerOptions.types" field:
|
|
@@ -1246,6 +1246,7 @@ interface JsonAssertionResult {
|
|
|
1246
1246
|
fullName: string;
|
|
1247
1247
|
status: Status;
|
|
1248
1248
|
title: string;
|
|
1249
|
+
meta: TaskMeta;
|
|
1249
1250
|
duration?: Milliseconds | null;
|
|
1250
1251
|
failureMessages: Array<string> | null;
|
|
1251
1252
|
location?: Callsite | null;
|
package/dist/reporters.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { b2 as BaseReporter, aV as BasicReporter, ba as BenchmarkBuiltinReporters, b9 as BenchmarkReportsMap, b5 as BuiltinReporterOptions, b4 as BuiltinReporters, aU as DefaultReporter, aW as DotReporter, b1 as GithubActionsReporter, b0 as HangingProcessReporter, a_ as JUnitReporter, b6 as JsonAssertionResult, aX as JsonReporter, b7 as JsonTestResult, b8 as JsonTestResults, ai as Reporter, b3 as ReportersMap, a$ as TapFlatReporter, aZ as TapReporter, aY as VerboseReporter } from './reporters-
|
|
1
|
+
export { b2 as BaseReporter, aV as BasicReporter, ba as BenchmarkBuiltinReporters, b9 as BenchmarkReportsMap, b5 as BuiltinReporterOptions, b4 as BuiltinReporters, aU as DefaultReporter, aW as DotReporter, b1 as GithubActionsReporter, b0 as HangingProcessReporter, a_ as JUnitReporter, b6 as JsonAssertionResult, aX as JsonReporter, b7 as JsonTestResult, b8 as JsonTestResults, ai as Reporter, b3 as ReportersMap, a$ as TapFlatReporter, aZ as TapReporter, aY as VerboseReporter } from './reporters-BUiJebWB.js';
|
|
2
2
|
import 'vite';
|
|
3
3
|
import '@vitest/runner';
|
|
4
4
|
import 'vite-node';
|
package/dist/reporters.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { a as BasicReporter, e as BenchmarkReportsMap, D as DefaultReporter, b as DotReporter, G as GithubActionsReporter, H as HangingProcessReporter, c as JUnitReporter, J as JsonReporter, R as ReportersMap, d as TapFlatReporter, T as TapReporter, V as VerboseReporter } from './vendor/index.
|
|
1
|
+
export { a as BasicReporter, e as BenchmarkReportsMap, D as DefaultReporter, b as DotReporter, G as GithubActionsReporter, H as HangingProcessReporter, c as JUnitReporter, J as JsonReporter, R as ReportersMap, d as TapFlatReporter, T as TapReporter, V as VerboseReporter } from './vendor/index.TBU3GqRP.js';
|
|
2
2
|
import 'node:fs';
|
|
3
3
|
import 'picocolors';
|
|
4
4
|
import 'pathe';
|
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-BUiJebWB.js';
|
|
3
3
|
import * as tinybench from 'tinybench';
|
|
4
4
|
import 'vite';
|
|
5
5
|
import 'vite-node';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Custom } from '@vitest/runner';
|
|
2
2
|
import '@vitest/runner/utils';
|
|
3
|
-
import { z as BenchFunction, G as BenchmarkAPI } from './reporters-
|
|
3
|
+
import { z as BenchFunction, G as BenchmarkAPI } from './reporters-BUiJebWB.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-BMKo7M1F.js';
|
|
4
|
+
import './reporters-BUiJebWB.js';
|
|
5
5
|
import 'vite';
|
|
6
6
|
import 'vite-node';
|
|
7
7
|
import '@vitest/snapshot';
|
|
@@ -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.7";
|
|
622
622
|
|
|
623
623
|
const apiConfig = (port) => ({
|
|
624
624
|
port: {
|
|
@@ -925,7 +925,7 @@ const cliOptionsConfig = {
|
|
|
925
925
|
subcommands: apiConfig(defaultBrowserPort)
|
|
926
926
|
},
|
|
927
927
|
provider: {
|
|
928
|
-
description: 'Provider used to run browser tests. Some browsers are only available for specific providers. Can be "webdriverio", "playwright", or the path to a custom provider. Visit [`browser.provider`](https://vitest.dev/config/#browser-provider) for more information (default: `"
|
|
928
|
+
description: 'Provider used to run browser tests. Some browsers are only available for specific providers. Can be "webdriverio", "playwright", "preview", or the path to a custom provider. Visit [`browser.provider`](https://vitest.dev/config/#browser-provider) for more information (default: `"preview"`)',
|
|
929
929
|
argument: "<name>",
|
|
930
930
|
subcommands: null
|
|
931
931
|
// don't support custom objects
|
|
@@ -1132,7 +1132,7 @@ const cliOptionsConfig = {
|
|
|
1132
1132
|
description: "Run only typecheck tests. This automatically enables typecheck (default: `false`)"
|
|
1133
1133
|
},
|
|
1134
1134
|
checker: {
|
|
1135
|
-
description: 'Specify the typechecker to use. Available values are: "
|
|
1135
|
+
description: 'Specify the typechecker to use. Available values are: "tsc" and "vue-tsc" and a path to an executable (default: `"tsc"`)',
|
|
1136
1136
|
argument: "<name>",
|
|
1137
1137
|
subcommands: null
|
|
1138
1138
|
},
|
|
@@ -1448,7 +1448,7 @@ async function start(mode, cliFilters, options) {
|
|
|
1448
1448
|
} catch {
|
|
1449
1449
|
}
|
|
1450
1450
|
try {
|
|
1451
|
-
const { startVitest } = await import('./cli-api.
|
|
1451
|
+
const { startVitest } = await import('./cli-api.BRiY1IY3.js').then(function (n) { return n.d; });
|
|
1452
1452
|
const ctx = await startVitest(mode, cliFilters.map(normalize), normalizeCliOptions(options));
|
|
1453
1453
|
if (!(ctx == null ? void 0 : ctx.shouldKeepServer()))
|
|
1454
1454
|
await (ctx == null ? void 0 : ctx.exit());
|
|
@@ -19,14 +19,14 @@ import c from 'picocolors';
|
|
|
19
19
|
import { ViteNodeRunner } from 'vite-node/client';
|
|
20
20
|
import { SnapshotManager } from '@vitest/snapshot/manager';
|
|
21
21
|
import { ViteNodeServer } from 'vite-node/server';
|
|
22
|
-
import { v as version$1 } from './cac.
|
|
22
|
+
import { v as version$1 } from './cac.m8B4jDZA.js';
|
|
23
23
|
import { hasFailed, createFileTask, getTasks, getTests } from '@vitest/runner/utils';
|
|
24
24
|
import { n as noop$1, b as isPrimitive, c as groupBy, A as AggregateErrorPonyfill, a as slash$1, t as toArray, d as deepMerge, e as nanoid, w as wildcardPatternToRegExp, f as stdout } from './base._gnK9Slw.js';
|
|
25
25
|
import { createDefer, toArray as toArray$1, notNullish } from '@vitest/utils';
|
|
26
26
|
import { a as isWindows } from './env.bmJgw1qP.js';
|
|
27
27
|
import { rootDir, distDir } from '../path.js';
|
|
28
28
|
import { c as createBirpc } from './index.BpSiYbpB.js';
|
|
29
|
-
import { s as stringify, p as parse$3, w as wrapSerializableConfig, f as Typechecker, R as ReportersMap, e as BenchmarkReportsMap, g as RandomSequencer, B as BaseSequencer, h as findNodeAround, i as generateCodeFrame, j as highlightCode, L as Logger, k as BlobReporter, r as readBlobs } from './index.
|
|
29
|
+
import { s as stringify, p as parse$3, w as wrapSerializableConfig, f as Typechecker, R as ReportersMap, e as BenchmarkReportsMap, g as RandomSequencer, B as BaseSequencer, h as findNodeAround, i as generateCodeFrame, j as highlightCode, L as Logger, k as BlobReporter, r as readBlobs } from './index.TBU3GqRP.js';
|
|
30
30
|
import require$$0$4 from 'zlib';
|
|
31
31
|
import require$$0$5 from 'buffer';
|
|
32
32
|
import require$$1 from 'crypto';
|
|
@@ -82,6 +82,8 @@ async function getModuleGraph(ctx, projectName, id, browser = false) {
|
|
|
82
82
|
var _a;
|
|
83
83
|
if (!mod || !mod.id)
|
|
84
84
|
return;
|
|
85
|
+
if (mod.id === "\0@vitest/browser/context")
|
|
86
|
+
return;
|
|
85
87
|
if (seen.has(mod))
|
|
86
88
|
return seen.get(mod);
|
|
87
89
|
let id2 = clearId(mod.id);
|
|
@@ -116,10 +118,17 @@ function cloneByOwnProperties(value) {
|
|
|
116
118
|
}), {});
|
|
117
119
|
}
|
|
118
120
|
function stringifyReplace(key, value) {
|
|
119
|
-
if (value instanceof Error)
|
|
120
|
-
|
|
121
|
-
|
|
121
|
+
if (value instanceof Error) {
|
|
122
|
+
const cloned = cloneByOwnProperties(value);
|
|
123
|
+
return {
|
|
124
|
+
name: value.name,
|
|
125
|
+
message: value.message,
|
|
126
|
+
stack: value.stack,
|
|
127
|
+
...cloned
|
|
128
|
+
};
|
|
129
|
+
} else {
|
|
122
130
|
return value;
|
|
131
|
+
}
|
|
123
132
|
}
|
|
124
133
|
|
|
125
134
|
/*
|
|
@@ -12313,12 +12322,12 @@ async function createBrowserServer(project, configFile) {
|
|
|
12313
12322
|
return server;
|
|
12314
12323
|
}
|
|
12315
12324
|
|
|
12316
|
-
const builtinProviders = ["webdriverio", "playwright", "
|
|
12325
|
+
const builtinProviders = ["webdriverio", "playwright", "preview"];
|
|
12317
12326
|
async function getBrowserProvider(options, project) {
|
|
12318
12327
|
if (options.provider == null || builtinProviders.includes(options.provider)) {
|
|
12319
12328
|
await project.ctx.packageInstaller.ensureInstalled("@vitest/browser", project.config.root);
|
|
12320
12329
|
const providers = await project.runner.executeId("@vitest/browser/providers");
|
|
12321
|
-
const provider = options.provider || "
|
|
12330
|
+
const provider = options.provider || "preview";
|
|
12322
12331
|
return providers[provider];
|
|
12323
12332
|
}
|
|
12324
12333
|
let customProviderModule;
|
|
@@ -2698,7 +2698,8 @@ class JsonReporter {
|
|
|
2698
2698
|
title: t.name,
|
|
2699
2699
|
duration: (_b2 = t.result) == null ? void 0 : _b2.duration,
|
|
2700
2700
|
failureMessages: ((_d2 = (_c2 = t.result) == null ? void 0 : _c2.errors) == null ? void 0 : _d2.map((e) => e.stack || e.message)) || [],
|
|
2701
|
-
location: t.location
|
|
2701
|
+
location: t.location,
|
|
2702
|
+
meta: t.meta
|
|
2702
2703
|
};
|
|
2703
2704
|
});
|
|
2704
2705
|
if (tests2.some((t) => {
|
package/dist/workers.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as v8 from 'v8';
|
|
2
|
-
import { d as BirpcOptions, e as RuntimeRPC, f as ContextRPC, W as WorkerGlobalState, g as WorkerContext, R as ResolvedConfig } from './reporters-
|
|
2
|
+
import { d as BirpcOptions, e as RuntimeRPC, f as ContextRPC, W as WorkerGlobalState, g as WorkerContext, R as ResolvedConfig } from './reporters-BUiJebWB.js';
|
|
3
3
|
import { Awaitable } from '@vitest/utils';
|
|
4
4
|
import 'vite';
|
|
5
5
|
import '@vitest/runner';
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vitest",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "2.0.0-beta.
|
|
4
|
+
"version": "2.0.0-beta.7",
|
|
5
5
|
"description": "Next generation testing framework powered by Vite",
|
|
6
6
|
"author": "Anthony Fu <anthonyfu117@hotmail.com>",
|
|
7
7
|
"license": "MIT",
|
|
@@ -119,8 +119,8 @@
|
|
|
119
119
|
"@types/node": "^18.0.0 || >=20.0.0",
|
|
120
120
|
"happy-dom": "*",
|
|
121
121
|
"jsdom": "*",
|
|
122
|
-
"@vitest/browser": "2.0.0-beta.
|
|
123
|
-
"@vitest/ui": "2.0.0-beta.
|
|
122
|
+
"@vitest/browser": "2.0.0-beta.7",
|
|
123
|
+
"@vitest/ui": "2.0.0-beta.7"
|
|
124
124
|
},
|
|
125
125
|
"peerDependenciesMeta": {
|
|
126
126
|
"@edge-runtime/vm": {
|
|
@@ -154,12 +154,12 @@
|
|
|
154
154
|
"tinypool": "^0.9.0",
|
|
155
155
|
"vite": "^5.0.0",
|
|
156
156
|
"why-is-node-running": "^2.2.2",
|
|
157
|
-
"@vitest/expect": "2.0.0-beta.
|
|
158
|
-
"@vitest/
|
|
159
|
-
"@vitest/
|
|
160
|
-
"@vitest/spy": "2.0.0-beta.
|
|
161
|
-
"@vitest/
|
|
162
|
-
"vite-node": "2.0.0-beta.
|
|
157
|
+
"@vitest/expect": "2.0.0-beta.7",
|
|
158
|
+
"@vitest/snapshot": "2.0.0-beta.7",
|
|
159
|
+
"@vitest/runner": "2.0.0-beta.7",
|
|
160
|
+
"@vitest/spy": "2.0.0-beta.7",
|
|
161
|
+
"@vitest/utils": "2.0.0-beta.7",
|
|
162
|
+
"vite-node": "2.0.0-beta.7"
|
|
163
163
|
},
|
|
164
164
|
"devDependencies": {
|
|
165
165
|
"@ampproject/remapping": "^2.3.0",
|
|
@@ -189,7 +189,6 @@
|
|
|
189
189
|
"local-pkg": "^0.5.0",
|
|
190
190
|
"log-update": "^5.0.1",
|
|
191
191
|
"micromatch": "^4.0.5",
|
|
192
|
-
"p-limit": "^5.0.0",
|
|
193
192
|
"pretty-format": "^29.7.0",
|
|
194
193
|
"prompts": "^2.4.2",
|
|
195
194
|
"strip-ansi": "^7.1.0",
|