vitest 3.0.7 → 3.0.9

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 (66) hide show
  1. package/dist/browser.d.ts +14 -43
  2. package/dist/browser.js +4 -4
  3. package/dist/chunks/{base.BgUWWWYp.js → base.DV59CbtV.js} +2 -2
  4. package/dist/chunks/{benchmark.Cdu9hjj4.js → benchmark.DL72EVN-.js} +1 -1
  5. package/dist/chunks/{benchmark.CFFwLv-O.d.ts → benchmark.d.BwvBVTda.d.ts} +11 -11
  6. package/dist/chunks/{cac.87F_onld.js → cac.CeVHgzve.js} +30 -6
  7. package/dist/chunks/{cli-api.BZbq1zTX.js → cli-api.Ckwz_xSb.js} +21 -23
  8. package/dist/chunks/config.d.DevWltVl.d.ts +218 -0
  9. package/dist/chunks/{constants.fzPh7AOq.js → constants.DTYd6dNH.js} +1 -1
  10. package/dist/chunks/{coverage.DnNIv-kJ.js → coverage.A3sS5-Wm.js} +1 -29
  11. package/dist/chunks/coverage.d.S9RMNXIe.d.ts +35 -0
  12. package/dist/chunks/{resolveConfig.BbcK25zb.js → coverage.gV8doR2Y.js} +500 -131
  13. package/dist/chunks/{creator.2CFRE1Yx.js → creator.BsBnpTzI.js} +1 -1
  14. package/dist/chunks/defaults.C2Ndd9wx.js +119 -0
  15. package/dist/chunks/env.D4Lgay0q.js +8 -0
  16. package/dist/chunks/environment.d.C8UItCbf.d.ts +170 -0
  17. package/dist/chunks/{execute.Bhwls1-Z.js → execute.eDH0aFFd.js} +4 -4
  18. package/dist/chunks/global.d.Cg2sEPIm.d.ts +127 -0
  19. package/dist/chunks/{globals.BCtI_nQG.js → globals.BEpDe-k3.js} +5 -5
  20. package/dist/chunks/{index.C1f-_gvH.js → index.B8tIoLPT.js} +8 -3
  21. package/dist/chunks/{index.B8haHJlQ.js → index.D7Ny8f_s.js} +2 -2
  22. package/dist/chunks/{index.BmFFzXX_.js → index.uXkkC4xl.js} +1 -2
  23. package/dist/chunks/{mocker.cRtM890J.d.ts → mocker.d.BE_2ls6u.d.ts} +6 -6
  24. package/dist/chunks/reporters.d.CqBhtcTq.d.ts +3006 -0
  25. package/dist/chunks/{runBaseTests.9XCQcSZC.js → runBaseTests.BVrL_ow3.js} +9 -9
  26. package/dist/chunks/{setup-common.wObu9a36.js → setup-common.CPvtqi8q.js} +25 -2
  27. package/dist/chunks/{suite.qtkXWc6R.d.ts → suite.d.FvehnV49.d.ts} +1 -1
  28. package/dist/chunks/{typechecker.cZ0LjdSi.js → typechecker.BlF3eHsb.js} +2 -7
  29. package/dist/chunks/{vi.DT3m61kS.js → vi.nSCvwQ7l.js} +4 -4
  30. package/dist/chunks/vite.d.BUZTGxQ3.d.ts +11 -0
  31. package/dist/chunks/{vm.6kNys9FN.js → vm.jEFQDlX_.js} +1 -1
  32. package/dist/chunks/{worker.DaAIyCKm.d.ts → worker.d.C58isfFm.d.ts} +62 -62
  33. package/dist/chunks/{worker.B2JXutr8.d.ts → worker.d.CSFlSYJg.d.ts} +2 -2
  34. package/dist/cli.js +2 -2
  35. package/dist/config.d.ts +48 -45
  36. package/dist/config.js +6 -123
  37. package/dist/coverage.d.ts +82 -79
  38. package/dist/coverage.js +19 -469
  39. package/dist/environments.d.ts +11 -11
  40. package/dist/execute.d.ts +109 -109
  41. package/dist/execute.js +1 -1
  42. package/dist/index.d.ts +414 -412
  43. package/dist/index.js +4 -4
  44. package/dist/node.d.ts +51 -48
  45. package/dist/node.js +13 -10
  46. package/dist/reporters.d.ts +7 -4
  47. package/dist/reporters.js +3 -2
  48. package/dist/runners.d.ts +28 -28
  49. package/dist/runners.js +3 -4
  50. package/dist/snapshot.d.ts +2 -2
  51. package/dist/suite.d.ts +2 -2
  52. package/dist/suite.js +1 -1
  53. package/dist/workers/forks.js +2 -2
  54. package/dist/workers/runVmTests.js +9 -9
  55. package/dist/workers/threads.js +2 -2
  56. package/dist/workers/vmForks.js +2 -2
  57. package/dist/workers/vmThreads.js +2 -2
  58. package/dist/workers.d.ts +13 -13
  59. package/dist/workers.js +3 -3
  60. package/package.json +12 -12
  61. package/dist/chunks/config.BRtC-JeT.d.ts +0 -215
  62. package/dist/chunks/environment.d8YfPkTm.d.ts +0 -173
  63. package/dist/chunks/global.CnI8_G5V.d.ts +0 -133
  64. package/dist/chunks/reporters.QZ837uWx.d.ts +0 -3051
  65. package/dist/chunks/spy.Cf_4R5Oe.js +0 -22
  66. package/dist/chunks/vite.vM3UZq1q.d.ts +0 -11
