vitest 2.0.0-beta.6 → 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 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-qky6mwBH.js';
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-Bp1kcIfF.js';
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-B5_jYIf8.js';
20
+ import './suite-BMKo7M1F.js';
21
21
  import '@vitest/spy';
22
22
  import '@vitest/utils/diff';
23
23
 
package/dist/cli.js CHANGED
@@ -1,4 +1,4 @@
1
- import { c as createCLI } from './vendor/cac.DDQuPgBf.js';
1
+ import { c as createCLI } from './vendor/cac.m8B4jDZA.js';
2
2
  import 'pathe';
3
3
  import 'events';
4
4
  import 'picocolors';
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-qky6mwBH.js';
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';
@@ -1,4 +1,4 @@
1
- import { B as BaseCoverageOptions, a as ResolvedCoverageOptions } from './reporters-qky6mwBH.js';
1
+ import { B as BaseCoverageOptions, a as ResolvedCoverageOptions } from './reporters-BUiJebWB.js';
2
2
  import 'vite';
3
3
  import '@vitest/runner';
4
4
  import 'vite-node';
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
- if (mod.$type === "function-call") {
175
- if (mod.$args[0].$type === "object")
176
- return mod.$args[0];
177
- if (mod.$args[0].$type === "arrow-function-expression" && mod.$args[0].$body.$type === "object")
178
- return mod.$args[0].$body;
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 };
@@ -1,4 +1,4 @@
1
- import { E as Environment } from './reporters-qky6mwBH.js';
1
+ import { E as Environment } from './reporters-BUiJebWB.js';
2
2
  import 'vite';
3
3
  import '@vitest/runner';
4
4
  import 'vite-node';
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-qky6mwBH.js';
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-B5_jYIf8.js';
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-qky6mwBH.js';
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';
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-B5_jYIf8.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-Bp1kcIfF.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-qky6mwBH.js';
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-qky6mwBH.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-qky6mwBH.js';
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.C0OPqjkb.js';
2
- export { p as parseCLI } from './vendor/cac.DDQuPgBf.js';
3
- export { B as BaseSequencer } from './vendor/index.CyGfDRbW.js';
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 'webdriverio'
671
+ * @default 'preview'
672
672
  */
673
- provider?: 'webdriverio' | 'playwright' | 'none' | (string & {});
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;
@@ -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-qky6mwBH.js';
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.CyGfDRbW.js';
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-qky6mwBH.js';
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-qky6mwBH.js';
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-B5_jYIf8.js';
4
- import './reporters-qky6mwBH.js';
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.6";
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: `"webdriverio"`)',
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: "tcs" and "vue-tsc" and a path to an executable (default: `"tsc"`)',
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.C0OPqjkb.js').then(function (n) { return n.d; });
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.DDQuPgBf.js';
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.CyGfDRbW.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.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
- return cloneByOwnProperties(value);
121
- else
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", "none"];
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 || "webdriverio";
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-qky6mwBH.js';
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.6",
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.6",
123
- "@vitest/ui": "2.0.0-beta.6"
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.6",
158
- "@vitest/runner": "2.0.0-beta.6",
159
- "@vitest/snapshot": "2.0.0-beta.6",
160
- "@vitest/spy": "2.0.0-beta.6",
161
- "vite-node": "2.0.0-beta.6",
162
- "@vitest/utils": "2.0.0-beta.6"
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",