vitest 1.3.0 → 1.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (43) hide show
  1. package/LICENSE.md +1 -2
  2. package/dist/browser.d.ts +1 -1
  3. package/dist/browser.js +1 -1
  4. package/dist/chunks/{integrations-globals.FlQVNhQx.js → integrations-globals.THajbSRg.js} +3 -3
  5. package/dist/chunks/{runtime-runBaseTests.0UwIvo_U.js → runtime-runBaseTests.9RbsHRbU.js} +5 -5
  6. package/dist/cli.js +41 -1373
  7. package/dist/config.d.ts +1 -1
  8. package/dist/coverage.d.ts +6 -6
  9. package/dist/coverage.js +34 -3
  10. package/dist/environments.d.ts +1 -1
  11. package/dist/execute.d.ts +1 -1
  12. package/dist/execute.js +2 -2
  13. package/dist/index.d.ts +4 -3
  14. package/dist/index.js +4 -4
  15. package/dist/node.d.ts +11 -3
  16. package/dist/node.js +20 -12
  17. package/dist/{reporters-QGe8gs4b.d.ts → reporters-MmQN-57K.d.ts} +32 -7
  18. package/dist/reporters.d.ts +1 -1
  19. package/dist/reporters.js +2 -2
  20. package/dist/runners.d.ts +1 -1
  21. package/dist/runners.js +2 -2
  22. package/dist/{suite-xGC-mxBC.d.ts → suite-UrZdHRff.d.ts} +1 -1
  23. package/dist/suite.d.ts +2 -2
  24. package/dist/vendor/{base.knFzp7G3.js → base.N3JkKp7j.js} +1 -1
  25. package/dist/vendor/{base.RpormaJz.js → base.Z38YsPLm.js} +2 -2
  26. package/dist/vendor/{cli-api.RIYLcWhB.js → cac.wWT9ELdg.js} +6209 -74
  27. package/dist/vendor/{execute.aFSzc0Da.js → execute.27Kk4lQF.js} +1 -1
  28. package/dist/vendor/{index.CKbXK54q.js → index.9hqYxJUw.js} +1 -1
  29. package/dist/vendor/{index.n-Ib4UWN.js → index.JZMafwT-.js} +1 -1
  30. package/dist/vendor/{index.QcWmThJv.js → index.c1V_jzyZ.js} +7 -7
  31. package/dist/vendor/{setup-common.NSpEdAQm.js → setup-common.snyQUvE3.js} +1 -1
  32. package/dist/vendor/{vi.-Nr_x6dl.js → vi.C5mroSoP.js} +1 -1
  33. package/dist/vendor/{vm.UmCkcXp-.js → vm.o1IruPAo.js} +1 -1
  34. package/dist/worker.js +1 -1
  35. package/dist/workers/forks.js +3 -3
  36. package/dist/workers/runVmTests.js +5 -5
  37. package/dist/workers/threads.js +3 -3
  38. package/dist/workers/vmForks.js +3 -3
  39. package/dist/workers/vmThreads.js +3 -3
  40. package/dist/workers.d.ts +1 -1
  41. package/dist/workers.js +4 -4
  42. package/package.json +9 -9
  43. package/dist/chunks/api-setup.Xh60JpeM.js +0 -4771
package/dist/config.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  export { ConfigEnv, UserConfig, mergeConfig } from 'vite';
2
- export { aw as UserConfigExport, av as UserConfigFn, at as UserConfigFnObject, au as UserConfigFnPromise, ay as UserProjectConfigExport, ax as UserProjectConfigFn, a0 as UserWorkspaceConfig, aC as configDefaults, aF as coverageConfigDefaults, aE as defaultExclude, aD as defaultInclude, az as defineConfig, aA as defineProject, aB as defineWorkspace, aG as extraInlineDeps } from './reporters-QGe8gs4b.js';
2
+ export { ax as UserConfigExport, aw as UserConfigFn, au as UserConfigFnObject, av as UserConfigFnPromise, az as UserProjectConfigExport, ay as UserProjectConfigFn, a1 as UserWorkspaceConfig, aD as configDefaults, aG as coverageConfigDefaults, aF as defaultExclude, aE as defaultInclude, aA as defineConfig, aB as defineProject, aC as defineWorkspace, aH as extraInlineDeps } from './reporters-MmQN-57K.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-QGe8gs4b.js';
1
+ import { B as BaseCoverageOptions, a as ResolvedCoverageOptions } from './reporters-MmQN-57K.js';
2
2
  import 'vite';
3
3
  import '@vitest/runner';
4
4
  import 'vite-node';