@@ -1,8 +1,8 @@
1
1
  import { performance } from 'node:perf_hooks';
2
2
  import { startTests, collectTests } from '@vitest/runner';
3
- import { a as resolveSnapshotEnvironment, s as setupChaiConfig, r as resolveTestRunner } from './index.BmFFzXX_.js';
4
- import { s as startCoverageInsideWorker, a as stopCoverageInsideWorker } from './coverage.DnNIv-kJ.js';
5
- import { a as globalExpect, v as vi } from './vi.DT3m61kS.js';
3
+ import { a as resolveSnapshotEnvironment, s as setupChaiConfig, r as resolveTestRunner } from './index.uXkkC4xl.js';
4
+ import { c as setupCommonEnv, s as startCoverageInsideWorker, a as stopCoverageInsideWorker } from './setup-common.CPvtqi8q.js';
5
+ import { a as globalExpect, v as vi } from './vi.nSCvwQ7l.js';
6
6
  import { c as closeInspector } from './inspector.DKLceBVD.js';
7
7
  import { createRequire } from 'node:module';
8
8
  import timers from 'node:timers';
@@ -11,8 +11,7 @@ import util from 'node:util';
11
11
  import { getSafeTimers } from '@vitest/utils';
12
12
  import { KNOWN_ASSET_TYPES } from 'vite-node/constants';
13
13
  import { installSourcemapsSupport } from 'vite-node/source-map';
14
- import { V as VitestIndex } from './index.B8haHJlQ.js';
15
- import { s as setupCommonEnv } from './setup-common.wObu9a36.js';
14
+ import { V as VitestIndex } from './index.D7Ny8f_s.js';
16
15
  import { g as getWorkerState, r as resetModules } from './utils.C8RiOc4B.js';
17
16
  import 'chai';
18
17
  import 'node:path';
@@ -20,16 +19,17 @@ import '../path.js';
20
19
  import 'node:url';
21
20
  import './rpc.TVf73xOu.js';
22
21
  import './index.68735LiX.js';
22
+ import './coverage.A3sS5-Wm.js';
23
+ import '@vitest/snapshot';
24
+ import './run-once.2ogXb3JV.js';
23
25
  import '@vitest/expect';
24
26
  import '@vitest/runner/utils';
25
27
  import './_commonjsHelpers.BFTU3MAI.js';
26
- import '@vitest/snapshot';
27
28
  import '@vitest/utils/error';
29
+ import '@vitest/spy';
28
30
  import '@vitest/utils/source-map';
29
31
  import './date.W2xKR2qe.js';
30
- import '@vitest/spy';
31
- import './run-once.2ogXb3JV.js';
32
- import './benchmark.Cdu9hjj4.js';
32
+ import './benchmark.DL72EVN-.js';
33
33
  import 'expect-type';
34
34
 
35
35
  let globalSetup = false;
@@ -1,7 +1,30 @@
1
+ import { r as resolveCoverageProviderModule } from './coverage.A3sS5-Wm.js';
1
2
  import { addSerializer } from '@vitest/snapshot';
2
3
  import { setSafeTimers } from '@vitest/utils';
3
4
  import { r as resetRunOnceCounter } from './run-once.2ogXb3JV.js';
4
5
 
