vitest 3.0.8 → 3.1.0-beta.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.
- package/dist/browser.d.ts +12 -23
- package/dist/browser.js +2 -2
- package/dist/chunks/{base.XvKTsMeK.js → base.DV59CbtV.js} +1 -1
- package/dist/chunks/{benchmark.Cdu9hjj4.js → benchmark.DL72EVN-.js} +1 -1
- package/dist/chunks/{benchmark.CFFwLv-O.d.ts → benchmark.d.BwvBVTda.d.ts} +11 -11
- package/dist/chunks/{cac.VN5q-TPC.js → cac.BjmXy7OV.js} +11 -6
- package/dist/chunks/{cli-api.Dis64jtY.js → cli-api.BwkkJsRe.js} +13 -8
- package/dist/chunks/config.d.DevWltVl.d.ts +218 -0
- package/dist/chunks/{constants.fzPh7AOq.js → constants.DTYd6dNH.js} +1 -1
- package/dist/chunks/{coverage.DnNIv-kJ.js → coverage.A3sS5-Wm.js} +1 -29
- package/dist/chunks/coverage.d.S9RMNXIe.d.ts +35 -0
- package/dist/chunks/{resolveConfig.L1_HR0_0.js → coverage.gV8doR2Y.js} +496 -127
- package/dist/chunks/{creator.2CFRE1Yx.js → creator.BsBnpTzI.js} +1 -1
- package/dist/chunks/defaults.C2Ndd9wx.js +119 -0
- package/dist/chunks/env.D4Lgay0q.js +8 -0
- package/dist/chunks/environment.d.C8UItCbf.d.ts +170 -0
- package/dist/chunks/global.d.Cg2sEPIm.d.ts +127 -0
- package/dist/chunks/{globals.CydvVTgC.js → globals.BEpDe-k3.js} +4 -4
- package/dist/chunks/{index.CNRemkXW.js → index.D7Ny8f_s.js} +2 -2
- package/dist/chunks/{index.B7vJpkTD.js → index.DOyx6FYJ.js} +48 -18
- package/dist/chunks/{index.BmFgJtkv.js → index.uXkkC4xl.js} +1 -2
- package/dist/chunks/{mocker.cRtM890J.d.ts → mocker.d.BE_2ls6u.d.ts} +6 -6
- package/dist/chunks/reporters.d.r7poTZjA.d.ts +3012 -0
- package/dist/chunks/{runBaseTests.DnaAUBKD.js → runBaseTests.BVrL_ow3.js} +8 -8
- package/dist/chunks/{setup-common.Uaw6Zgv9.js → setup-common.CPvtqi8q.js} +25 -2
- package/dist/chunks/{suite.qtkXWc6R.d.ts → suite.d.FvehnV49.d.ts} +1 -1
- package/dist/chunks/{typechecker.cZ0LjdSi.js → typechecker.BlF3eHsb.js} +2 -7
- package/dist/chunks/{vi.B5EKKJdE.js → vi.nSCvwQ7l.js} +3 -3
- package/dist/chunks/vite.d.Fvq-NZoa.d.ts +11 -0
- package/dist/chunks/{worker.BmVno_ab.d.ts → worker.d.C58isfFm.d.ts} +62 -62
- package/dist/chunks/{worker.BT4v-DKx.d.ts → worker.d.CSFlSYJg.d.ts} +2 -2
- package/dist/cli.js +2 -2
- package/dist/config.d.ts +48 -45
- package/dist/config.js +6 -123
- package/dist/coverage.d.ts +82 -79
- package/dist/coverage.js +19 -469
- package/dist/environments.d.ts +11 -11
- package/dist/execute.d.ts +109 -109
- package/dist/index.d.ts +414 -412
- package/dist/index.js +3 -3
- package/dist/node.d.ts +51 -48
- package/dist/node.js +13 -10
- package/dist/reporters.d.ts +7 -4
- package/dist/reporters.js +3 -2
- package/dist/runners.d.ts +28 -28
- package/dist/runners.js +2 -3
- package/dist/snapshot.d.ts +2 -2
- package/dist/suite.d.ts +2 -2
- package/dist/suite.js +1 -1
- package/dist/workers/forks.js +1 -1
- package/dist/workers/runVmTests.js +8 -8
- package/dist/workers/threads.js +1 -1
- package/dist/workers.d.ts +13 -13
- package/dist/workers.js +1 -1
- package/package.json +11 -11
- package/dist/chunks/config.BCv-fVdT.d.ts +0 -215
- package/dist/chunks/environment.d8YfPkTm.d.ts +0 -173
- package/dist/chunks/global.CnI8_G5V.d.ts +0 -133
- package/dist/chunks/reporters.66aFHiyX.d.ts +0 -3051
- package/dist/chunks/vite.BCQa3xFG.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.
|
|
4
|
-
import { s as startCoverageInsideWorker, a as stopCoverageInsideWorker } from './
|
|
5
|
-
import { a as globalExpect, v as vi } from './vi.
|
|
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.
|
|
15
|
-
import { s as setupCommonEnv } from './setup-common.Uaw6Zgv9.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';
|
|
28
29
|
import '@vitest/spy';
|
|
29
30
|
import '@vitest/utils/source-map';
|
|
30
31
|
import './date.W2xKR2qe.js';
|
|
31
|
-
import './
|
|
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.
|
|
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 {
|
|
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.
|
|
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,
|
|
958
|
+
export { TypeCheckError as T, Typechecker as a, convertTasksToEvents as c, getOutputFile as g, hasFailedSnapshot as h, wrapSerializableConfig as w };
|
|
@@ -90,7 +90,7 @@ function createExpectPoll(expect) {
|
|
|
90
90
|
const rejectWithCause = (cause) => {
|
|
91
91
|
reject(
|
|
92
92
|
copyStackTrace$1(
|
|
93
|
-
new Error(
|
|
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 |
|
|
3690
|
+
// | false | truthy | vi.setSystemTime called first (for mocking only Date without fake timers)
|
|
3691
3691
|
// | true | falsy | vi.useFakeTimers called first
|
|
3692
|
-
// | true |
|
|
3692
|
+
// | true | truthy | unreachable
|
|
3693
3693
|
_fakingTime;
|
|
3694
3694
|
_fakingDate;
|
|
3695
3695
|
_fakeTimers;
|
|
@@ -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 { a as SerializedConfig } from './config.
|
|
4
|
-
import { T as TransformMode, U as UserConsoleLog, A as AfterSuiteRunMeta, E as Environment } from './environment.
|
|
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
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
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
|
-
|
|
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
|
-
|
|
123
|
-
|
|
124
|
-
|
|
122
|
+
name: string;
|
|
123
|
+
transformMode?: TransformMode;
|
|
124
|
+
options: Record<string, any> | null;
|
|
125
125
|
}
|
|
126
126
|
interface ContextRPC {
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
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
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
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.
|
|
2
|
+
import { C as ContextRPC } from './worker.d.C58isfFm.js';
|
|
3
3
|
|
|
4
4
|
interface WorkerContext extends ContextRPC {
|
|
5
|
-
|
|
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.
|
|
1
|
+
import { c as createCLI } from './chunks/cac.BjmXy7OV.js';
|
|
2
2
|
import '@vitest/utils';
|
|
3
3
|
import 'events';
|
|
4
4
|
import 'pathe';
|
|
5
5
|
import 'tinyrainbow';
|
|
6
|
-
import './chunks/constants.
|
|
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 {
|
|
4
|
-
export { W as WorkspaceProjectConfiguration } from './chunks/reporters.
|
|
5
|
-
import './chunks/vite.
|
|
6
|
-
import { F as FakeTimerInstallOpts } from './chunks/config.
|
|
3
|
+
import { b as CoverageV8Options, R as ResolvedCoverageOptions, U as UserWorkspaceConfig, c as UserProjectConfigFn, d as UserProjectConfigExport, T as TestProjectConfiguration } from './chunks/reporters.d.r7poTZjA.js';
|
|
4
|
+
export { W as WorkspaceProjectConfiguration } from './chunks/reporters.d.r7poTZjA.js';
|
|
5
|
+
import './chunks/vite.d.Fvq-NZoa.js';
|
|
6
|
+
import { F as FakeTimerInstallOpts } from './chunks/config.d.DevWltVl.js';
|
|
7
7
|
import '@vitest/runner';
|
|
8
|
-
import './chunks/environment.
|
|
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.
|
|
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
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
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
|
-
|
|
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
|
-
|
|
2
|
-
|
|
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
|
-
|
|
6
|
-
|
|
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 {
|
|
18
|
+
export { defineConfig, defineProject, defineWorkspace };
|