@@ -128,13 +128,11 @@ declare class BaseCoverageProvider {
128
128
  /**
129
129
  * Check if current coverage is above configured thresholds and bump the thresholds if needed
130
130
  */
131
- updateThresholds({ thresholds: allThresholds, perFile, configurationFile }: {
131
+ updateThresholds({ thresholds: allThresholds, perFile, configurationFile, onUpdate }: {
132
132
  thresholds: ResolvedThreshold[];
133
133
  perFile?: boolean;
134
- configurationFile: {
135
- read: () => unknown;
136
- write: () => void;
137
- };
134
+ configurationFile: unknown;
135
+ onUpdate: () => void;
138
136
  }): void;
139
137
  /**
140
138
  * Check collected coverage against configured thresholds. Sets exit code to 1 when thresholds not reached.
@@ -157,6 +155,8 @@ declare class BaseCoverageProvider {
157
155
  * Resolve reporters from various configuration options
158
156
  */
159
157
  resolveReporters(configReporters: NonNullable<BaseCoverageOptions['reporter']>): ResolvedCoverageOptions['reporter'];
158
+ hasTerminalReporter(reporters: ResolvedCoverageOptions['reporter']): boolean;
159
+ toSlices<T>(array: T[], size: number): T[][];
160
160
  }
161
161
 
162
162
  export { BaseCoverageProvider };
package/dist/coverage.js CHANGED
@@ -10,9 +10,9 @@ class BaseCoverageProvider {
10
10
  /**
11
11
  * Check if current coverage is above configured thresholds and bump the thresholds if needed
12
12
  */
13
- updateThresholds({ thresholds: allThresholds, perFile, configurationFile }) {
13
+ updateThresholds({ thresholds: allThresholds, perFile, configurationFile, onUpdate }) {
14
14
  let updatedThresholds = false;
15
- const config = configurationFile.read();
15
+ const config = resolveConfig(configurationFile);
16
16
  assertConfigurationModule(config);
17
17
  for (const { coverageMap, thresholds, name } of allThresholds) {
18
18
  const summaries = perFile ? coverageMap.files().map((file) => coverageMap.fileCoverageFor(file).toSummary()) : [coverageMap.getCoverageSummary()];
@@ -37,7 +37,7 @@ class BaseCoverageProvider {
37
37
  }
38
38
  if (updatedThresholds) {
39
39
  console.log("Updating thresholds to configuration file. You may want to push with updated coverage thresholds.");
40
- configurationFile.write();
40
+ onUpdate();
41
41
  }
42
42
  }
43
43
  /**
@@ -131,6 +131,21 @@ class BaseCoverageProvider {
131
131
  }
132
132
  return resolvedReporters;
133
133
  }
134
+ hasTerminalReporter(reporters) {
135
+ return reporters.some(([reporter]) => reporter === "text" || reporter === "text-summary" || reporter === "text-lcov" || reporter === "teamcity");
136
+ }
137
+ toSlices(array, size) {
138
+ return array.reduce((chunks, item) => {
139
+ const index = Math.max(0, chunks.length - 1);
140
+ const lastChunk = chunks[index] || [];
141
+ chunks[index] = lastChunk;
142
+ if (lastChunk.length >= size)
143
+ chunks.push([item]);
144
+ else
145
+ lastChunk.push(item);
146
+ return chunks;
147
+ }, []);
148
+ }
134
149
  }
135
150
  function resolveGlobThresholds(thresholds) {
136
151
  if (!thresholds || typeof thresholds !== "object")
@@ -151,5 +166,21 @@ function assertConfigurationModule(config) {
151
166
  throw new Error(`Unable to parse thresholds from configuration file: ${message}`);
152
167
  }
153
168
  }
169
+ function resolveConfig(configModule) {
170
+ const mod = configModule.exports.default;
171
+ try {
172
+ if (mod.$type === "object")
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;
179
+ }
180
+ } catch (error) {
181
+ throw new Error(error instanceof Error ? error.message : String(error));
182
+ }
183
+ throw new Error("Failed to update coverage thresholds. Configuration file is too complex.");
184
+ }
154
185
 
155
186
  export { BaseCoverageProvider };
@@ -1,4 +1,4 @@
1
- import { E as Environment } from './reporters-QGe8gs4b.js';
1
+ import { E as Environment } from './reporters-MmQN-57K.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 { aq as PendingSuiteMock, ar as MockFactory, f as RuntimeRPC, p as WorkerGlobalState, as as MockMap } from './reporters-QGe8gs4b.js';
4
+ import { ar as PendingSuiteMock, as as MockFactory, e as RuntimeRPC, W as WorkerGlobalState, at as MockMap } from './reporters-MmQN-57K.js';
5
5
  import 'vite';
6
6
  import '@vitest/runner';
7
7
  import '@vitest/snapshot';
package/dist/execute.js CHANGED
@@ -1,4 +1,4 @@
1
- export { V as VitestExecutor } from './vendor/execute.aFSzc0Da.js';
1
+ export { V as VitestExecutor } from './vendor/execute.27Kk4lQF.js';
2
2
  import 'node:vm';
3
3
  import 'node:url';
4
4
  import 'vite-node/client';
@@ -8,4 +8,4 @@ import '@vitest/utils/error';
8
8
  import './path.js';
9
9
  import 'node:fs';
10
10
  import '@vitest/utils';
11
- import './vendor/base.knFzp7G3.js';
11
+ import './vendor/base.N3JkKp7j.js';
package/dist/index.d.ts CHANGED
@@ -1,10 +1,10 @@
1
1
  import { TaskPopulated, File, TaskResultPack, CancelReason } from '@vitest/runner';
2
2
  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';
3
- export { b as bench } from './suite-xGC-mxBC.js';
3
+ export { b as bench } from './suite-UrZdHRff.js';
4
4
  import { ExpectStatic } from '@vitest/expect';
5
5
  export { Assertion, AsymmetricMatchersContaining, ExpectStatic, JestAssertion } from '@vitest/expect';
6
- import { F as FakeTimerInstallOpts, M as MockFactoryWithHelper, r as RuntimeConfig, P as ProvidedContext, A as AfterSuiteRunMeta, t as UserConsoleLog, R as ResolvedConfig, u as ModuleGraphData, v as Reporter } from './reporters-QGe8gs4b.js';
7
- export { Q as ApiConfig, a9 as ArgumentsType, a8 as Arrayable, a6 as Awaitable, B as BaseCoverageOptions, ao as BenchFunction, am as Benchmark, ap as BenchmarkAPI, an as BenchmarkResult, al as BenchmarkUserOptions, L as BuiltinEnvironment, O as CSSModuleScopeStrategy, y as CollectLineNumbers, z as CollectLines, ab as Constructable, G as Context, o as ContextRPC, a2 as ContextTestEnvironment, ai as CoverageIstanbulOptions, C as CoverageOptions, b as CoverageProvider, c as CoverageProviderModule, ah as CoverageReporter, aj as CoverageV8Options, ak as CustomProviderOptions, X as DepsOptimizationOptions, E as Environment, S as EnvironmentOptions, ad as EnvironmentReturn, K as HappyDOMOptions, Z as InlineConfig, J as JSDOMOptions, ac as ModuleCache, aa as MutableArray, a7 as Nullable, af as OnServerRestartHandler, H as Pool, I as PoolOptions, $ as ProjectConfig, w as RawErrsMap, ag as ReportContext, a4 as ResolveIdFunction, a as ResolvedCoverageOptions, a3 as ResolvedTestEnvironment, D as RootAndTarget, a1 as RunnerRPC, f as RuntimeRPC, Y as TransformModePatterns, x as TscErrorInfo, _ as TypecheckConfig, U as UserConfig, a0 as UserWorkspaceConfig, e as Vitest, N as VitestEnvironment, V as VitestRunMode, ae as VmEnvironmentReturn, q as WorkerContext, p as WorkerGlobalState, a5 as WorkerRPC } from './reporters-QGe8gs4b.js';
6
+ import { F as FakeTimerInstallOpts, M as MockFactoryWithHelper, t as RuntimeConfig, P as ProvidedContext, A as AfterSuiteRunMeta, u as UserConsoleLog, R as ResolvedConfig, v as ModuleGraphData, w as Reporter } from './reporters-MmQN-57K.js';
7
+ export { S as ApiConfig, aa as ArgumentsType, a9 as Arrayable, a7 as Awaitable, B as BaseCoverageOptions, ap as BenchFunction, an as Benchmark, aq as BenchmarkAPI, ao as BenchmarkResult, am as BenchmarkUserOptions, N as BuiltinEnvironment, Q as CSSModuleScopeStrategy, z as CollectLineNumbers, D as CollectLines, ac as Constructable, H as Context, f as ContextRPC, a3 as ContextTestEnvironment, aj as CoverageIstanbulOptions, C as CoverageOptions, b as CoverageProvider, c as CoverageProviderModule, ai as CoverageReporter, ak as CoverageV8Options, al as CustomProviderOptions, Y as DepsOptimizationOptions, E as Environment, X as EnvironmentOptions, ae as EnvironmentReturn, L as HappyDOMOptions, _ as InlineConfig, K as JSDOMOptions, ad as ModuleCache, ab as MutableArray, a8 as Nullable, ag as OnServerRestartHandler, I as Pool, J as PoolOptions, a0 as ProjectConfig, x as RawErrsMap, ah as ReportContext, a5 as ResolveIdFunction, a as ResolvedCoverageOptions, a4 as ResolvedTestEnvironment, G as RootAndTarget, a2 as RunnerRPC, e as RuntimeRPC, Z as TransformModePatterns, y as TscErrorInfo, $ as TypecheckConfig, U as UserConfig, a1 as UserWorkspaceConfig, i as Vitest, O as VitestEnvironment, V as VitestRunMode, af as VmEnvironmentReturn, g as WorkerContext, W as WorkerGlobalState, a6 as WorkerRPC } from './reporters-MmQN-57K.js';
8
8
  import { spyOn, fn, MaybeMockedDeep, MaybeMocked, MaybePartiallyMocked, MaybePartiallyMockedDeep, MockInstance } from '@vitest/spy';
9
9
  export { Mock, MockContext, MockInstance, Mocked, MockedClass, MockedFunction, MockedObject, SpyInstance } from '@vitest/spy';
10
10
  export { SnapshotEnvironment } from '@vitest/snapshot/environment';
@@ -704,6 +704,7 @@ interface WebSocketHandlers {
704
704
  }
705
705
  interface WebSocketEvents extends Pick<Reporter, 'onCollected' | 'onFinished' | 'onTaskUpdate' | 'onUserConsoleLog' | 'onPathsCollected'> {
706
706
  onCancel: (reason: CancelReason) => void;
707
+ onFinishedReportCoverage: () => void;
707
708
  }
708
709
 
709
710
  export { AfterSuiteRunMeta, type AssertType, type ExpectTypeOf, ModuleGraphData, ProvidedContext, Reporter, ResolvedConfig, RuntimeConfig, type TransformResultWithSource, UserConsoleLog, type VitestUtils, type WebSocketEvents, type WebSocketHandlers, assertType, createExpect, globalExpect as expect, expectTypeOf, getRunningMode, inject, isFirstRun, isWatchMode, runOnce, vi, vitest };
package/dist/index.js CHANGED
@@ -1,9 +1,9 @@
1
1
  export { afterAll, afterEach, beforeAll, beforeEach, describe, it, onTestFailed, onTestFinished, suite, test } from '@vitest/runner';
2
2
  export { b as bench } from './vendor/benchmark.eeqk2rd8.js';
3
3
  export { i as isFirstRun, a as runOnce } from './vendor/run-once.Olz_Zkd8.js';
4
- export { c as createExpect, a as expect, v as vi, b as vitest } from './vendor/vi.-Nr_x6dl.js';
5
- import { d as dist } from './vendor/index.n-Ib4UWN.js';
6
- export { b as assertType, g as getRunningMode, i as inject, a as isWatchMode } from './vendor/index.n-Ib4UWN.js';
4
+ export { c as createExpect, a as expect, v as vi, b as vitest } from './vendor/vi.C5mroSoP.js';
5
+ import { d as dist } from './vendor/index.JZMafwT-.js';
6
+ export { b as assertType, g as getRunningMode, i as inject, a as isWatchMode } from './vendor/index.JZMafwT-.js';
7
7
  import * as chai from 'chai';
8
8
  export { chai };
9
9
  export { assert, should } from 'chai';
@@ -19,7 +19,7 @@ import '@vitest/snapshot';
19
19
  import '@vitest/utils/error';
20
20
  import './vendor/tasks.IknbGB2n.js';
21
21
  import '@vitest/utils/source-map';
22
- import './vendor/base.knFzp7G3.js';
22
+ import './vendor/base.N3JkKp7j.js';
23
23
  import './vendor/date.Ns1pGd_X.js';
24
24
  import '@vitest/spy';
25
25
 
package/dist/node.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { V as VitestRunMode, U as UserConfig, d as VitestOptions, e as Vitest, R as ResolvedConfig, P as ProvidedContext, W as WorkspaceProject, f as RuntimeRPC, T as TestSequencer, g as WorkspaceSpec } from './reporters-QGe8gs4b.js';
2
- export { l as BrowserProvider, k as BrowserProviderInitializationOptions, m as BrowserProviderOptions, h as ProcessPool, j as TestSequencerConstructor, i as VitestPackageInstaller, s as startVitest } from './reporters-QGe8gs4b.js';
1
+ import { V as VitestRunMode, U as UserConfig, h as VitestOptions, i as Vitest, j as CliOptions, R as ResolvedConfig, P as ProvidedContext, k as WorkspaceProject, e as RuntimeRPC, T as TestSequencer, l as WorkspaceSpec } from './reporters-MmQN-57K.js';
2
+ export { q as BrowserProvider, p as BrowserProviderInitializationOptions, r as BrowserProviderOptions, m as ProcessPool, o as TestSequencerConstructor, n as VitestPackageInstaller, s as startVitest } from './reporters-MmQN-57K.js';
3
3
  import { UserConfig as UserConfig$1, Plugin } from 'vite';
4
4
  import '@vitest/runner';
5
5
  import 'vite-node';
@@ -19,6 +19,14 @@ declare function createVitest(mode: VitestRunMode, options: UserConfig, viteOver
19
19
 
20
20
  declare function VitestPlugin(options?: UserConfig, ctx?: Vitest): Promise<Plugin[]>;
21
21
 
22
+ interface CLIOptions {
23
+ allowUnknownOptions?: boolean;
24
+ }
25
+ declare function parseCLI(argv: string | string[], config?: CLIOptions): {
26
+ filter: string[];
27
+ options: CliOptions;
28
+ };
29
+
22
30
  declare function registerConsoleShortcuts(ctx: Vitest): () => void;
23
31
 
24
32
  interface GlobalSetupContext {
@@ -35,4 +43,4 @@ declare class BaseSequencer implements TestSequencer {
35
43
  sort(files: WorkspaceSpec[]): Promise<WorkspaceSpec[]>;
36
44
  }
37
45
 
38
- export { BaseSequencer, type GlobalSetupContext, TestSequencer, Vitest, VitestPlugin, WorkspaceProject, WorkspaceSpec, createMethodsRPC, createVitest, registerConsoleShortcuts };
46
+ export { BaseSequencer, type GlobalSetupContext, TestSequencer, Vitest, VitestPlugin, WorkspaceProject, WorkspaceSpec, createMethodsRPC, createVitest, parseCLI, registerConsoleShortcuts };
package/dist/node.js CHANGED
@@ -1,6 +1,13 @@
1
- export { b as VitestPackageInstaller, V as VitestPlugin, a as createMethodsRPC, c as createVitest, r as registerConsoleShortcuts, s as startVitest } from './vendor/cli-api.RIYLcWhB.js';
2
- export { B as BaseSequencer } from './vendor/index.QcWmThJv.js';
1
+ export { b as VitestPackageInstaller, V as VitestPlugin, a as createMethodsRPC, c as createVitest, p as parseCLI, r as registerConsoleShortcuts, s as startVitest } from './vendor/cac.wWT9ELdg.js';
2
+ export { B as BaseSequencer } from './vendor/index.c1V_jzyZ.js';
3
3
  import 'pathe';
4
+ import 'events';
5
+ import 'picocolors';
6
+ import './vendor/index.ir9i0ywP.js';
7
+ import 'std-env';
8
+ import '@vitest/runner/utils';
9
+ import '@vitest/utils';
10
+ import './vendor/global.CkGT_TMy.js';
4
11
  import './vendor/constants.K-Wf1PUy.js';
5
12
  import './vendor/coverage.E7sG1b3r.js';
6
13
  import './vendor/index.GVFv9dZ0.js';
@@ -16,24 +23,26 @@ import 'path';
16
23
  import './vendor/index.xL8XjTLv.js';
17
24
  import 'util';
18
25
  import 'stream';
19
- import 'events';
20
26
  import 'fs';
21
- import 'picocolors';
22
27
  import 'vite-node/client';
23
28
  import '@vitest/snapshot/manager';
24
29
  import 'vite-node/server';
25
- import './vendor/index.ir9i0ywP.js';
26
- import 'std-env';
27
- import '@vitest/runner/utils';
28
- import '@vitest/utils';
29
- import './vendor/global.CkGT_TMy.js';
30
30
  import './path.js';
31
+ import './vendor/index.8bPxjt7g.js';
32
+ import 'zlib';
33
+ import 'buffer';
34
+ import 'crypto';
35
+ import 'https';
36
+ import 'http';
37
+ import 'net';
38
+ import 'tls';
39
+ import 'url';
40
+ import '@vitest/utils/source-map';
41
+ import './vendor/base.N3JkKp7j.js';
31
42
  import 'node:v8';
32
43
  import 'node:os';
33
44
  import 'node:events';
34
45
  import 'tinypool';
35
- import './vendor/index.8bPxjt7g.js';
36
- import './vendor/base.knFzp7G3.js';
37
46
  import 'node:worker_threads';
38
47
  import 'local-pkg';
39
48
  import 'node:crypto';
@@ -50,7 +59,6 @@ import './chunks/runtime-console.Iloo9fIt.js';
50
59
  import 'node:stream';
51
60
  import './vendor/date.Ns1pGd_X.js';
52
61
  import './vendor/tasks.IknbGB2n.js';
53
- import '@vitest/utils/source-map';
54
62
  import 'node:fs/promises';
55
63
  import 'execa';
56
64
  import 'module';
@@ -1496,6 +1496,11 @@ type Provider = 'v8' | 'istanbul' | 'custom' | undefined;
1496
1496
  type CoverageOptions<T extends Provider = Provider> = T extends 'istanbul' ? ({
1497
1497
  provider: T;
1498
1498
  } & CoverageIstanbulOptions) : T extends 'v8' ? ({
1499
+ /**
1500
+ * Provider to use for coverage collection.
1501
+ *
1502
+ * @default 'v8'
1503
+ */
1499
1504
  provider: T;
1500
1505
  } & CoverageV8Options) : T extends 'custom' ? ({
1501
1506
  provider: T;
@@ -1528,12 +1533,14 @@ interface BaseCoverageOptions {
1528
1533
  extension?: string | string[];
1529
1534
  /**
1530
1535
  * List of files excluded from coverage as glob patterns
1536
+ *
1537
+ * @default ['coverage/**', 'dist/**', '**\/[.]**', 'packages/*\/test?(s)/**', '**\/*.d.ts', '**\/virtual:*', '**\/__x00__*', '**\/\x00*', 'cypress/**', 'test?(s)/**', 'test?(-*).?(c|m)[jt]s?(x)', '**\/*{.,-}{test,spec}.?(c|m)[jt]s?(x)', '**\/__tests__/**', '**\/{karma,rollup,webpack,vite,vitest,jest,ava,babel,nyc,cypress,tsup,build}.config.*', '**\/vitest.{workspace,projects}.[jt]s?(on)', '**\/.{eslint,mocha,prettier}rc.{?(c|m)js,yml}']
1531
1538
  */
1532
1539
  exclude?: string[];
1533
1540
  /**
1534
1541
  * Whether to include all files, including the untested ones into report
1535
1542
  *
1536
- * @default false
1543
+ * @default true
1537
1544
  */
1538
1545
  all?: boolean;
1539
1546
  /**
@@ -1550,6 +1557,8 @@ interface BaseCoverageOptions {
1550
1557
  cleanOnRerun?: boolean;
1551
1558
  /**
1552
1559
  * Directory to write coverage report to
1560
+ *
1561
+ * @default './coverage'
1553
1562
  */
1554
1563
  reportsDirectory?: string;
1555
1564
  /**
@@ -1766,7 +1775,7 @@ interface BenchmarkUserOptions {
1766
1775
  include?: string[];
1767
1776
  /**
1768
1777
  * Exclude globs for benchmark test files
1769
- * @default ['node_modules', 'dist', '.idea', '.git', '.cache']
1778
+ * @default ['**\/node_modules/**', '**\/dist/**', '**\/cypress/**', '**\/.{idea,git,cache,output,temp}/**', '**\/{karma,rollup,webpack,vite,vitest,jest,ava,babel,nyc,cypress,tsup,build,eslint,prettier}.config.*']
1770
1779
  */
1771
1780
  exclude?: string[];
1772
1781
  /**
@@ -1778,6 +1787,8 @@ interface BenchmarkUserOptions {
1778
1787
  /**
1779
1788
  * Custom reporter for output. Can contain one or more built-in report names, reporter instances,
1780
1789
  * and/or paths to custom reporters
1790
+ *
1791
+ * @default ['default']
1781
1792
  */
1782
1793
  reporters?: Arrayable$1<BenchmarkBuiltinReporters | Reporter>;
1783
1794
  /**
@@ -2053,7 +2064,7 @@ interface InlineConfig {
2053
2064
  include?: string[];
2054
2065
  /**
2055
2066
  * Exclude globs for test files
2056
- * @default ['node_modules', 'dist', '.idea', '.git', '.cache']
2067
+ * @default ['**\/node_modules/**', '**\/dist/**', '**\/cypress/**', '**\/.{idea,git,cache,output,temp}/**', '**\/{karma,rollup,webpack,vite,vitest,jest,ava,babel,nyc,cypress,tsup,build,eslint,prettier}.config.*']
2057
2068
  */
2058
2069
  exclude?: string[];
2059
2070
  /**
@@ -2175,7 +2186,7 @@ interface InlineConfig {
2175
2186
  /**
2176
2187
  * Watch mode
2177
2188
  *
2178
- * @default true
2189
+ * @default !process.env.CI
2179
2190
  */
2180
2191
  watch?: boolean;
2181
2192
  /**
@@ -2187,6 +2198,8 @@ interface InlineConfig {
2187
2198
  /**
2188
2199
  * Custom reporter for output. Can contain one or more built-in report names, reporter instances,
2189
2200
  * and/or paths to custom reporters.
2201
+ *
2202
+ * @default []
2190
2203
  */
2191
2204
  reporters?: Arrayable<ReporterName | InlineReporter> | ((ReporterName | InlineReporter) | [ReporterName] | ReporterWithOptions)[];
2192
2205
  /**
@@ -2242,7 +2255,7 @@ interface InlineConfig {
2242
2255
  *
2243
2256
  * Useful if you are testing calling CLI commands
2244
2257
  *
2245
- * @default []
2258
+ * @default ['**\/package.json/**', '**\/{vitest,vite}.config.*\/**']
2246
2259
  */
2247
2260
  forceRerunTriggers?: string[];
2248
2261
  /**
@@ -2288,6 +2301,8 @@ interface InlineConfig {
2288
2301
  api?: boolean | number | ApiConfig;
2289
2302
  /**
2290
2303
  * Enable Vitest UI
2304
+ *
2305
+ * @default false
2291
2306
  */
2292
2307
  ui?: boolean;
2293
2308
  /**
@@ -2300,7 +2315,7 @@ interface InlineConfig {
2300
2315
  /**
2301
2316
  * Open UI automatically.
2302
2317
  *
2303
- * @default true
2318
+ * @default !process.env.CI
2304
2319
  */
2305
2320
  open?: boolean;
2306
2321
  /**
@@ -2335,6 +2350,8 @@ interface InlineConfig {
2335
2350
  passWithNoTests?: boolean;
2336
2351
  /**
2337
2352
  * Allow tests and suites that are marked as only
2353
+ *
2354
+ * @default !process.env.CI
2338
2355
  */
2339
2356
  allowOnly?: boolean;
2340
2357
  /**
@@ -2400,6 +2417,8 @@ interface InlineConfig {
2400
2417
  alias?: AliasOptions;
2401
2418
  /**
2402
2419
  * Ignore any unhandled errors that occur
2420
+ *
2421
+ * @default false
2403
2422
  */
2404
2423
  dangerouslyIgnoreUnhandledErrors?: boolean;
2405
2424
  /**
@@ -2471,14 +2490,20 @@ interface TypecheckConfig {
2471
2490
  only?: boolean;
2472
2491
  /**
2473
2492
  * What tools to use for type checking.
2493
+ *
2494
+ * @default 'tsc'
2474
2495
  */
2475
2496
  checker: 'tsc' | 'vue-tsc' | (string & Record<never, never>);
2476
2497
  /**
2477
2498
  * Pattern for files that should be treated as test files
2499
+ *
2500
+ * @default ['**\/*.{test,spec}-d.?(c|m)[jt]s?(x)']
2478
2501
  */
2479
2502
  include: string[];
2480
2503
  /**
2481
2504
  * Pattern for files that should not be treated as test files
2505
+ *
2506
+ * @default ['**\/node_modules/**', '**\/dist/**', '**\/cypress/**', '**\/.{idea,git,cache,output,temp}/**', '**\/{karma,rollup,webpack,vite,vitest,jest,ava,babel,nyc,cypress,tsup,build,eslint,prettier}.config.*']
2482
2507
  */
2483
2508
  exclude: string[];
2484
2509
  /**
@@ -2687,4 +2712,4 @@ type Context = RootAndTarget & {
2687
2712
  lastActivePath?: string;
2688
2713
  };
2689
2714
 
2690
- export { type ProjectConfig as $, type AfterSuiteRunMeta as A, type BaseCoverageOptions as B, type CoverageOptions as C, type RootAndTarget as D, type Environment as E, type FakeTimerInstallOpts as F, type Context as G, type Pool as H, type PoolOptions as I, type JSDOMOptions as J, type HappyDOMOptions as K, type BuiltinEnvironment as L, type MockFactoryWithHelper as M, type VitestEnvironment as N, type CSSModuleScopeStrategy as O, type ProvidedContext as P, type ApiConfig as Q, type ResolvedConfig as R, type EnvironmentOptions as S, type TestSequencer as T, type UserConfig as U, type VitestRunMode as V, WorkspaceProject as W, type DepsOptimizationOptions as X, type TransformModePatterns as Y, type InlineConfig as Z, type TypecheckConfig as _, type ResolvedCoverageOptions as a, type UserWorkspaceConfig as a0, type RunnerRPC as a1, type ContextTestEnvironment as a2, type ResolvedTestEnvironment as a3, type ResolveIdFunction as a4, type WorkerRPC as a5, type Awaitable as a6, type Nullable as a7, type Arrayable as a8, type ArgumentsType$1 as a9, defineProject as aA, defineWorkspace as aB, configDefaults as aC, defaultInclude as aD, defaultExclude as aE, coverageConfigDefaults as aF, extraInlineDeps as aG, DefaultReporter as aH, BasicReporter as aI, DotReporter as aJ, JsonReporter$1 as aK, VerboseReporter as aL, TapReporter as aM, JUnitReporter as aN, TapFlatReporter as aO, HangingProcessReporter as aP, GithubActionsReporter as aQ, BaseReporter as aR, ReportersMap as aS, type BuiltinReporters as aT, type BuiltinReporterOptions as aU, type JsonAssertionResult as aV, type JsonTestResult as aW, type JsonTestResults as aX, BenchmarkReportsMap as aY, type BenchmarkBuiltinReporters as aZ, type MutableArray as aa, type Constructable as ab, type ModuleCache as ac, type EnvironmentReturn as ad, type VmEnvironmentReturn as ae, type OnServerRestartHandler as af, type ReportContext as ag, type CoverageReporter as ah, type CoverageIstanbulOptions as ai, type CoverageV8Options as aj, type CustomProviderOptions as ak, type BenchmarkUserOptions as al, type Benchmark as am, type BenchmarkResult as an, type BenchFunction as ao, type BenchmarkAPI as ap, type PendingSuiteMock as aq, type MockFactory as ar, type MockMap as as, type UserConfigFnObject as at, type UserConfigFnPromise as au, type UserConfigFn as av, type UserConfigExport as aw, type UserProjectConfigFn as ax, type UserProjectConfigExport as ay, defineConfig as az, type CoverageProvider as b, type CoverageProviderModule as c, type VitestOptions as d, Vitest as e, type RuntimeRPC as f, type WorkspaceSpec as g, type ProcessPool as h, VitestPackageInstaller as i, type TestSequencerConstructor as j, type BrowserProviderInitializationOptions as k, type BrowserProvider as l, type BrowserProviderOptions as m, type BirpcOptions as n, type ContextRPC as o, type WorkerGlobalState as p, type WorkerContext as q, type RuntimeConfig as r, startVitest as s, type UserConsoleLog as t, type ModuleGraphData as u, type Reporter as v, type RawErrsMap as w, type TscErrorInfo as x, type CollectLineNumbers as y, type CollectLines as z };
2715
+ export { type TypecheckConfig as $, type AfterSuiteRunMeta as A, type BaseCoverageOptions as B, type CoverageOptions as C, type CollectLines as D, type Environment as E, type FakeTimerInstallOpts as F, type RootAndTarget as G, type Context as H, type Pool as I, type PoolOptions as J, type JSDOMOptions as K, type HappyDOMOptions as L, type MockFactoryWithHelper as M, type BuiltinEnvironment as N, type VitestEnvironment as O, type ProvidedContext as P, type CSSModuleScopeStrategy as Q, type ResolvedConfig as R, type ApiConfig as S, type TestSequencer as T, type UserConfig as U, type VitestRunMode as V, type WorkerGlobalState as W, type EnvironmentOptions as X, type DepsOptimizationOptions as Y, type TransformModePatterns as Z, type InlineConfig as _, type ResolvedCoverageOptions as a, type ProjectConfig as a0, type UserWorkspaceConfig as a1, type RunnerRPC as a2, type ContextTestEnvironment as a3, type ResolvedTestEnvironment as a4, type ResolveIdFunction as a5, type WorkerRPC as a6, type Awaitable as a7, type Nullable as a8, type Arrayable as a9, defineConfig as aA, defineProject as aB, defineWorkspace as aC, configDefaults as aD, defaultInclude as aE, defaultExclude as aF, coverageConfigDefaults as aG, extraInlineDeps as aH, DefaultReporter as aI, BasicReporter as aJ, DotReporter as aK, JsonReporter$1 as aL, VerboseReporter as aM, TapReporter as aN, JUnitReporter as aO, TapFlatReporter as aP, HangingProcessReporter as aQ, GithubActionsReporter as aR, BaseReporter as aS, ReportersMap as aT, type BuiltinReporters as aU, type BuiltinReporterOptions as aV, type JsonAssertionResult as aW, type JsonTestResult as aX, type JsonTestResults as aY, BenchmarkReportsMap as aZ, type BenchmarkBuiltinReporters as a_, type ArgumentsType$1 as aa, type MutableArray as ab, type Constructable as ac, type ModuleCache as ad, type EnvironmentReturn as ae, type VmEnvironmentReturn as af, type OnServerRestartHandler as ag, type ReportContext as ah, type CoverageReporter as ai, type CoverageIstanbulOptions as aj, type CoverageV8Options as ak, type CustomProviderOptions as al, type BenchmarkUserOptions as am, type Benchmark as an, type BenchmarkResult as ao, type BenchFunction as ap, type BenchmarkAPI as aq, type PendingSuiteMock as ar, type MockFactory as as, type MockMap as at, type UserConfigFnObject as au, type UserConfigFnPromise as av, type UserConfigFn as aw, type UserConfigExport as ax, type UserProjectConfigFn as ay, type UserProjectConfigExport as az, type CoverageProvider as b, type CoverageProviderModule as c, type BirpcOptions as d, type RuntimeRPC as e, type ContextRPC as f, type WorkerContext as g, type VitestOptions as h, Vitest as i, type CliOptions as j, WorkspaceProject as k, type WorkspaceSpec as l, type ProcessPool as m, VitestPackageInstaller as n, type TestSequencerConstructor as o, type BrowserProviderInitializationOptions as p, type BrowserProvider as q, type BrowserProviderOptions as r, startVitest as s, type RuntimeConfig as t, type UserConsoleLog as u, type ModuleGraphData as v, type Reporter as w, type RawErrsMap as x, type TscErrorInfo as y, type CollectLineNumbers as z };
@@ -1,4 +1,4 @@
1
- export { aR as BaseReporter, aI as BasicReporter, aZ as BenchmarkBuiltinReporters, aY as BenchmarkReportsMap, aU as BuiltinReporterOptions, aT as BuiltinReporters, aH as DefaultReporter, aJ as DotReporter, aQ as GithubActionsReporter, aP as HangingProcessReporter, aN as JUnitReporter, aV as JsonAssertionResult, aK as JsonReporter, aW as JsonTestResult, aX as JsonTestResults, v as Reporter, aS as ReportersMap, aO as TapFlatReporter, aM as TapReporter, aL as VerboseReporter } from './reporters-QGe8gs4b.js';
1
+ export { aS as BaseReporter, aJ as BasicReporter, a_ as BenchmarkBuiltinReporters, aZ as BenchmarkReportsMap, aV as BuiltinReporterOptions, aU as BuiltinReporters, aI as DefaultReporter, aK as DotReporter, aR as GithubActionsReporter, aQ as HangingProcessReporter, aO as JUnitReporter, aW as JsonAssertionResult, aL as JsonReporter, aX as JsonTestResult, aY as JsonTestResults, w as Reporter, aT as ReportersMap, aP as TapFlatReporter, aN as TapReporter, aM as VerboseReporter } from './reporters-MmQN-57K.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.QcWmThJv.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.c1V_jzyZ.js';
2
2
  import 'node:fs';
3
3
  import 'pathe';
4
4
  import './vendor/index.ir9i0ywP.js';
@@ -13,7 +13,7 @@ import 'node:stream';
13
13
  import 'node:console';
14
14
  import 'node:path';
15
15
  import './vendor/date.Ns1pGd_X.js';
16
- import './vendor/base.knFzp7G3.js';
16
+ import './vendor/base.N3JkKp7j.js';
17
17
  import './vendor/tasks.IknbGB2n.js';
18
18
  import '@vitest/utils/source-map';
19
19
  import 'node:os';
package/dist/runners.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { VitestRunner, VitestRunnerImportSource, Suite, Task, CancelReason, Test, Custom, TaskContext, ExtendedContext } from '@vitest/runner';
2
- import { R as ResolvedConfig } from './reporters-QGe8gs4b.js';
2
+ import { R as ResolvedConfig } from './reporters-MmQN-57K.js';
3
3
  import * as tinybench from 'tinybench';
4
4
  import 'vite';
5
5
  import 'vite-node';
package/dist/runners.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { setState, GLOBAL_EXPECT, getState } from '@vitest/expect';
2
- import { g as getSnapshotClient, c as createExpect, v as vi } from './vendor/vi.-Nr_x6dl.js';
2
+ import { g as getSnapshotClient, c as createExpect, v as vi } from './vendor/vi.C5mroSoP.js';
3
3
  import './vendor/index.ir9i0ywP.js';
4
4
  import { r as rpc } from './vendor/rpc.joBhAkyK.js';
5
5
  import { g as getFullName } from './vendor/tasks.IknbGB2n.js';
@@ -13,7 +13,7 @@ import './vendor/_commonjsHelpers.jjO7Zipk.js';
13
13
  import '@vitest/snapshot';
14
14
  import '@vitest/utils/error';
15
15
  import '@vitest/utils/source-map';
16
- import './vendor/base.knFzp7G3.js';
16
+ import './vendor/base.N3JkKp7j.js';
17
17
  import './vendor/date.Ns1pGd_X.js';
18
18
  import '@vitest/spy';
19
19
  import 'pathe';
@@ -1,6 +1,6 @@
1
1
  import { Custom } from '@vitest/runner';
2
2
  import '@vitest/runner/utils';
3
- import { ao as BenchFunction, ap as BenchmarkAPI } from './reporters-QGe8gs4b.js';
3
+ import { ap as BenchFunction, aq as BenchmarkAPI } from './reporters-MmQN-57K.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, 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-xGC-mxBC.js';
4
- import './reporters-QGe8gs4b.js';
3
+ export { g as getBenchFn, a as getBenchOptions } from './suite-UrZdHRff.js';
4
+ import './reporters-MmQN-57K.js';
5
5
  import 'vite';
6
6
  import 'vite-node';
7
7
  import '@vitest/snapshot';
@@ -102,4 +102,4 @@ function setProcessTitle(title) {
102
102
  }
103
103
  }
104
104
 
105
- export { AggregateErrorPonyfill as A, isPrimitive as a, slash as b, groupBy as c, deepMerge as d, stdout as e, getAllMockableProperties as g, isChildProcess as i, noop as n, setProcessTitle as s, toArray as t };
105
+ export { AggregateErrorPonyfill as A, slash as a, isPrimitive as b, groupBy as c, deepMerge as d, stdout as e, getAllMockableProperties as g, isChildProcess as i, noop as n, setProcessTitle as s, toArray as t };
@@ -1,6 +1,6 @@
1
1
  import { ModuleCacheMap } from 'vite-node/client';
2
2
  import { p as provideWorkerState } from './global.CkGT_TMy.js';
3
- import { g as getDefaultRequestStubs, s as startVitestExecutor } from './execute.aFSzc0Da.js';
3
+ import { g as getDefaultRequestStubs, s as startVitestExecutor } from './execute.27Kk4lQF.js';
4
4
 
5
5
  let _viteNode;
6
6
  const moduleCache = new ModuleCacheMap();
@@ -25,7 +25,7 @@ async function runBaseTests(state) {
25
25
  ctx.files.forEach((i) => state.moduleCache.delete(i));
26
26
  const [executor, { run }] = await Promise.all([
27
27
  startViteNode({ state, requestStubs: getDefaultRequestStubs() }),
28
- import('../chunks/runtime-runBaseTests.0UwIvo_U.js')
28
+ import('../chunks/runtime-runBaseTests.9RbsHRbU.js')
29
29
  ]);
30
30
  await run(
31
31
  ctx.files,