6
+ async function startCoverageInsideWorker(options, loader, runtimeOptions) {
7
+ const coverageModule = await resolveCoverageProviderModule(options, loader);
8
+ if (coverageModule) {
9
+ return coverageModule.startCoverage?.(runtimeOptions);
10
+ }
11
+ return null;
12
+ }
13
+ async function takeCoverageInsideWorker(options, loader) {
14
+ const coverageModule = await resolveCoverageProviderModule(options, loader);
15
+ if (coverageModule) {
16
+ return coverageModule.takeCoverage?.({ moduleExecutionInfo: loader.moduleExecutionInfo });
17
+ }
18
+ return null;
19
+ }
20
+ async function stopCoverageInsideWorker(options, loader, runtimeOptions) {
21
+ const coverageModule = await resolveCoverageProviderModule(options, loader);
22
+ if (coverageModule) {
23
+ return coverageModule.stopCoverage?.(runtimeOptions);
24
+ }
25
+ return null;
26
+ }
27
+
5
28
  let globalSetup = false;
6
29
  async function setupCommonEnv(config) {
7
30
  resetRunOnceCounter();
@@ -13,7 +36,7 @@ async function setupCommonEnv(config) {
13
36
  globalSetup = true;
14
37
  setSafeTimers();
15
38
  if (config.globals) {
16
- (await import('./globals.BCtI_nQG.js')).registerApiGlobally();
39
+ (await import('./globals.BEpDe-k3.js')).registerApiGlobally();
17
40
  }
18
41
  }
19
42
  function setupDefines(defines) {
@@ -70,4 +93,4 @@ async function loadSnapshotSerializers(config, executor) {
70
93
  snapshotSerializers.forEach((serializer) => addSerializer(serializer));
71
94
  }
72
95
 
73
- export { loadSnapshotSerializers as a, loadDiffConfig as l, setupCommonEnv as s };
96
+ export { stopCoverageInsideWorker as a, loadSnapshotSerializers as b, setupCommonEnv as c, loadDiffConfig as l, startCoverageInsideWorker as s, takeCoverageInsideWorker as t };
@@ -1,5 +1,5 @@
1
1
  import { Test } from '@vitest/runner';
2
- import { c as BenchmarkAPI, a as BenchFunction } from './benchmark.CFFwLv-O.js';
2
+ import { c as BenchmarkAPI, a as BenchFunction } from './benchmark.d.BwvBVTda.js';
3
3
  import { Options } from 'tinybench';
4
4
  import '@vitest/runner/utils';
5
5
 
@@ -1,4 +1,3 @@
1
- import { isCI } from 'std-env';
2
1
  import { writeFile, rm } from 'node:fs/promises';
3
2
  import { performance } from 'node:perf_hooks';
4
3
  import { TraceMap, generatedPositionFor, eachMapping } from '@vitest/utils/source-map';
@@ -45,11 +44,6 @@ function convertTasksToEvents(file, onTask) {
45
44
  return { packs, events };
46
45
  }
47
46
 
48
- const isNode = typeof process < "u" && typeof process.stdout < "u" && !process.versions?.deno && !globalThis.window;
49
- const isDeno = typeof process < "u" && typeof process.stdout < "u" && process.versions?.deno !== void 0;
50
- const isWindows = (isNode || isDeno) && process.platform === "win32";
51
- const isTTY = (isNode || isDeno) && process.stdout?.isTTY && !isCI;
52
-
53
47
  const REGEXP_WRAP_PREFIX = "$$vitest:";
54
48
  function getOutputFile(config, reporter) {
55
49
  if (!config?.outputFile) {
@@ -487,6 +481,7 @@ async function collectTests(ctx, filepath) {
487
481
  suite: latestSuite,
488
482
  file,
489
483
  mode,
484
+ timeout: 0,
490
485
  context: {},
491
486
  // not used in typecheck
492
487
  name: definition.name,
@@ -960,4 +955,4 @@ function findGeneratedPosition(traceMap, { line, column, source }) {
960
955
  return { line: null, column: null };
961
956
  }
962
957
 
963
- export { TypeCheckError as T, Typechecker as a, isWindows as b, convertTasksToEvents as c, getOutputFile as g, hasFailedSnapshot as h, isTTY as i, wrapSerializableConfig as w };
958
+ export { TypeCheckError as T, Typechecker as a, convertTasksToEvents as c, getOutputFile as g, hasFailedSnapshot as h, wrapSerializableConfig as w };
@@ -7,9 +7,9 @@ import { getSafeTimers, assertTypes, createSimpleStackTrace } from '@vitest/util
7
7
  import { g as getDefaultExportFromCjs, c as commonjsGlobal } from './_commonjsHelpers.BFTU3MAI.js';
8
8
  import { stripSnapshotIndentation, addSerializer, SnapshotClient } from '@vitest/snapshot';
9
9
  import '@vitest/utils/error';
10
+ import { fn, spyOn, mocks, isMockFunction } from '@vitest/spy';
10
11
  import { parseSingleStack } from '@vitest/utils/source-map';
11
12
  import { R as RealDate, r as resetDate, m as mockDate } from './date.W2xKR2qe.js';
12
- import { fn, spyOn, mocks, isMockFunction } from '@vitest/spy';
13
13
 
14
14
  const unsupported = [
15
15
  // .poll is meant to retry matchers until they succeed, and
@@ -90,7 +90,7 @@ function createExpectPoll(expect) {
90
90
  const rejectWithCause = (cause) => {
91
91
  reject(
92
92
  copyStackTrace$1(
93
- new Error(`Matcher did not succeed in ${timeout}ms`, {
93
+ new Error("Matcher did not succeed in time.", {
94
94
  cause
95
95
  }),
96
96
  STACK_TRACE_ERROR
@@ -3687,9 +3687,9 @@ class FakeTimers {
3687
3687
  // | _fakingTime | _fakingDate |
3688
3688
  // +-------------+-------------+
3689
3689
  // | false | falsy | initial
3690
- // | false | truethy | vi.setSystemTime called first (for mocking only Date without fake timers)
3690
+ // | false | truthy | vi.setSystemTime called first (for mocking only Date without fake timers)
3691
3691
  // | true | falsy | vi.useFakeTimers called first
3692
- // | true | truethy | unreachable
3692
+ // | true | truthy | unreachable
3693
3693
  _fakingTime;
3694
3694
  _fakingDate;
3695
3695
  _fakeTimers;
@@ -0,0 +1,11 @@
1
+ import { I as InlineConfig } from './reporters.d.CqBhtcTq.js';
2
+
3
+ type VitestInlineConfig = InlineConfig;
4
+ declare module "vite" {
5
+ interface UserConfig {
6
+ /**
7
+ * Options for Vitest
8
+ */
9
+ test?: VitestInlineConfig;
10
+ }
11
+ }
@@ -3,7 +3,7 @@ import vm, { isContext } from 'node:vm';
3
3
  import { dirname, basename, extname, normalize, join, resolve } from 'pathe';
4
4
  import { distDir } from '../path.js';
5
5
  import { createCustomConsole } from './console.CN7AiMGV.js';
6
- import { g as getDefaultRequestStubs, s as startVitestExecutor } from './execute.Bhwls1-Z.js';
6
+ import { g as getDefaultRequestStubs, s as startVitestExecutor } from './execute.eDH0aFFd.js';
7
7
  import fs from 'node:fs';
8
8
  import { dirname as dirname$1 } from 'node:path';
9
9
  import { isNodeBuiltin, isPrimitive, toArray, getCachedData, setCacheData } from 'vite-node/utils';
@@ -1,7 +1,7 @@
1
1
  import { File, TaskResultPack, TaskEventPack, CancelReason, FileSpecification, Task } from '@vitest/runner';
2
2
  import { ViteNodeResolveId, ModuleCacheMap, ModuleExecutionInfo } from 'vite-node';
3
- import { S as SerializedConfig } from './config.BRtC-JeT.js';
4
- import { T as TransformMode, U as UserConsoleLog, A as AfterSuiteRunMeta, E as Environment } from './environment.d8YfPkTm.js';
3
+ import { a as SerializedConfig } from './config.d.DevWltVl.js';
4
+ import { T as TransformMode, U as UserConsoleLog, A as AfterSuiteRunMeta, E as Environment } from './environment.d.C8UItCbf.js';
5
5
  import { SnapshotResult } from '@vitest/snapshot';
6
6
 
7
7
  type ArgumentsType<T> = T extends (...args: infer A) => any ? A : never;
@@ -79,78 +79,78 @@ type BirpcReturn<RemoteFunctions, LocalFunctions = Record<string, never>> = {
79
79
  };
80
80
 
81
81
  interface RuntimeRPC {
82
- fetch: (id: string, transformMode: TransformMode) => Promise<{
83
- externalize?: string;
84
- id?: string;
85
- }>;
86
- transform: (id: string, transformMode: TransformMode) => Promise<{
87
- code?: string;
88
- }>;
89
- resolveId: (id: string, importer: string | undefined, transformMode: TransformMode) => Promise<{
90
- external?: boolean | 'absolute' | 'relative';
91
- id: string;
92
- /** @deprecated */
93
- meta?: Record<string, any> | null;
94
- /** @deprecated */
95
- moduleSideEffects?: boolean | 'no-treeshake' | null;
96
- /** @deprecated */
97
- syntheticNamedExports?: boolean | string | null;
98
- } | null>;
99
- /**
100
- * @deprecated unused
101
- */
102
- getSourceMap: (id: string, force?: boolean) => Promise<any>;
103
- onUserConsoleLog: (log: UserConsoleLog) => void;
104
- onUnhandledError: (err: unknown, type: string) => void;
105
- onQueued: (file: File) => void;
106
- onCollected: (files: File[]) => Promise<void>;
107
- onAfterSuiteRun: (meta: AfterSuiteRunMeta) => void;
108
- onTaskUpdate: (pack: TaskResultPack[], events: TaskEventPack[]) => Promise<void>;
109
- onCancel: (reason: CancelReason) => void;
110
- getCountOfFailedTests: () => number;
111
- snapshotSaved: (snapshot: SnapshotResult) => void;
112
- resolveSnapshotPath: (testPath: string) => string;
82
+ fetch: (id: string, transformMode: TransformMode) => Promise<{
83
+ externalize?: string
84
+ id?: string
85
+ }>;
86
+ transform: (id: string, transformMode: TransformMode) => Promise<{
87
+ code?: string
88
+ }>;
89
+ resolveId: (id: string, importer: string | undefined, transformMode: TransformMode) => Promise<{
90
+ external?: boolean | "absolute" | "relative"
91
+ id: string
92
+ /** @deprecated */
93
+ meta?: Record<string, any> | null
94
+ /** @deprecated */
95
+ moduleSideEffects?: boolean | "no-treeshake" | null
96
+ /** @deprecated */
97
+ syntheticNamedExports?: boolean | string | null
98
+ } | null>;
99
+ /**
100
+ * @deprecated unused
101
+ */
102
+ getSourceMap: (id: string, force?: boolean) => Promise<any>;
103
+ onUserConsoleLog: (log: UserConsoleLog) => void;
104
+ onUnhandledError: (err: unknown, type: string) => void;
105
+ onQueued: (file: File) => void;
106
+ onCollected: (files: File[]) => Promise<void>;
107
+ onAfterSuiteRun: (meta: AfterSuiteRunMeta) => void;
108
+ onTaskUpdate: (pack: TaskResultPack[], events: TaskEventPack[]) => Promise<void>;
109
+ onCancel: (reason: CancelReason) => void;
110
+ getCountOfFailedTests: () => number;
111
+ snapshotSaved: (snapshot: SnapshotResult) => void;
112
+ resolveSnapshotPath: (testPath: string) => string;
113
113
  }
114
114
  interface RunnerRPC {
115
- onCancel: (reason: CancelReason) => void;
115
+ onCancel: (reason: CancelReason) => void;
116
116
  }
117
117
 
118
118
  /** @deprecated unused */
119
119
  type ResolveIdFunction = (id: string, importer?: string) => Promise<ViteNodeResolveId | null>;
120
120
  type WorkerRPC = BirpcReturn<RuntimeRPC, RunnerRPC>;
121
121
  interface ContextTestEnvironment {
122
- name: string;
123
- transformMode?: TransformMode;
124
- options: Record<string, any> | null;
122
+ name: string;
123
+ transformMode?: TransformMode;
124
+ options: Record<string, any> | null;
125
125
  }
126
126
  interface ContextRPC {
127
- pool: string;
128
- worker: string;
129
- workerId: number;
130
- config: SerializedConfig;
131
- projectName: string;
132
- files: string[] | FileSpecification[];
133
- environment: ContextTestEnvironment;
134
- providedContext: Record<string, any>;
135
- invalidates?: string[];
127
+ pool: string;
128
+ worker: string;
129
+ workerId: number;
130
+ config: SerializedConfig;
131
+ projectName: string;
132
+ files: string[] | FileSpecification[];
133
+ environment: ContextTestEnvironment;
134
+ providedContext: Record<string, any>;
135
+ invalidates?: string[];
136
136
  }
137
137
  interface WorkerGlobalState {
138
- ctx: ContextRPC;
139
- config: SerializedConfig;
140
- rpc: WorkerRPC;
141
- current?: Task;
142
- filepath?: string;
143
- environment: Environment;
144
- environmentTeardownRun?: boolean;
145
- onCancel: Promise<CancelReason>;
146
- moduleCache: ModuleCacheMap;
147
- moduleExecutionInfo?: ModuleExecutionInfo;
148
- providedContext: Record<string, any>;
149
- durations: {
150
- environment: number;
151
- prepare: number;
152
- };
153
- onFilterStackTrace?: (trace: string) => string;
138
+ ctx: ContextRPC;
139
+ config: SerializedConfig;
140
+ rpc: WorkerRPC;
141
+ current?: Task;
142
+ filepath?: string;
143
+ environment: Environment;
144
+ environmentTeardownRun?: boolean;
145
+ onCancel: Promise<CancelReason>;
146
+ moduleCache: ModuleCacheMap;
147
+ moduleExecutionInfo?: ModuleExecutionInfo;
148
+ providedContext: Record<string, any>;
149
+ durations: {
150
+ environment: number
151
+ prepare: number
152
+ };
153
+ onFilterStackTrace?: (trace: string) => string;
154
154
  }
155
155
 
156
156
  export type { BirpcOptions as B, ContextRPC as C, RuntimeRPC as R, WorkerGlobalState as W, BirpcReturn as a, WorkerRPC as b, RunnerRPC as c, ContextTestEnvironment as d, ResolveIdFunction as e };
@@ -1,8 +1,8 @@
1
1
  import { MessagePort } from 'node:worker_threads';
2
- import { C as ContextRPC } from './worker.DaAIyCKm.js';
2
+ import { C as ContextRPC } from './worker.d.C58isfFm.js';
3
3
 
4
4
  interface WorkerContext extends ContextRPC {
5
- port: MessagePort;
5
+ port: MessagePort;
6
6
  }
7
7
 
8
8
  export type { WorkerContext as W };
package/dist/cli.js CHANGED
@@ -1,8 +1,8 @@
1
- import { c as createCLI } from './chunks/cac.87F_onld.js';
1
+ import { c as createCLI } from './chunks/cac.CeVHgzve.js';
2
2
  import '@vitest/utils';
3
3
  import 'events';
4
4
  import 'pathe';
5
5
  import 'tinyrainbow';
6
- import './chunks/constants.fzPh7AOq.js';
6
+ import './chunks/constants.DTYd6dNH.js';
7
7
 
8
8
  createCLI().parse();
package/dist/config.d.ts CHANGED
@@ -1,22 +1,25 @@
1
1
  import { UserConfig as UserConfig$1, ConfigEnv } from 'vite';
2
2
  export { ConfigEnv, Plugin, UserConfig as ViteUserConfig, mergeConfig } from 'vite';
3
- import { d as CoverageV8Options, R as ResolvedCoverageOptions, U as UserWorkspaceConfig, e as UserProjectConfigFn, f as UserProjectConfigExport, T as TestProjectConfiguration } from './chunks/reporters.QZ837uWx.js';
4
- export { W as WorkspaceProjectConfiguration } from './chunks/reporters.QZ837uWx.js';
5
- import './chunks/vite.vM3UZq1q.js';
6
- import { F as FakeTimerInstallOpts } from './chunks/config.BRtC-JeT.js';
3
+ import { b as CoverageV8Options, R as ResolvedCoverageOptions, U as UserWorkspaceConfig, c as UserProjectConfigFn, d as UserProjectConfigExport, T as TestProjectConfiguration } from './chunks/reporters.d.CqBhtcTq.js';
4
+ export { W as WorkspaceProjectConfiguration } from './chunks/reporters.d.CqBhtcTq.js';
5
+ import './chunks/vite.d.BUZTGxQ3.js';
6
+ import { F as FakeTimerInstallOpts } from './chunks/config.d.DevWltVl.js';
7
7
  import '@vitest/runner';
8
- import './chunks/environment.d8YfPkTm.js';
8
+ import './chunks/environment.d.C8UItCbf.js';
9
9
  import '@vitest/utils';
10
10
  import 'node:stream';
11
+ import 'node:console';
11
12
  import '@vitest/utils/source-map';
12
13
  import '@vitest/pretty-format';
13
14
  import '@vitest/snapshot';
14
15
  import '@vitest/utils/diff';
15
16
  import 'vite-node';
16
17
  import 'chai';
17
- import './chunks/benchmark.CFFwLv-O.js';
18
+ import './chunks/benchmark.d.BwvBVTda.js';
18
19
  import '@vitest/runner/utils';
19
20
  import 'tinybench';
21
+ import './chunks/coverage.d.S9RMNXIe.js';
22
+ import 'vite-node/client';
20
23
  import '@vitest/snapshot/manager';
21
24
  import 'node:fs';
22
25
  import '@vitest/snapshot/environment';
@@ -28,48 +31,48 @@ declare const defaultInclude: string[];
28
31
  declare const defaultExclude: string[];
29
32
  declare const coverageConfigDefaults: ResolvedCoverageOptions;
30
33
  declare const configDefaults: Readonly<{
31
- allowOnly: boolean;
32
- isolate: boolean;
33
- watch: boolean;
34
- globals: boolean;
35
- environment: 'node';
36
- pool: 'forks';
37
- clearMocks: boolean;
38
- restoreMocks: boolean;
39
- mockReset: boolean;
40
- unstubGlobals: boolean;
41
- unstubEnvs: boolean;
42
- include: string[];
43
- exclude: string[];
44
- teardownTimeout: number;
45
- forceRerunTriggers: string[];
46
- update: boolean;
47
- reporters: never[];
48
- silent: boolean;
49
- hideSkippedTests: boolean;
50
- api: boolean;
51
- ui: boolean;
52
- uiBase: string;
53
- open: boolean;
54
- css: {
55
- include: never[];
56
- };
57
- coverage: CoverageV8Options;
58
- fakeTimers: FakeTimerInstallOpts;
59
- maxConcurrency: number;
60
- dangerouslyIgnoreUnhandledErrors: boolean;
61
- typecheck: {
62
- checker: 'tsc';
63
- include: string[];
64
- exclude: string[];
65
- };
66
- slowTestThreshold: number;
67
- disableConsoleIntercept: boolean;
34
+ allowOnly: boolean
35
+ isolate: boolean
36
+ watch: boolean
37
+ globals: boolean
38
+ environment: "node"
39
+ pool: "forks"
40
+ clearMocks: boolean
41
+ restoreMocks: boolean
42
+ mockReset: boolean
43
+ unstubGlobals: boolean
44
+ unstubEnvs: boolean
45
+ include: string[]
46
+ exclude: string[]
47
+ teardownTimeout: number
48
+ forceRerunTriggers: string[]
49
+ update: boolean
50
+ reporters: never[]
51
+ silent: boolean
52
+ hideSkippedTests: boolean
53
+ api: boolean
54
+ ui: boolean
55
+ uiBase: string
56
+ open: boolean
57
+ css: {
58
+ include: never[]
59
+ }
60
+ coverage: CoverageV8Options
61
+ fakeTimers: FakeTimerInstallOpts
62
+ maxConcurrency: number
63
+ dangerouslyIgnoreUnhandledErrors: boolean
64
+ typecheck: {
65
+ checker: "tsc"
66
+ include: string[]
67
+ exclude: string[]
68
+ }
69
+ slowTestThreshold: number
70
+ disableConsoleIntercept: boolean
68
71
  }>;
69
72
 
70
73
  /**
71
- * @deprecated Use `ViteUserConfig` instead
72
- */
74
+ * @deprecated Use `ViteUserConfig` instead
75
+ */
73
76
  type UserConfig = UserConfig$1;
74
77
 
75
78
  type UserConfigFnObject = (env: ConfigEnv) => UserConfig$1;
package/dist/config.js CHANGED
@@ -1,126 +1,9 @@
1
- import os from 'node:os';
2
- import { isCI } from 'std-env';
1
+ export { d as defaultBrowserPort, e as extraInlineDeps } from './chunks/constants.DTYd6dNH.js';
2
+ export { c as configDefaults, a as coverageConfigDefaults, d as defaultExclude, b as defaultInclude } from './chunks/defaults.C2Ndd9wx.js';
3
3
  export { mergeConfig } from 'vite';
4
-
5
- const defaultBrowserPort = 63315;
6
- const extraInlineDeps = [
7
- /^(?!.*node_modules).*\.mjs$/,
8
- /^(?!.*node_modules).*\.cjs\.js$/,
9
- // Vite client
10
- /vite\w*\/dist\/client\/env.mjs/
11
- ];
12
-
13
- const isNode = typeof process < "u" && typeof process.stdout < "u" && !process.versions?.deno && !globalThis.window;
14
- const isDeno = typeof process < "u" && typeof process.stdout < "u" && process.versions?.deno !== void 0;
15
- (isNode || isDeno) && process.platform === "win32";
16
- (isNode || isDeno) && process.stdout?.isTTY && !isCI;
17
-
18
- const defaultInclude = ["**/*.{test,spec}.?(c|m)[jt]s?(x)"];
19
- const defaultExclude = [
20
- "**/node_modules/**",
21
- "**/dist/**",
22
- "**/cypress/**",
23
- "**/.{idea,git,cache,output,temp}/**",
24
- "**/{karma,rollup,webpack,vite,vitest,jest,ava,babel,nyc,cypress,tsup,build,eslint,prettier}.config.*"
25
- ];
26
- const defaultCoverageExcludes = [
27
- "coverage/**",
28
- "dist/**",
29
- "**/node_modules/**",
30
- "**/[.]**",
31
- "packages/*/test?(s)/**",
32
- "**/*.d.ts",
33
- "**/virtual:*",
34
- "**/__x00__*",
35
- "**/\0*",
36
- "cypress/**",
37
- "test?(s)/**",
38
- "test?(-*).?(c|m)[jt]s?(x)",
39
- "**/*{.,-}{test,spec,bench,benchmark}?(-d).?(c|m)[jt]s?(x)",
40
- "**/__tests__/**",
41
- "**/{karma,rollup,webpack,vite,vitest,jest,ava,babel,nyc,cypress,tsup,build,eslint,prettier}.config.*",
42
- "**/vitest.{workspace,projects}.[jt]s?(on)",
43
- "**/.{eslint,mocha,prettier}rc.{?(c|m)js,yml}"
44
- ];
45
- const coverageConfigDefaults = {
46
- provider: "v8",
47
- enabled: false,
48
- all: true,
49
- clean: true,
50
- cleanOnRerun: true,
51
- reportsDirectory: "./coverage",
52
- exclude: defaultCoverageExcludes,
53
- reportOnFailure: false,
54
- reporter: [
55
- ["text", {}],
56
- ["html", {}],
57
- ["clover", {}],
58
- ["json", {}]
59
- ],
60
- extension: [
61
- ".js",
62
- ".cjs",
63
- ".mjs",
64
- ".ts",
65
- ".mts",
66
- ".tsx",
67
- ".jsx",
68
- ".vue",
69
- ".svelte",
70
- ".marko",
71
- ".astro"
72
- ],
73
- allowExternal: false,
74
- excludeAfterRemap: false,
75
- ignoreEmptyLines: true,
76
- processingConcurrency: Math.min(
77
- 20,
78
- os.availableParallelism?.() ?? os.cpus().length
79
- )
80
- };
81
- const fakeTimersDefaults = {
82
- loopLimit: 1e4,
83
- shouldClearNativeTimers: true
84
- };
85
- const configDefaults = Object.freeze({
86
- allowOnly: !isCI,
87
- isolate: true,
88
- watch: !isCI,
89
- globals: false,
90
- environment: "node",
91
- pool: "forks",
92
- clearMocks: false,
93
- restoreMocks: false,
94
- mockReset: false,
95
- unstubGlobals: false,
96
- unstubEnvs: false,
97
- include: defaultInclude,
98
- exclude: defaultExclude,
99
- teardownTimeout: 1e4,
100
- forceRerunTriggers: ["**/package.json/**", "**/{vitest,vite}.config.*/**"],
101
- update: false,
102
- reporters: [],
103
- silent: false,
104
- hideSkippedTests: false,
105
- api: false,
106
- ui: false,
107
- uiBase: "/__vitest__/",
108
- open: !isCI,
109
- css: {
110
- include: []
111
- },
112
- coverage: coverageConfigDefaults,
113
- fakeTimers: fakeTimersDefaults,
114
- maxConcurrency: 5,
115
- dangerouslyIgnoreUnhandledErrors: false,
116
- typecheck: {
117
- checker: "tsc",
118
- include: ["**/*.{test,spec}-d.?(c|m)[jt]s?(x)"],
119
- exclude: defaultExclude
120
- },
121
- slowTestThreshold: 300,
122
- disableConsoleIntercept: false
123
- });
4
+ import 'node:os';
5
+ import './chunks/env.D4Lgay0q.js';
6
+ import 'std-env';
124
7
 
125
8
  function defineConfig(config) {
126
9
  return config;
@@ -132,4 +15,4 @@ function defineWorkspace(config) {
132
15
  return config;
133
16
  }
134
17
 
135
- export { configDefaults, coverageConfigDefaults, defaultBrowserPort, defaultExclude, defaultInclude, defineConfig, defineProject, defineWorkspace, extraInlineDeps };
18
+ export { defineConfig, defineProject, defineWorkspace };