vitest 5.0.0-beta.6 → 5.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/LICENSE.md +165 -1
- package/dist/browser.d.ts +27 -14
- package/dist/browser.js +11 -14
- package/dist/chunks/{artifact.BNnEI1sJ.js → artifact.DC5WoEgy.js} +1305 -8
- package/dist/chunks/{base.BKfXyFN7.js → base.B0fUxpj9.js} +17 -13
- package/dist/chunks/{browser.d.DoM6vBOs.d.ts → browser.d.BFOby8YL.d.ts} +3 -3
- package/dist/chunks/{cac.DKrA6qEB.js → cac.B41kXwyU.js} +20 -22
- package/dist/chunks/check.Cz_-YojU.js +15 -0
- package/dist/chunks/cli-api.bqNN5viV.js +519 -0
- package/dist/chunks/{config.d.CKWK3nld.d.ts → config.d.DsC1jkby.d.ts} +871 -25
- package/dist/chunks/{console.DjVIMaXT.js → console.omGxyKMT.js} +5 -5
- package/dist/chunks/{coverage.CTzCuANN.js → coverage.BVb1JqW7.js} +7 -2
- package/dist/chunks/coverage.BfSEMtie.js +26 -0
- package/dist/chunks/coverage.d.ByaAMV4A.d.ts +88 -0
- package/dist/chunks/{creator.C4nK7Krt.js → creator.BzMFaPC-.js} +53 -29
- package/dist/chunks/{defaults.B_pFOTYy.js → defaults.BJUmAuaO.js} +2 -1
- package/dist/chunks/display.CYwyMF4S.js +192 -0
- package/dist/chunks/{env.BKKtU2WC.js → env.DzFJjrmK.js} +1 -1
- package/dist/chunks/{environment.d.CrsxCzP1.d.ts → environment.d.4-rzQgpt.d.ts} +1 -1
- package/dist/chunks/globals.sd6Qutmc.js +28 -0
- package/dist/chunks/{cli-api.cZcvaUFI.js → index.5krd73UD.js} +15958 -14627
- package/dist/chunks/{index.D6NDM5O1.js → index.CLtI1k_4.js} +135 -101
- package/dist/chunks/{index.DNRmy2jU.js → index.DxR-nMjO.js} +42 -4
- package/dist/chunks/index.DzTmMrSM.js +940 -0
- package/dist/chunks/{index.B4UTDegh.js → index.JaztIWgW.js} +5 -4
- package/dist/chunks/{init-forks.BG4bCDny.js → init-forks.CXzT841o.js} +1 -1
- package/dist/chunks/{init-threads.DLtIP5Qq.js → init-threads.Ch-Bw5j3.js} +1 -1
- package/dist/chunks/{init.DTAQFCjl.js → init.CfiYZpFg.js} +40 -24
- package/dist/chunks/{native.DPzPHdi5.js → native.BUCvPRKp.js} +3 -4
- package/dist/chunks/{nativeModuleMocker.BKtCThoO.js → nativeModuleMocker.Uot80PXb.js} +2 -3
- package/dist/chunks/{index.CesbTg1C.js → nativeModuleRunner.BDnwGb8g.js} +39 -3
- package/dist/chunks/{node.C9I1sbE9.js → node.BPMnm_Q2.js} +1 -1
- package/dist/chunks/offset.Dy-5Fdfn.js +24 -0
- package/dist/chunks/pathe.M-eThtNZ.CbK_Vbae.js +489 -0
- package/dist/chunks/{plugin.d.Bpge8Jye.d.ts → plugin.d.BOjbmxWW.d.ts} +1719 -1549
- package/dist/chunks/{plugins.DrsmdUE2.js → plugins.CsoX-42X.js} +1 -1
- package/dist/chunks/resolver.CERfsKE-.js +48 -0
- package/dist/chunks/{rpc.d.C6-dGZ2f.d.ts → rpc.d.BeasqWpO.d.ts} +14 -1
- package/dist/chunks/{rpc.DZEh5xnQ.js → rpc.iNjF664v.js} +2 -2
- package/dist/chunks/setup-common.vxjAyUtK.js +36 -0
- package/dist/chunks/setup.DasACXvo.js +5409 -0
- package/dist/chunks/source-map.DZdIqpIJ.js +1776 -0
- package/dist/chunks/spy.B8mHA9qu.js +422 -0
- package/dist/chunks/{task-utils.d.mMDXJF_I.d.ts → task-utils.d.BKHiHxSN.d.ts} +1 -2
- package/dist/chunks/tinyrainbow.Ht9iggcq.js +95 -0
- package/dist/chunks/{utils.DKODp04v.js → utils.CO-iLyCr.js} +41 -42
- package/dist/chunks/{vm.CeHWcIrU.js → vm.DoQh8CN9.js} +110 -11
- package/dist/chunks/{worker.d.JES7ffPK.d.ts → worker.d.s_RdeZtI.d.ts} +14 -11
- package/dist/cli.js +4 -5
- package/dist/config.cjs +1 -0
- package/dist/config.d.ts +19 -17
- package/dist/config.js +2 -2
- package/dist/index.d.ts +14 -29
- package/dist/index.js +11 -16
- package/dist/module-evaluator.d.ts +40 -8
- package/dist/module-evaluator.js +66 -22
- package/dist/node.d.ts +210 -82
- package/dist/node.js +29 -66
- package/dist/runtime.d.ts +5 -10
- package/dist/runtime.js +4 -5
- package/dist/spy.js +1 -1
- package/dist/task-utils.js +1 -2
- package/dist/worker.d.ts +5 -10
- package/dist/worker.js +24 -36
- package/dist/workers/forks.js +21 -33
- package/dist/workers/runVmTests.js +15 -20
- package/dist/workers/threads.js +21 -33
- package/dist/workers/vmForks.js +13 -15
- package/dist/workers/vmThreads.js +13 -15
- package/package.json +15 -15
- package/dist/chunks/_commonjsHelpers.D26ty3Ew.js +0 -6
- package/dist/chunks/coverage.d.CCNrKR65.d.ts +0 -43
- package/dist/chunks/globals.CzUA1xn8.js +0 -33
- package/dist/chunks/index.Djaij2xr.js +0 -6960
- package/dist/chunks/nativeModuleRunner.WlMdOB52.js +0 -36
- package/dist/chunks/setup-common.ZNdeu5wa.js +0 -64
|
@@ -1,10 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { diff, printDiffOrStringify, SerializedDiffOptions } from '@vitest/utils/diff';
|
|
4
|
-
import { MockInstance } from '@vitest/spy';
|
|
5
|
-
import { Formatter } from 'tinyrainbow';
|
|
6
|
-
import { stringify } from '@vitest/utils/display';
|
|
7
|
-
import { Fn, FnOptions, BenchOptions, TaskResultCompleted, TaskResultRuntimeInfo, TaskResultTimestampProviderInfo, Statistics } from 'tinybench';
|
|
1
|
+
import { Disposable } from 'vitest/optional-runtime-types.js';
|
|
2
|
+
import { Fn, FnOptions, BenchOptions as BenchOptions$1, TaskResultCompleted, TaskResultRuntimeInfo, TaskResultTimestampProviderInfo, Statistics } from 'tinybench';
|
|
8
3
|
|
|
9
4
|
type VoidVarArgsFunc = (...args: unknown[]) => void;
|
|
10
5
|
type SetImmediate = (callback: VoidVarArgsFunc, ...args: unknown[]) => NodeImmediate;
|
|
@@ -72,7 +67,7 @@ type TimerInitialProps = {
|
|
|
72
67
|
order?: number;
|
|
73
68
|
heapIndex?: number;
|
|
74
69
|
};
|
|
75
|
-
type Config = {
|
|
70
|
+
type Config$1 = {
|
|
76
71
|
now?: number | Date | TemporalTimelike;
|
|
77
72
|
toFake?: FakeMethod[];
|
|
78
73
|
toNotFake?: FakeMethod[];
|
|
@@ -93,6 +88,241 @@ type NodeImmediate = {
|
|
|
93
88
|
unref: NodeImmediateUnref;
|
|
94
89
|
};
|
|
95
90
|
|
|
91
|
+
/**
|
|
92
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
93
|
+
*
|
|
94
|
+
* This source code is licensed under the MIT license found in the
|
|
95
|
+
* LICENSE file in the root directory of this source tree.
|
|
96
|
+
*/
|
|
97
|
+
interface Colors {
|
|
98
|
+
comment: {
|
|
99
|
+
close: string;
|
|
100
|
+
open: string;
|
|
101
|
+
};
|
|
102
|
+
content: {
|
|
103
|
+
close: string;
|
|
104
|
+
open: string;
|
|
105
|
+
};
|
|
106
|
+
prop: {
|
|
107
|
+
close: string;
|
|
108
|
+
open: string;
|
|
109
|
+
};
|
|
110
|
+
tag: {
|
|
111
|
+
close: string;
|
|
112
|
+
open: string;
|
|
113
|
+
};
|
|
114
|
+
value: {
|
|
115
|
+
close: string;
|
|
116
|
+
open: string;
|
|
117
|
+
};
|
|
118
|
+
}
|
|
119
|
+
type Indent = (arg0: string) => string;
|
|
120
|
+
type Refs = Array<unknown>;
|
|
121
|
+
type Print = (arg0: unknown) => string;
|
|
122
|
+
/**
|
|
123
|
+
* compare function used when sorting object keys, `null` can be used to skip over sorting.
|
|
124
|
+
*/
|
|
125
|
+
type CompareKeys = ((a: string, b: string) => number) | null | undefined;
|
|
126
|
+
interface PrettyFormatOptions {
|
|
127
|
+
/**
|
|
128
|
+
* Call `toJSON` on objects before formatting them.
|
|
129
|
+
* Ignored after the formatter has already called `toJSON` once for a value.
|
|
130
|
+
* @default true
|
|
131
|
+
*/
|
|
132
|
+
callToJSON?: boolean;
|
|
133
|
+
/**
|
|
134
|
+
* Whether to escape special characters in regular expressions.
|
|
135
|
+
* @default false
|
|
136
|
+
*/
|
|
137
|
+
escapeRegex?: boolean;
|
|
138
|
+
/**
|
|
139
|
+
* Whether to escape special characters in strings.
|
|
140
|
+
* @default true
|
|
141
|
+
*/
|
|
142
|
+
escapeString?: boolean;
|
|
143
|
+
/**
|
|
144
|
+
* Whether to highlight syntax using terminal colors.
|
|
145
|
+
* @default false
|
|
146
|
+
*/
|
|
147
|
+
highlight?: boolean;
|
|
148
|
+
/**
|
|
149
|
+
* Number of spaces to use for each level of indentation.
|
|
150
|
+
* @default 2
|
|
151
|
+
*/
|
|
152
|
+
indent?: number;
|
|
153
|
+
/**
|
|
154
|
+
* Maximum depth to recurse into nested values.
|
|
155
|
+
* @default Infinity
|
|
156
|
+
*/
|
|
157
|
+
maxDepth?: number;
|
|
158
|
+
/**
|
|
159
|
+
* Maximum number of items to print in arrays, sets, maps, and similar collections.
|
|
160
|
+
* @default Infinity
|
|
161
|
+
*/
|
|
162
|
+
maxWidth?: number;
|
|
163
|
+
/**
|
|
164
|
+
* Approximate per-depth-level budget for output length.
|
|
165
|
+
* When the accumulated output at any single depth level exceeds this value,
|
|
166
|
+
* further nesting is collapsed. This is a heuristic safety valve, not a hard
|
|
167
|
+
* limit — total output can reach up to roughly `maxDepth × maxOutputLength`.
|
|
168
|
+
* @default 1_000_000
|
|
169
|
+
*/
|
|
170
|
+
maxOutputLength?: number;
|
|
171
|
+
/**
|
|
172
|
+
* Whether to minimize added whitespace, including indentation and line breaks.
|
|
173
|
+
*
|
|
174
|
+
* When `true`, pretty-format defaults `spacingInner` to `' '`, `spacingOuter` to `''`,
|
|
175
|
+
* and ignores indentation. It also changes the default for `printBasicPrototype`
|
|
176
|
+
* from `true` to `false`, although an explicit `printBasicPrototype` still wins.
|
|
177
|
+
* Explicit `spacingInner` / `spacingOuter` overrides still apply.
|
|
178
|
+
* @default false
|
|
179
|
+
*/
|
|
180
|
+
min?: boolean;
|
|
181
|
+
/**
|
|
182
|
+
* Whether to print `Object` / `Array` prefixes for plain objects and arrays.
|
|
183
|
+
*
|
|
184
|
+
* Defaults to `true`, unless `min` is `true`, in which case it defaults to `false`.
|
|
185
|
+
* An explicit `printBasicPrototype` value always overrides the `min` default.
|
|
186
|
+
*/
|
|
187
|
+
printBasicPrototype?: boolean;
|
|
188
|
+
/**
|
|
189
|
+
* Whether to include the function name when formatting functions.
|
|
190
|
+
* @default true
|
|
191
|
+
*/
|
|
192
|
+
printFunctionName?: boolean;
|
|
193
|
+
/**
|
|
194
|
+
* Whether to include shadow-root contents when formatting DOM nodes.
|
|
195
|
+
* @default true
|
|
196
|
+
*/
|
|
197
|
+
printShadowRoot?: boolean;
|
|
198
|
+
/**
|
|
199
|
+
* Compare function used when sorting object keys. Set to `null` to disable sorting.
|
|
200
|
+
*/
|
|
201
|
+
compareKeys?: CompareKeys;
|
|
202
|
+
/**
|
|
203
|
+
* Plugins used to serialize application-specific data types.
|
|
204
|
+
* @default []
|
|
205
|
+
*/
|
|
206
|
+
plugins?: Plugins;
|
|
207
|
+
/**
|
|
208
|
+
* Whitespace inserted after commas between items or entries.
|
|
209
|
+
*
|
|
210
|
+
* For example, in `{a: 1, b: 2}` or `[1, 2]`, this controls the gap after each comma:
|
|
211
|
+
* `{a: 1,${spacingInner}b: 2}`
|
|
212
|
+
* `[1,${spacingInner}2]`
|
|
213
|
+
*
|
|
214
|
+
* Defaults to `'\n'` in regular mode and `' '` when `min` is `true`.
|
|
215
|
+
* Can be overridden independently of `min`.
|
|
216
|
+
*/
|
|
217
|
+
spacingInner?: string;
|
|
218
|
+
/**
|
|
219
|
+
* Whitespace inserted immediately inside collection/object delimiters.
|
|
220
|
+
*
|
|
221
|
+
* For example, this controls the space or newline right after the opening delimiter
|
|
222
|
+
* and right before the closing delimiter:
|
|
223
|
+
* `{${spacingOuter}a: 1${spacingOuter}}`
|
|
224
|
+
* `[${spacingOuter}1${spacingOuter}]`
|
|
225
|
+
*
|
|
226
|
+
* Defaults to `'\n'` in regular mode and `''` when `min` is `true`.
|
|
227
|
+
* Can be overridden independently of `min`.
|
|
228
|
+
*/
|
|
229
|
+
spacingOuter?: string;
|
|
230
|
+
/**
|
|
231
|
+
* Whether to print strings using single quotes instead of double quotes.
|
|
232
|
+
*
|
|
233
|
+
* For example:
|
|
234
|
+
* `"hello"` when `false`
|
|
235
|
+
* `'hello'` when `true`
|
|
236
|
+
*
|
|
237
|
+
* @default false
|
|
238
|
+
*/
|
|
239
|
+
singleQuote?: boolean;
|
|
240
|
+
/**
|
|
241
|
+
* Whether to always quote object property keys.
|
|
242
|
+
*
|
|
243
|
+
* For example:
|
|
244
|
+
* `{"a": 1}` when `true`
|
|
245
|
+
* `{a: 1}` when `false` and the key is a valid identifier
|
|
246
|
+
* `{"my-key": 1}` still stays quoted because it is not a valid identifier
|
|
247
|
+
*
|
|
248
|
+
* @default true
|
|
249
|
+
*/
|
|
250
|
+
quoteKeys?: boolean;
|
|
251
|
+
}
|
|
252
|
+
type OptionsReceived = PrettyFormatOptions;
|
|
253
|
+
interface Config {
|
|
254
|
+
callToJSON: boolean;
|
|
255
|
+
compareKeys: CompareKeys;
|
|
256
|
+
colors: Colors;
|
|
257
|
+
escapeRegex: boolean;
|
|
258
|
+
escapeString: boolean;
|
|
259
|
+
indent: string;
|
|
260
|
+
maxDepth: number;
|
|
261
|
+
maxWidth: number;
|
|
262
|
+
min: boolean;
|
|
263
|
+
plugins: Plugins;
|
|
264
|
+
printBasicPrototype: boolean;
|
|
265
|
+
printFunctionName: boolean;
|
|
266
|
+
printShadowRoot: boolean;
|
|
267
|
+
spacingInner: string;
|
|
268
|
+
spacingOuter: string;
|
|
269
|
+
singleQuote: boolean;
|
|
270
|
+
quoteKeys: boolean;
|
|
271
|
+
maxOutputLength: number;
|
|
272
|
+
}
|
|
273
|
+
type Printer = (val: unknown, config: Config, indentation: string, depth: number, refs: Refs, hasCalledToJSON?: boolean) => string;
|
|
274
|
+
type Test$1 = (arg0: any) => boolean;
|
|
275
|
+
interface NewPlugin {
|
|
276
|
+
serialize: (val: any, config: Config, indentation: string, depth: number, refs: Refs, printer: Printer) => string;
|
|
277
|
+
test: Test$1;
|
|
278
|
+
}
|
|
279
|
+
interface PluginOptions {
|
|
280
|
+
edgeSpacing: string;
|
|
281
|
+
min: boolean;
|
|
282
|
+
spacing: string;
|
|
283
|
+
}
|
|
284
|
+
interface OldPlugin {
|
|
285
|
+
print: (val: unknown, print: Print, indent: Indent, options: PluginOptions, colors: Colors) => string;
|
|
286
|
+
test: Test$1;
|
|
287
|
+
}
|
|
288
|
+
type Plugin = NewPlugin | OldPlugin;
|
|
289
|
+
type Plugins = Array<Plugin>;
|
|
290
|
+
|
|
291
|
+
interface StringifyOptions extends PrettyFormatOptions {
|
|
292
|
+
maxLength?: number;
|
|
293
|
+
filterNode?: string | ((node: any) => boolean);
|
|
294
|
+
}
|
|
295
|
+
declare function stringify(object: unknown, maxDepth?: number, { maxLength, filterNode, ...options }?: StringifyOptions): string;
|
|
296
|
+
declare function format(args: unknown[], options?: InspectOptions): string;
|
|
297
|
+
interface InspectOptions extends StringifyOptions {
|
|
298
|
+
truncate?: number;
|
|
299
|
+
multiline?: boolean;
|
|
300
|
+
}
|
|
301
|
+
declare function inspect(obj: unknown, options?: InspectOptions): string;
|
|
302
|
+
|
|
303
|
+
type Awaitable<T> = T | PromiseLike<T>;
|
|
304
|
+
type Arrayable<T> = T | Array<T>;
|
|
305
|
+
interface ParsedStack {
|
|
306
|
+
method: string;
|
|
307
|
+
file: string;
|
|
308
|
+
line: number;
|
|
309
|
+
column: number;
|
|
310
|
+
}
|
|
311
|
+
interface SerializedError {
|
|
312
|
+
message: string;
|
|
313
|
+
stacks?: ParsedStack[];
|
|
314
|
+
stack?: string;
|
|
315
|
+
name?: string;
|
|
316
|
+
cause?: SerializedError;
|
|
317
|
+
[key: string]: unknown;
|
|
318
|
+
}
|
|
319
|
+
interface TestError extends SerializedError {
|
|
320
|
+
cause?: TestError;
|
|
321
|
+
diff?: string;
|
|
322
|
+
actual?: string;
|
|
323
|
+
expected?: string;
|
|
324
|
+
}
|
|
325
|
+
|
|
96
326
|
interface SnapshotEnvironment {
|
|
97
327
|
getVersion: () => string;
|
|
98
328
|
getHeader: () => string;
|
|
@@ -306,6 +536,79 @@ interface RawSnapshotInfo {
|
|
|
306
536
|
content?: string;
|
|
307
537
|
}
|
|
308
538
|
|
|
539
|
+
/**
|
|
540
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
541
|
+
*
|
|
542
|
+
* This source code is licensed under the MIT license found in the
|
|
543
|
+
* LICENSE file in the root directory of this source tree.
|
|
544
|
+
*/
|
|
545
|
+
|
|
546
|
+
type DiffOptionsColor = (arg: string) => string;
|
|
547
|
+
interface DiffOptions {
|
|
548
|
+
aAnnotation?: string;
|
|
549
|
+
aColor?: DiffOptionsColor;
|
|
550
|
+
aIndicator?: string;
|
|
551
|
+
bAnnotation?: string;
|
|
552
|
+
bColor?: DiffOptionsColor;
|
|
553
|
+
bIndicator?: string;
|
|
554
|
+
changeColor?: DiffOptionsColor;
|
|
555
|
+
changeLineTrailingSpaceColor?: DiffOptionsColor;
|
|
556
|
+
commonColor?: DiffOptionsColor;
|
|
557
|
+
commonIndicator?: string;
|
|
558
|
+
commonLineTrailingSpaceColor?: DiffOptionsColor;
|
|
559
|
+
contextLines?: number;
|
|
560
|
+
emptyFirstOrLastLinePlaceholder?: string;
|
|
561
|
+
expand?: boolean;
|
|
562
|
+
includeChangeCounts?: boolean;
|
|
563
|
+
omitAnnotationLines?: boolean;
|
|
564
|
+
patchColor?: DiffOptionsColor;
|
|
565
|
+
printBasicPrototype?: boolean;
|
|
566
|
+
maxDepth?: number;
|
|
567
|
+
compareKeys?: CompareKeys;
|
|
568
|
+
truncateThreshold?: number;
|
|
569
|
+
truncateAnnotation?: string;
|
|
570
|
+
truncateAnnotationColor?: DiffOptionsColor;
|
|
571
|
+
}
|
|
572
|
+
interface SerializedDiffOptions {
|
|
573
|
+
aAnnotation?: string;
|
|
574
|
+
aIndicator?: string;
|
|
575
|
+
bAnnotation?: string;
|
|
576
|
+
bIndicator?: string;
|
|
577
|
+
commonIndicator?: string;
|
|
578
|
+
contextLines?: number;
|
|
579
|
+
emptyFirstOrLastLinePlaceholder?: string;
|
|
580
|
+
expand?: boolean;
|
|
581
|
+
includeChangeCounts?: boolean;
|
|
582
|
+
omitAnnotationLines?: boolean;
|
|
583
|
+
printBasicPrototype?: boolean;
|
|
584
|
+
maxDepth?: number;
|
|
585
|
+
truncateThreshold?: number;
|
|
586
|
+
truncateAnnotation?: string;
|
|
587
|
+
}
|
|
588
|
+
|
|
589
|
+
/**
|
|
590
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
591
|
+
*
|
|
592
|
+
* This source code is licensed under the MIT license found in the
|
|
593
|
+
* LICENSE file in the root directory of this source tree.
|
|
594
|
+
*/
|
|
595
|
+
|
|
596
|
+
interface StringifiedMemory {
|
|
597
|
+
expected?: string;
|
|
598
|
+
actual?: string;
|
|
599
|
+
}
|
|
600
|
+
interface Memorize {
|
|
601
|
+
(pointer: "expected" | "actual", stringifiedValue: string): string;
|
|
602
|
+
}
|
|
603
|
+
/**
|
|
604
|
+
* @param a Expected value
|
|
605
|
+
* @param b Received value
|
|
606
|
+
* @param options Diff options
|
|
607
|
+
* @returns {string | null} a string diff
|
|
608
|
+
*/
|
|
609
|
+
declare function diff(a: any, b: any, options?: DiffOptions, memorize?: Memorize): string | undefined;
|
|
610
|
+
declare function printDiffOrStringify(received: unknown, expected: unknown, options?: DiffOptions, memory?: StringifiedMemory): string | undefined;
|
|
611
|
+
|
|
309
612
|
interface AfterSuiteRunMeta {
|
|
310
613
|
coverage?: unknown;
|
|
311
614
|
testFiles: string[];
|
|
@@ -332,6 +635,7 @@ interface ResolveFunctionResult {
|
|
|
332
635
|
file: string;
|
|
333
636
|
url: string;
|
|
334
637
|
}
|
|
638
|
+
type ModuleType = "cjs" | "esm";
|
|
335
639
|
interface FetchCachedFileSystemResult {
|
|
336
640
|
cached: true;
|
|
337
641
|
tmp: string;
|
|
@@ -339,6 +643,7 @@ interface FetchCachedFileSystemResult {
|
|
|
339
643
|
file: string | null;
|
|
340
644
|
url: string;
|
|
341
645
|
invalidate: boolean;
|
|
646
|
+
moduleType?: ModuleType;
|
|
342
647
|
}
|
|
343
648
|
type LabelColor = "black" | "red" | "green" | "yellow" | "blue" | "magenta" | "cyan" | "white";
|
|
344
649
|
interface AsyncLeak {
|
|
@@ -348,6 +653,484 @@ interface AsyncLeak {
|
|
|
348
653
|
type: string;
|
|
349
654
|
}
|
|
350
655
|
|
|
656
|
+
interface MockResultReturn<T> {
|
|
657
|
+
type: "return";
|
|
658
|
+
/**
|
|
659
|
+
* The value that was returned from the function. If function returned a Promise, then this will be a resolved value.
|
|
660
|
+
*/
|
|
661
|
+
value: T;
|
|
662
|
+
}
|
|
663
|
+
interface MockResultIncomplete {
|
|
664
|
+
type: "incomplete";
|
|
665
|
+
value: undefined;
|
|
666
|
+
}
|
|
667
|
+
interface MockResultThrow {
|
|
668
|
+
type: "throw";
|
|
669
|
+
/**
|
|
670
|
+
* An error that was thrown during function execution.
|
|
671
|
+
*/
|
|
672
|
+
value: any;
|
|
673
|
+
}
|
|
674
|
+
interface MockSettledResultIncomplete {
|
|
675
|
+
type: "incomplete";
|
|
676
|
+
value: undefined;
|
|
677
|
+
}
|
|
678
|
+
interface MockSettledResultFulfilled<T> {
|
|
679
|
+
type: "fulfilled";
|
|
680
|
+
value: T;
|
|
681
|
+
}
|
|
682
|
+
interface MockSettledResultRejected {
|
|
683
|
+
type: "rejected";
|
|
684
|
+
value: any;
|
|
685
|
+
}
|
|
686
|
+
type MockResult<T> = MockResultReturn<T> | MockResultThrow | MockResultIncomplete;
|
|
687
|
+
type MockSettledResult<T> = MockSettledResultFulfilled<T> | MockSettledResultRejected | MockSettledResultIncomplete;
|
|
688
|
+
type MockParameters<T extends Procedure | Constructable> = T extends Constructable ? ConstructorParameters<T> : T extends Procedure ? Parameters<T> : never;
|
|
689
|
+
type MockReturnType<T extends Procedure | Constructable> = T extends Constructable ? InstanceType<T> : T extends Procedure ? ReturnType<T> : never;
|
|
690
|
+
type MockProcedureContext<T extends Procedure | Constructable> = T extends Constructable ? InstanceType<T> : ThisParameterType<T>;
|
|
691
|
+
interface MockContext<T extends Procedure | Constructable = Procedure> {
|
|
692
|
+
/**
|
|
693
|
+
* This is an array containing all arguments for each call. One item of the array is the arguments of that call.
|
|
694
|
+
*
|
|
695
|
+
* @see https://vitest.dev/api/mock#mock-calls
|
|
696
|
+
* @example
|
|
697
|
+
* const fn = vi.fn()
|
|
698
|
+
*
|
|
699
|
+
* fn('arg1', 'arg2')
|
|
700
|
+
* fn('arg3')
|
|
701
|
+
*
|
|
702
|
+
* fn.mock.calls === [
|
|
703
|
+
* ['arg1', 'arg2'], // first call
|
|
704
|
+
* ['arg3'], // second call
|
|
705
|
+
* ]
|
|
706
|
+
*/
|
|
707
|
+
calls: MockParameters<T>[];
|
|
708
|
+
/**
|
|
709
|
+
* This is an array containing all instances that were instantiated when mock was called with a `new` keyword. Note that this is an actual context (`this`) of the function, not a return value.
|
|
710
|
+
* @see https://vitest.dev/api/mock#mock-instances
|
|
711
|
+
*/
|
|
712
|
+
instances: MockProcedureContext<T>[];
|
|
713
|
+
/**
|
|
714
|
+
* An array of `this` values that were used during each call to the mock function.
|
|
715
|
+
* @see https://vitest.dev/api/mock#mock-contexts
|
|
716
|
+
*/
|
|
717
|
+
contexts: MockProcedureContext<T>[];
|
|
718
|
+
/**
|
|
719
|
+
* The order of mock's execution. This returns an array of numbers which are shared between all defined mocks.
|
|
720
|
+
*
|
|
721
|
+
* @see https://vitest.dev/api/mock#mock-invocationcallorder
|
|
722
|
+
* @example
|
|
723
|
+
* const fn1 = vi.fn()
|
|
724
|
+
* const fn2 = vi.fn()
|
|
725
|
+
*
|
|
726
|
+
* fn1()
|
|
727
|
+
* fn2()
|
|
728
|
+
* fn1()
|
|
729
|
+
*
|
|
730
|
+
* fn1.mock.invocationCallOrder === [1, 3]
|
|
731
|
+
* fn2.mock.invocationCallOrder === [2]
|
|
732
|
+
*/
|
|
733
|
+
invocationCallOrder: number[];
|
|
734
|
+
/**
|
|
735
|
+
* This is an array containing all values that were `returned` from the function.
|
|
736
|
+
*
|
|
737
|
+
* The `value` property contains the returned value or thrown error. If the function returned a `Promise`, then `result` will always be `'return'` even if the promise was rejected.
|
|
738
|
+
*
|
|
739
|
+
* @see https://vitest.dev/api/mock#mock-results
|
|
740
|
+
* @example
|
|
741
|
+
* const fn = vi.fn()
|
|
742
|
+
* .mockReturnValueOnce('result')
|
|
743
|
+
* .mockImplementationOnce(() => { throw new Error('thrown error') })
|
|
744
|
+
*
|
|
745
|
+
* const result = fn()
|
|
746
|
+
*
|
|
747
|
+
* try {
|
|
748
|
+
* fn()
|
|
749
|
+
* }
|
|
750
|
+
* catch {}
|
|
751
|
+
*
|
|
752
|
+
* fn.mock.results === [
|
|
753
|
+
* {
|
|
754
|
+
* type: 'return',
|
|
755
|
+
* value: 'result',
|
|
756
|
+
* },
|
|
757
|
+
* {
|
|
758
|
+
* type: 'throw',
|
|
759
|
+
* value: Error,
|
|
760
|
+
* },
|
|
761
|
+
* ]
|
|
762
|
+
*/
|
|
763
|
+
results: MockResult<MockReturnType<T>>[];
|
|
764
|
+
/**
|
|
765
|
+
* An array containing all values that were `resolved` or `rejected` from the function.
|
|
766
|
+
*
|
|
767
|
+
* This array will be empty if the function was never resolved or rejected.
|
|
768
|
+
*
|
|
769
|
+
* @see https://vitest.dev/api/mock#mock-settledresults
|
|
770
|
+
* @example
|
|
771
|
+
* const fn = vi.fn().mockResolvedValueOnce('result')
|
|
772
|
+
*
|
|
773
|
+
* const result = fn()
|
|
774
|
+
*
|
|
775
|
+
* fn.mock.settledResults === [
|
|
776
|
+
* {
|
|
777
|
+
* type: 'incomplete',
|
|
778
|
+
* value: undefined,
|
|
779
|
+
* }
|
|
780
|
+
* ]
|
|
781
|
+
* fn.mock.results === [
|
|
782
|
+
* {
|
|
783
|
+
* type: 'return',
|
|
784
|
+
* value: Promise<'result'>,
|
|
785
|
+
* },
|
|
786
|
+
* ]
|
|
787
|
+
*
|
|
788
|
+
* await result
|
|
789
|
+
*
|
|
790
|
+
* fn.mock.settledResults === [
|
|
791
|
+
* {
|
|
792
|
+
* type: 'fulfilled',
|
|
793
|
+
* value: 'result',
|
|
794
|
+
* },
|
|
795
|
+
* ]
|
|
796
|
+
*/
|
|
797
|
+
settledResults: MockSettledResult<Awaited<MockReturnType<T>>>[];
|
|
798
|
+
/**
|
|
799
|
+
* This contains the arguments of the last call. If spy wasn't called, will return `undefined`.
|
|
800
|
+
* @see https://vitest.dev/api/mock#mock-lastcall
|
|
801
|
+
*/
|
|
802
|
+
lastCall: MockParameters<T> | undefined;
|
|
803
|
+
}
|
|
804
|
+
type Procedure = (...args: any[]) => any;
|
|
805
|
+
type NormalizedProcedure<T extends Procedure | Constructable> = T extends Constructable ? ({
|
|
806
|
+
new (...args: ConstructorParameters<T>): InstanceType<T>;
|
|
807
|
+
}) | ({
|
|
808
|
+
(this: InstanceType<T>, ...args: ConstructorParameters<T>): void;
|
|
809
|
+
}) : T extends Procedure ? (...args: Parameters<T>) => ReturnType<T> : never;
|
|
810
|
+
type Methods<T> = keyof { [K in keyof T as T[K] extends Procedure ? K : never] : T[K] };
|
|
811
|
+
type Properties<T> = { [K in keyof T] : T[K] extends Procedure ? never : K }[keyof T] & (string | symbol);
|
|
812
|
+
type Classes<T> = { [K in keyof T] : T[K] extends new (...args: any[]) => any ? K : never }[keyof T] & (string | symbol);
|
|
813
|
+
interface MockInstance<T extends Procedure | Constructable = Procedure> extends Disposable {
|
|
814
|
+
/**
|
|
815
|
+
* Use it to return the name assigned to the mock with the `.mockName(name)` method. By default, it will return `vi.fn()`.
|
|
816
|
+
* @see https://vitest.dev/api/mock#getmockname
|
|
817
|
+
*/
|
|
818
|
+
getMockName(): string;
|
|
819
|
+
/**
|
|
820
|
+
* Sets the internal mock name. This is useful for identifying the mock when an assertion fails.
|
|
821
|
+
* @see https://vitest.dev/api/mock#mockname
|
|
822
|
+
*/
|
|
823
|
+
mockName(name: string): this;
|
|
824
|
+
/**
|
|
825
|
+
* Current context of the mock. It stores information about all invocation calls, instances, and results.
|
|
826
|
+
*/
|
|
827
|
+
mock: MockContext<T>;
|
|
828
|
+
/**
|
|
829
|
+
* Clears all information about every call. After calling it, all properties on `.mock` will return to their initial state. This method does not reset implementations. It is useful for cleaning up mocks between different assertions.
|
|
830
|
+
*
|
|
831
|
+
* To automatically call this method before each test, enable the [`clearMocks`](https://vitest.dev/config/clearmocks) setting in the configuration.
|
|
832
|
+
* @see https://vitest.dev/api/mock#mockclear
|
|
833
|
+
*/
|
|
834
|
+
mockClear(): this;
|
|
835
|
+
/**
|
|
836
|
+
* Does what `mockClear` does and resets inner implementation to the original function. This also resets all "once" implementations.
|
|
837
|
+
*
|
|
838
|
+
* Note that resetting a mock from `vi.fn()` will set implementation to an empty function that returns `undefined`.
|
|
839
|
+
* Resetting a mock from `vi.fn(impl)` will set implementation to `impl`. It is useful for completely resetting a mock to its default state.
|
|
840
|
+
*
|
|
841
|
+
* To automatically call this method before each test, enable the [`mockReset`](https://vitest.dev/config/mockreset) setting in the configuration.
|
|
842
|
+
* @see https://vitest.dev/api/mock#mockreset
|
|
843
|
+
*/
|
|
844
|
+
mockReset(): this;
|
|
845
|
+
/**
|
|
846
|
+
* Does what `mockReset` does and restores original descriptors of spied-on objects.
|
|
847
|
+
* @see https://vitest.dev/api/mock#mockrestore
|
|
848
|
+
*/
|
|
849
|
+
mockRestore(): void;
|
|
850
|
+
/**
|
|
851
|
+
* Returns current permanent mock implementation if there is one.
|
|
852
|
+
*
|
|
853
|
+
* If mock was created with `vi.fn`, it will consider passed down method as a mock implementation.
|
|
854
|
+
*
|
|
855
|
+
* If mock was created with `vi.spyOn`, it will return `undefined` unless a custom implementation was provided.
|
|
856
|
+
*/
|
|
857
|
+
getMockImplementation(): NormalizedProcedure<T> | undefined;
|
|
858
|
+
/**
|
|
859
|
+
* Accepts a function to be used as the mock implementation. TypeScript expects the arguments and return type to match those of the original function.
|
|
860
|
+
* @see https://vitest.dev/api/mock#mockimplementation
|
|
861
|
+
* @example
|
|
862
|
+
* const increment = vi.fn().mockImplementation(count => count + 1);
|
|
863
|
+
* expect(increment(3)).toBe(4);
|
|
864
|
+
*/
|
|
865
|
+
mockImplementation(fn: NormalizedProcedure<T>): this;
|
|
866
|
+
/**
|
|
867
|
+
* Accepts a function to be used as the mock implementation. TypeScript expects the arguments and return type to match those of the original function. This method can be chained to produce different results for multiple function calls.
|
|
868
|
+
*
|
|
869
|
+
* When the mocked function runs out of implementations, it will invoke the default implementation set with `vi.fn(() => defaultValue)` or `.mockImplementation(() => defaultValue)` if they were called.
|
|
870
|
+
* @see https://vitest.dev/api/mock#mockimplementationonce
|
|
871
|
+
* @example
|
|
872
|
+
* const fn = vi.fn(count => count).mockImplementationOnce(count => count + 1);
|
|
873
|
+
* expect(fn(3)).toBe(4);
|
|
874
|
+
* expect(fn(3)).toBe(3);
|
|
875
|
+
*/
|
|
876
|
+
mockImplementationOnce(fn: NormalizedProcedure<T>): this;
|
|
877
|
+
/**
|
|
878
|
+
* Overrides the original mock implementation temporarily while the callback is being executed.
|
|
879
|
+
*
|
|
880
|
+
* Note that this method takes precedence over the [`mockImplementationOnce`](https://vitest.dev/api/mock#mockimplementationonce).
|
|
881
|
+
* @see https://vitest.dev/api/mock#withimplementation
|
|
882
|
+
* @example
|
|
883
|
+
* const myMockFn = vi.fn(() => 'original')
|
|
884
|
+
*
|
|
885
|
+
* myMockFn.withImplementation(() => 'temp', () => {
|
|
886
|
+
* myMockFn() // 'temp'
|
|
887
|
+
* })
|
|
888
|
+
*
|
|
889
|
+
* myMockFn() // 'original'
|
|
890
|
+
*/
|
|
891
|
+
withImplementation(fn: NormalizedProcedure<T>, cb: () => Promise<unknown>): Promise<this>;
|
|
892
|
+
withImplementation(fn: NormalizedProcedure<T>, cb: () => unknown): this;
|
|
893
|
+
/**
|
|
894
|
+
* Use this if you need to return the `this` context from the method without invoking the actual implementation.
|
|
895
|
+
* @see https://vitest.dev/api/mock#mockreturnthis
|
|
896
|
+
*/
|
|
897
|
+
mockReturnThis(): this;
|
|
898
|
+
/**
|
|
899
|
+
* Accepts a value that will be returned whenever the mock function is called. TypeScript will only accept values that match the return type of the original function.
|
|
900
|
+
* @see https://vitest.dev/api/mock#mockreturnvalue
|
|
901
|
+
* @example
|
|
902
|
+
* const mock = vi.fn()
|
|
903
|
+
* mock.mockReturnValue(42)
|
|
904
|
+
* mock() // 42
|
|
905
|
+
* mock.mockReturnValue(43)
|
|
906
|
+
* mock() // 43
|
|
907
|
+
*/
|
|
908
|
+
mockReturnValue(value: MockReturnType<T>): this;
|
|
909
|
+
/**
|
|
910
|
+
* Accepts a value that will be returned whenever the mock function is called. TypeScript will only accept values that match the return type of the original function.
|
|
911
|
+
*
|
|
912
|
+
* When the mocked function runs out of implementations, it will invoke the default implementation set with `vi.fn(() => defaultValue)` or `.mockImplementation(() => defaultValue)` if they were called.
|
|
913
|
+
* @example
|
|
914
|
+
* const myMockFn = vi
|
|
915
|
+
* .fn()
|
|
916
|
+
* .mockReturnValue('default')
|
|
917
|
+
* .mockReturnValueOnce('first call')
|
|
918
|
+
* .mockReturnValueOnce('second call')
|
|
919
|
+
*
|
|
920
|
+
* // 'first call', 'second call', 'default'
|
|
921
|
+
* console.log(myMockFn(), myMockFn(), myMockFn())
|
|
922
|
+
*/
|
|
923
|
+
mockReturnValueOnce(value: MockReturnType<T>): this;
|
|
924
|
+
/**
|
|
925
|
+
* Accepts a value that will be thrown whenever the mock function is called.
|
|
926
|
+
* @see https://vitest.dev/api/mock#mockthrow
|
|
927
|
+
* @example
|
|
928
|
+
* const myMockFn = vi.fn().mockThrow(new Error('error'))
|
|
929
|
+
* myMockFn() // throws 'error'
|
|
930
|
+
*/
|
|
931
|
+
mockThrow(value: unknown): this;
|
|
932
|
+
/**
|
|
933
|
+
* Accepts a value that will be thrown during the next function call. If chained, every consecutive call will throw the specified value.
|
|
934
|
+
* @example
|
|
935
|
+
* const myMockFn = vi
|
|
936
|
+
* .fn()
|
|
937
|
+
* .mockReturnValue('default')
|
|
938
|
+
* .mockThrowOnce(new Error('first call error'))
|
|
939
|
+
* .mockThrowOnce('second call error')
|
|
940
|
+
*
|
|
941
|
+
* expect(() => myMockFn()).toThrowError('first call error')
|
|
942
|
+
* expect(() => myMockFn()).toThrowError('second call error')
|
|
943
|
+
* expect(myMockFn()).toEqual('default')
|
|
944
|
+
*/
|
|
945
|
+
mockThrowOnce(value: unknown): this;
|
|
946
|
+
/**
|
|
947
|
+
* Accepts a value that will be resolved when the async function is called. TypeScript will only accept values that match the return type of the original function.
|
|
948
|
+
* @example
|
|
949
|
+
* const asyncMock = vi.fn().mockResolvedValue(42)
|
|
950
|
+
* asyncMock() // Promise<42>
|
|
951
|
+
*/
|
|
952
|
+
mockResolvedValue(value: Awaited<MockReturnType<T>>): this;
|
|
953
|
+
/**
|
|
954
|
+
* Accepts a value that will be resolved during the next function call. TypeScript will only accept values that match the return type of the original function. If chained, each consecutive call will resolve the specified value.
|
|
955
|
+
* @example
|
|
956
|
+
* const myMockFn = vi
|
|
957
|
+
* .fn()
|
|
958
|
+
* .mockResolvedValue('default')
|
|
959
|
+
* .mockResolvedValueOnce('first call')
|
|
960
|
+
* .mockResolvedValueOnce('second call')
|
|
961
|
+
*
|
|
962
|
+
* // Promise<'first call'>, Promise<'second call'>, Promise<'default'>
|
|
963
|
+
* console.log(myMockFn(), myMockFn(), myMockFn())
|
|
964
|
+
*/
|
|
965
|
+
mockResolvedValueOnce(value: Awaited<MockReturnType<T>>): this;
|
|
966
|
+
/**
|
|
967
|
+
* Accepts an error that will be rejected when async function is called.
|
|
968
|
+
* @example
|
|
969
|
+
* const asyncMock = vi.fn().mockRejectedValue(new Error('Async error'))
|
|
970
|
+
* await asyncMock() // throws Error<'Async error'>
|
|
971
|
+
*/
|
|
972
|
+
mockRejectedValue(error: unknown): this;
|
|
973
|
+
/**
|
|
974
|
+
* Accepts a value that will be rejected during the next function call. If chained, each consecutive call will reject the specified value.
|
|
975
|
+
* @example
|
|
976
|
+
* const asyncMock = vi
|
|
977
|
+
* .fn()
|
|
978
|
+
* .mockResolvedValueOnce('first call')
|
|
979
|
+
* .mockRejectedValueOnce(new Error('Async error'))
|
|
980
|
+
*
|
|
981
|
+
* await asyncMock() // first call
|
|
982
|
+
* await asyncMock() // throws Error<'Async error'>
|
|
983
|
+
*/
|
|
984
|
+
mockRejectedValueOnce(error: unknown): this;
|
|
985
|
+
}
|
|
986
|
+
type Mock<T extends Procedure | Constructable = Procedure> = MockInstance<T> & (T extends Constructable ? (T extends Procedure ? {
|
|
987
|
+
new (...args: ConstructorParameters<T>): InstanceType<T>;
|
|
988
|
+
(...args: Parameters<T>): ReturnType<T>;
|
|
989
|
+
} : {
|
|
990
|
+
new (...args: ConstructorParameters<T>): InstanceType<T>;
|
|
991
|
+
}) : {
|
|
992
|
+
new (...args: MockParameters<T>): MockReturnType<T>;
|
|
993
|
+
(...args: MockParameters<T>): MockReturnType<T>;
|
|
994
|
+
}) & { [P in keyof T] : T[P] };
|
|
995
|
+
type PartialMaybePromise<T> = T extends Promise<Awaited<T>> ? Promise<Partial<Awaited<T>>> : Partial<T>;
|
|
996
|
+
type PartialResultFunction<T> = T extends Constructable ? ({
|
|
997
|
+
new (...args: ConstructorParameters<T>): InstanceType<T>;
|
|
998
|
+
}) | ({
|
|
999
|
+
(this: InstanceType<T>, ...args: ConstructorParameters<T>): void;
|
|
1000
|
+
}) : T extends Procedure ? (...args: Parameters<T>) => PartialMaybePromise<ReturnType<T>> : T;
|
|
1001
|
+
type PartialMock<T extends Procedure | Constructable = Procedure> = Mock<PartialResultFunction<T extends Mock ? NonNullable<ReturnType<T["getMockImplementation"]>> : T>>;
|
|
1002
|
+
type DeepPartial<T> = T extends Procedure ? T : T extends Array<infer U> ? Array<DeepPartial<U>> : T extends object ? { [K in keyof T]? : DeepPartial<T[K]> } : T;
|
|
1003
|
+
type DeepPartialMaybePromise<T> = T extends Promise<Awaited<T>> ? Promise<DeepPartial<Awaited<T>>> : DeepPartial<T>;
|
|
1004
|
+
type DeepPartialResultFunction<T> = T extends Constructable ? ({
|
|
1005
|
+
new (...args: ConstructorParameters<T>): InstanceType<T>;
|
|
1006
|
+
}) | ({
|
|
1007
|
+
(this: InstanceType<T>, ...args: ConstructorParameters<T>): void;
|
|
1008
|
+
}) : T extends Procedure ? (...args: Parameters<T>) => DeepPartialMaybePromise<ReturnType<T>> : T;
|
|
1009
|
+
type DeepPartialMock<T extends Procedure | Constructable = Procedure> = Mock<DeepPartialResultFunction<T extends Mock ? NonNullable<ReturnType<T["getMockImplementation"]>> : T>>;
|
|
1010
|
+
type MaybeMockedConstructor<T> = T extends Constructable ? Mock<T> : T;
|
|
1011
|
+
type MockedFunction<T extends Procedure | Constructable> = Mock<T> & MockedObject<T>;
|
|
1012
|
+
type PartiallyMockedFunction<T extends Procedure | Constructable> = PartialMock<T> & MockedObject<T>;
|
|
1013
|
+
type MockedFunctionDeep<T extends Procedure | Constructable> = Mock<T> & MockedObjectDeep<T>;
|
|
1014
|
+
type PartiallyMockedFunctionDeep<T extends Procedure | Constructable> = DeepPartialMock<T> & MockedObjectDeep<T>;
|
|
1015
|
+
type MockedObject<T> = MaybeMockedConstructor<T> & { [K in Methods<T>] : T[K] extends Procedure ? MockedFunction<T[K]> : T[K] } & { [K in Properties<T>] : T[K] };
|
|
1016
|
+
type MockedObjectDeep<T> = MaybeMockedConstructor<T> & { [K in Methods<T>] : T[K] extends Procedure ? MockedFunctionDeep<T[K]> : T[K] } & { [K in Properties<T>] : MaybeMockedDeep<T[K]> };
|
|
1017
|
+
type MaybeMockedDeep<T> = T extends Procedure | Constructable ? MockedFunctionDeep<T> : T extends object ? MockedObjectDeep<T> : T;
|
|
1018
|
+
type MaybePartiallyMockedDeep<T> = T extends Procedure | Constructable ? PartiallyMockedFunctionDeep<T> : T extends object ? MockedObjectDeep<T> : T;
|
|
1019
|
+
type MaybeMocked<T> = T extends Procedure | Constructable ? MockedFunction<T> : T extends object ? MockedObject<T> : T;
|
|
1020
|
+
type MaybePartiallyMocked<T> = T extends Procedure | Constructable ? PartiallyMockedFunction<T> : T extends object ? MockedObject<T> : T;
|
|
1021
|
+
interface Constructable {
|
|
1022
|
+
new (...args: any[]): any;
|
|
1023
|
+
}
|
|
1024
|
+
type MockedClass<T extends Constructable> = MockInstance<T> & {
|
|
1025
|
+
prototype: T extends {
|
|
1026
|
+
prototype: any;
|
|
1027
|
+
} ? Mocked<T["prototype"]> : never;
|
|
1028
|
+
} & T;
|
|
1029
|
+
type Mocked<T> = { [P in keyof T] : T[P] extends Procedure ? MockInstance<T[P]> : T[P] extends Constructable ? MockedClass<T[P]> : T[P] } & T;
|
|
1030
|
+
interface MockConfig {
|
|
1031
|
+
mockImplementation: Procedure | Constructable | undefined;
|
|
1032
|
+
mockOriginal: Procedure | Constructable | undefined;
|
|
1033
|
+
mockName: string;
|
|
1034
|
+
onceMockImplementations: Array<Procedure | Constructable>;
|
|
1035
|
+
}
|
|
1036
|
+
interface MockInstanceOption {
|
|
1037
|
+
originalImplementation?: Procedure | Constructable;
|
|
1038
|
+
mockImplementation?: Procedure | Constructable;
|
|
1039
|
+
resetToMockImplementation?: boolean;
|
|
1040
|
+
restore?: () => void;
|
|
1041
|
+
prototypeMembers?: (string | symbol)[];
|
|
1042
|
+
keepMembersImplementation?: boolean;
|
|
1043
|
+
prototypeState?: MockContext;
|
|
1044
|
+
prototypeConfig?: MockConfig;
|
|
1045
|
+
resetToMockName?: boolean;
|
|
1046
|
+
name?: string | symbol;
|
|
1047
|
+
}
|
|
1048
|
+
|
|
1049
|
+
declare function isMockFunction(fn: any): fn is Mock;
|
|
1050
|
+
declare function createMockInstance(options?: MockInstanceOption): Mock<Procedure | Constructable>;
|
|
1051
|
+
declare function fn<T extends Procedure | Constructable = Procedure>(originalImplementation?: T): Mock<T>;
|
|
1052
|
+
type SpyOnValue<
|
|
1053
|
+
T extends object,
|
|
1054
|
+
K extends keyof any
|
|
1055
|
+
> = K extends keyof Required<T> ? Required<T>[K] : (T & Record<K, unknown>)[K];
|
|
1056
|
+
type SpyOnMethod<
|
|
1057
|
+
T extends object,
|
|
1058
|
+
K extends keyof any
|
|
1059
|
+
> = SpyOnValue<T, K> extends Constructable | Procedure ? SpyOnValue<T, K> : never;
|
|
1060
|
+
type SpyOnMethodKey<
|
|
1061
|
+
T extends object,
|
|
1062
|
+
K extends keyof any
|
|
1063
|
+
> = SpyOnValue<T, K> extends Constructable | Procedure ? K : never;
|
|
1064
|
+
declare function spyOn<
|
|
1065
|
+
T extends object,
|
|
1066
|
+
S extends Properties<Required<T>>
|
|
1067
|
+
>(object: T, key: S, accessor: "get"): Mock<() => T[S]>;
|
|
1068
|
+
declare function spyOn<
|
|
1069
|
+
T extends object,
|
|
1070
|
+
G extends Properties<Required<T>>
|
|
1071
|
+
>(object: T, key: G, accessor: "set"): Mock<(arg: T[G]) => void>;
|
|
1072
|
+
declare function spyOn<
|
|
1073
|
+
T extends object,
|
|
1074
|
+
M extends Classes<Required<T>> | Methods<Required<T>>
|
|
1075
|
+
>(object: T, key: M): Required<T>[M] extends Constructable | Procedure ? Mock<Required<T>[M]> : never;
|
|
1076
|
+
declare function spyOn<
|
|
1077
|
+
T extends object,
|
|
1078
|
+
K extends keyof any
|
|
1079
|
+
>(object: T, key: SpyOnMethodKey<T, K>): Mock<SpyOnMethod<T, K>>;
|
|
1080
|
+
declare function restoreAllMocks(): void;
|
|
1081
|
+
declare function clearAllMocks(): void;
|
|
1082
|
+
declare function resetAllMocks(): void;
|
|
1083
|
+
|
|
1084
|
+
type _vitest_spy_Constructable = Constructable;
|
|
1085
|
+
type _vitest_spy_MaybeMocked<T> = MaybeMocked<T>;
|
|
1086
|
+
type _vitest_spy_MaybeMockedConstructor<T> = MaybeMockedConstructor<T>;
|
|
1087
|
+
type _vitest_spy_MaybeMockedDeep<T> = MaybeMockedDeep<T>;
|
|
1088
|
+
type _vitest_spy_MaybePartiallyMocked<T> = MaybePartiallyMocked<T>;
|
|
1089
|
+
type _vitest_spy_MaybePartiallyMockedDeep<T> = MaybePartiallyMockedDeep<T>;
|
|
1090
|
+
type _vitest_spy_Mock<T extends Procedure | Constructable = Procedure> = Mock<T>;
|
|
1091
|
+
type _vitest_spy_MockContext<T extends Procedure | Constructable = Procedure> = MockContext<T>;
|
|
1092
|
+
type _vitest_spy_MockInstance<T extends Procedure | Constructable = Procedure> = MockInstance<T>;
|
|
1093
|
+
type _vitest_spy_MockInstanceOption = MockInstanceOption;
|
|
1094
|
+
type _vitest_spy_MockParameters<T extends Procedure | Constructable> = MockParameters<T>;
|
|
1095
|
+
type _vitest_spy_MockProcedureContext<T extends Procedure | Constructable> = MockProcedureContext<T>;
|
|
1096
|
+
type _vitest_spy_MockResult<T> = MockResult<T>;
|
|
1097
|
+
type _vitest_spy_MockResultIncomplete = MockResultIncomplete;
|
|
1098
|
+
type _vitest_spy_MockResultReturn<T> = MockResultReturn<T>;
|
|
1099
|
+
type _vitest_spy_MockResultThrow = MockResultThrow;
|
|
1100
|
+
type _vitest_spy_MockReturnType<T extends Procedure | Constructable> = MockReturnType<T>;
|
|
1101
|
+
type _vitest_spy_MockSettledResult<T> = MockSettledResult<T>;
|
|
1102
|
+
type _vitest_spy_MockSettledResultFulfilled<T> = MockSettledResultFulfilled<T>;
|
|
1103
|
+
type _vitest_spy_MockSettledResultIncomplete = MockSettledResultIncomplete;
|
|
1104
|
+
type _vitest_spy_MockSettledResultRejected = MockSettledResultRejected;
|
|
1105
|
+
type _vitest_spy_Mocked<T> = Mocked<T>;
|
|
1106
|
+
type _vitest_spy_MockedClass<T extends Constructable> = MockedClass<T>;
|
|
1107
|
+
type _vitest_spy_MockedFunction<T extends Procedure | Constructable> = MockedFunction<T>;
|
|
1108
|
+
type _vitest_spy_MockedFunctionDeep<T extends Procedure | Constructable> = MockedFunctionDeep<T>;
|
|
1109
|
+
type _vitest_spy_MockedObject<T> = MockedObject<T>;
|
|
1110
|
+
type _vitest_spy_MockedObjectDeep<T> = MockedObjectDeep<T>;
|
|
1111
|
+
type _vitest_spy_PartialMock<T extends Procedure | Constructable = Procedure> = PartialMock<T>;
|
|
1112
|
+
type _vitest_spy_PartiallyMockedFunction<T extends Procedure | Constructable> = PartiallyMockedFunction<T>;
|
|
1113
|
+
type _vitest_spy_PartiallyMockedFunctionDeep<T extends Procedure | Constructable> = PartiallyMockedFunctionDeep<T>;
|
|
1114
|
+
type _vitest_spy_Procedure = Procedure;
|
|
1115
|
+
declare const _vitest_spy_clearAllMocks: typeof clearAllMocks;
|
|
1116
|
+
declare const _vitest_spy_createMockInstance: typeof createMockInstance;
|
|
1117
|
+
declare const _vitest_spy_fn: typeof fn;
|
|
1118
|
+
declare const _vitest_spy_isMockFunction: typeof isMockFunction;
|
|
1119
|
+
declare const _vitest_spy_resetAllMocks: typeof resetAllMocks;
|
|
1120
|
+
declare const _vitest_spy_restoreAllMocks: typeof restoreAllMocks;
|
|
1121
|
+
declare const _vitest_spy_spyOn: typeof spyOn;
|
|
1122
|
+
declare namespace _vitest_spy {
|
|
1123
|
+
export { _vitest_spy_clearAllMocks as clearAllMocks, _vitest_spy_createMockInstance as createMockInstance, _vitest_spy_fn as fn, _vitest_spy_isMockFunction as isMockFunction, _vitest_spy_resetAllMocks as resetAllMocks, _vitest_spy_restoreAllMocks as restoreAllMocks, _vitest_spy_spyOn as spyOn };
|
|
1124
|
+
export type { _vitest_spy_Constructable as Constructable, _vitest_spy_MaybeMocked as MaybeMocked, _vitest_spy_MaybeMockedConstructor as MaybeMockedConstructor, _vitest_spy_MaybeMockedDeep as MaybeMockedDeep, _vitest_spy_MaybePartiallyMocked as MaybePartiallyMocked, _vitest_spy_MaybePartiallyMockedDeep as MaybePartiallyMockedDeep, _vitest_spy_Mock as Mock, _vitest_spy_MockContext as MockContext, _vitest_spy_MockInstance as MockInstance, _vitest_spy_MockInstanceOption as MockInstanceOption, _vitest_spy_MockParameters as MockParameters, _vitest_spy_MockProcedureContext as MockProcedureContext, _vitest_spy_MockResult as MockResult, _vitest_spy_MockResultIncomplete as MockResultIncomplete, _vitest_spy_MockResultReturn as MockResultReturn, _vitest_spy_MockResultThrow as MockResultThrow, _vitest_spy_MockReturnType as MockReturnType, _vitest_spy_MockSettledResult as MockSettledResult, _vitest_spy_MockSettledResultFulfilled as MockSettledResultFulfilled, _vitest_spy_MockSettledResultIncomplete as MockSettledResultIncomplete, _vitest_spy_MockSettledResultRejected as MockSettledResultRejected, _vitest_spy_Mocked as Mocked, _vitest_spy_MockedClass as MockedClass, _vitest_spy_MockedFunction as MockedFunction, _vitest_spy_MockedFunctionDeep as MockedFunctionDeep, _vitest_spy_MockedObject as MockedObject, _vitest_spy_MockedObjectDeep as MockedObjectDeep, _vitest_spy_PartialMock as PartialMock, _vitest_spy_PartiallyMockedFunction as PartiallyMockedFunction, _vitest_spy_PartiallyMockedFunctionDeep as PartiallyMockedFunctionDeep, _vitest_spy_Procedure as Procedure };
|
|
1125
|
+
}
|
|
1126
|
+
|
|
1127
|
+
interface Formatter {
|
|
1128
|
+
(input?: unknown): string;
|
|
1129
|
+
open: string;
|
|
1130
|
+
close: string;
|
|
1131
|
+
}
|
|
1132
|
+
declare function disableDefaultColors(): void;
|
|
1133
|
+
|
|
351
1134
|
interface AsymmetricMatcherInterface {
|
|
352
1135
|
asymmetricMatch: (other: unknown, customTesters?: Array<Tester>) => boolean;
|
|
353
1136
|
toString: () => string;
|
|
@@ -1161,16 +1944,77 @@ declare global {
|
|
|
1161
1944
|
}
|
|
1162
1945
|
|
|
1163
1946
|
type ExtractBenchNames<T extends BenchRegistration<any>[]> = Exclude<{ [K in keyof T] : T[K] extends BenchRegistration<infer N> ? N : never }[number], never>;
|
|
1164
|
-
|
|
1947
|
+
/**
|
|
1948
|
+
* A benchmarked function. Vitest-owned and engine-agnostic.
|
|
1949
|
+
*/
|
|
1950
|
+
type BenchFn = Fn;
|
|
1951
|
+
/**
|
|
1952
|
+
* Per-benchmark initialization options passed to `bench(name, options, fn)`.
|
|
1953
|
+
*/
|
|
1954
|
+
type BenchOptions = FnOptions;
|
|
1955
|
+
/**
|
|
1956
|
+
* Engine-neutral run options forwarded to a {@link BenchmarkProvider}. These
|
|
1957
|
+
* come from the optional trailing options argument of `bench.compare()` and
|
|
1958
|
+
* `registration.run()`.
|
|
1959
|
+
*/
|
|
1960
|
+
type BenchRunOptions = BenchOptions$1;
|
|
1961
|
+
/**
|
|
1962
|
+
* The result of a single benchmark, produced by a {@link BenchmarkProvider}.
|
|
1963
|
+
* Structurally compatible with tinybench's task statistics so it flows
|
|
1964
|
+
* unchanged into the reporter, `bench.from()` baselines and comparison tables.
|
|
1965
|
+
* The `name` matches the corresponding {@link BenchRegistration}.
|
|
1966
|
+
*/
|
|
1967
|
+
interface BenchResult extends TaskResultCompleted, TaskResultRuntimeInfo, TaskResultTimestampProviderInfo {
|
|
1968
|
+
/** The registered benchmark name this result belongs to. */
|
|
1969
|
+
name: string;
|
|
1970
|
+
}
|
|
1971
|
+
/**
|
|
1972
|
+
* A benchmark defined by `bench()` (or `bench.from()`), as seen by a
|
|
1973
|
+
* {@link BenchmarkProvider}. `fn`/`fnOpts` are absent for `bench.from()`
|
|
1974
|
+
* registrations, which are resolved from a stored baseline instead of run.
|
|
1975
|
+
*/
|
|
1976
|
+
interface BenchRegistrationInput {
|
|
1977
|
+
name: string;
|
|
1978
|
+
fn: BenchFn;
|
|
1979
|
+
fnOpts?: BenchOptions;
|
|
1980
|
+
}
|
|
1981
|
+
/**
|
|
1982
|
+
* The set of benchmarks registered by a single test, handed to
|
|
1983
|
+
* {@link BenchmarkProvider.run}.
|
|
1984
|
+
*/
|
|
1985
|
+
interface BenchmarkGroup {
|
|
1986
|
+
/** The test that registered these benchmarks. */
|
|
1987
|
+
test: Test;
|
|
1988
|
+
/** The resolved benchmark configuration for the current project. */
|
|
1989
|
+
config: SerializedConfig["benchmark"];
|
|
1990
|
+
/** The runnable registrations, in registration order. */
|
|
1991
|
+
registrations: BenchRegistrationInput[];
|
|
1992
|
+
/** Engine-neutral run options, when provided by the caller. */
|
|
1993
|
+
options?: BenchRunOptions;
|
|
1994
|
+
}
|
|
1995
|
+
/**
|
|
1996
|
+
* Executes the benchmarks of a single test and returns their results.
|
|
1997
|
+
*
|
|
1998
|
+
* A custom provider module must default-export an object of this shape.
|
|
1999
|
+
*
|
|
2000
|
+
* The returned array is the sole source of results: it's what `bench().run()`
|
|
2001
|
+
* resolves to and what the reporter serializes. Results are matched to
|
|
2002
|
+
* registrations by `name`; return one {@link BenchResult} per registration.
|
|
2003
|
+
*
|
|
2004
|
+
* @experimental
|
|
2005
|
+
*/
|
|
2006
|
+
interface BenchmarkProvider {
|
|
2007
|
+
run: (group: BenchmarkGroup) => Promise<BenchResult[]>;
|
|
2008
|
+
}
|
|
1165
2009
|
interface BenchStorage<T extends string> {
|
|
1166
2010
|
get: (name: T) => BenchResult;
|
|
1167
2011
|
}
|
|
1168
2012
|
|
|
1169
2013
|
/**
|
|
1170
|
-
* Options accepted by `bench(name, options, fn)`. Extends
|
|
1171
|
-
*
|
|
2014
|
+
* Options accepted by `bench(name, options, fn)`. Extends the per-benchmark
|
|
2015
|
+
* lifecycle hooks with Vitest-specific fields.
|
|
1172
2016
|
*/
|
|
1173
|
-
interface BenchFnOptions extends
|
|
2017
|
+
interface BenchFnOptions extends BenchOptions {
|
|
1174
2018
|
/**
|
|
1175
2019
|
* Path (relative to the project root) where the benchmark result is written
|
|
1176
2020
|
* after a successful run. The string `${projectName}` is substituted with
|
|
@@ -1191,21 +2035,21 @@ interface BenchRegistration<Name extends string> {
|
|
|
1191
2035
|
/**
|
|
1192
2036
|
* The benchmark function. Absent for registrations created via `bench.from()`.
|
|
1193
2037
|
*/
|
|
1194
|
-
fn?:
|
|
2038
|
+
fn?: BenchFn;
|
|
1195
2039
|
/**
|
|
1196
2040
|
* Per-benchmark options (`beforeEach`, `beforeAll`, etc.). Absent for
|
|
1197
2041
|
* registrations created via `bench.from()`.
|
|
1198
2042
|
*/
|
|
1199
|
-
fnOpts?:
|
|
1200
|
-
run: (options?:
|
|
2043
|
+
fnOpts?: BenchOptions;
|
|
2044
|
+
run: (options?: BenchRunOptions) => Promise<BenchResult>;
|
|
1201
2045
|
}
|
|
1202
2046
|
interface BenchCompare {
|
|
1203
2047
|
<Args extends BenchRegistration<any>[]>(...args: Args): Promise<BenchStorage<ExtractBenchNames<Args>>>;
|
|
1204
|
-
<Args extends BenchRegistration<any>[]>(...args: [...Args,
|
|
2048
|
+
<Args extends BenchRegistration<any>[]>(...args: [...Args, BenchRunOptions]): Promise<BenchStorage<ExtractBenchNames<Args>>>;
|
|
1205
2049
|
}
|
|
1206
2050
|
interface BenchFactory {
|
|
1207
|
-
<Name extends string>(name: Name | Function, fn:
|
|
1208
|
-
<Name extends string>(name: Name | Function, options: BenchFnOptions, fn:
|
|
2051
|
+
<Name extends string>(name: Name | Function, fn: BenchFn): BenchRegistration<Name>;
|
|
2052
|
+
<Name extends string>(name: Name | Function, options: BenchFnOptions, fn: BenchFn): BenchRegistration<Name>;
|
|
1209
2053
|
}
|
|
1210
2054
|
interface BenchFromSource {
|
|
1211
2055
|
(): BaselineData | Promise<BaselineData>;
|
|
@@ -2461,7 +3305,7 @@ interface TestArtifactLocation extends FileLocation {}
|
|
|
2461
3305
|
*
|
|
2462
3306
|
* Extend this interface when creating custom test artifacts. Vitest automatically manages the `attachments` array and injects the `location` property to indicate where the artifact was created in your test code.
|
|
2463
3307
|
*
|
|
2464
|
-
* **Important**: when running with [`api.allowWrite`](https://vitest.dev/config/api#api-allowwrite)
|
|
3308
|
+
* **Important**: when running with [`api.allowWrite`](https://vitest.dev/config/api#api-allowwrite) disabled, Vitest empties the `attachments` array on every artifact before reporting it.
|
|
2465
3309
|
*/
|
|
2466
3310
|
interface TestArtifactBase {
|
|
2467
3311
|
/** File or data attachments associated with this artifact */
|
|
@@ -2768,6 +3612,7 @@ interface SerializedConfig {
|
|
|
2768
3612
|
strictTags: boolean;
|
|
2769
3613
|
color?: LabelColor;
|
|
2770
3614
|
globals: boolean;
|
|
3615
|
+
injectCjsGlobals: boolean;
|
|
2771
3616
|
base: string | undefined;
|
|
2772
3617
|
snapshotEnvironment?: string;
|
|
2773
3618
|
disableConsoleIntercept: boolean | undefined;
|
|
@@ -2781,7 +3626,7 @@ interface SerializedConfig {
|
|
|
2781
3626
|
restoreMocks: boolean;
|
|
2782
3627
|
unstubGlobals: boolean;
|
|
2783
3628
|
unstubEnvs: boolean;
|
|
2784
|
-
fakeTimers: Config;
|
|
3629
|
+
fakeTimers: Config$1;
|
|
2785
3630
|
defines: Record<string, any>;
|
|
2786
3631
|
expect: {
|
|
2787
3632
|
requireAssertions?: boolean;
|
|
@@ -2838,8 +3683,6 @@ interface SerializedConfig {
|
|
|
2838
3683
|
browser: {
|
|
2839
3684
|
name: string;
|
|
2840
3685
|
headless: boolean;
|
|
2841
|
-
isolate: boolean;
|
|
2842
|
-
fileParallelism: boolean;
|
|
2843
3686
|
ui: boolean;
|
|
2844
3687
|
viewport: {
|
|
2845
3688
|
width: number;
|
|
@@ -2870,12 +3713,13 @@ interface SerializedConfig {
|
|
|
2870
3713
|
benchmark: {
|
|
2871
3714
|
enabled: boolean;
|
|
2872
3715
|
retainSamples: boolean;
|
|
3716
|
+
provider: string | undefined;
|
|
2873
3717
|
suppressExportGetterWarnings: boolean;
|
|
2874
3718
|
projectName: string;
|
|
2875
3719
|
};
|
|
2876
3720
|
serializedDefines: string;
|
|
3721
|
+
fsModuleCache: boolean;
|
|
2877
3722
|
experimental: {
|
|
2878
|
-
fsModuleCache: boolean;
|
|
2879
3723
|
importDurations: {
|
|
2880
3724
|
print: boolean | "on-warn";
|
|
2881
3725
|
limit: number;
|
|
@@ -2900,6 +3744,8 @@ interface SerializedConfig {
|
|
|
2900
3744
|
interface SerializedCoverageConfig {
|
|
2901
3745
|
provider: "istanbul" | "v8" | "custom" | undefined;
|
|
2902
3746
|
reportsDirectory: string;
|
|
3747
|
+
/** Directory where workers write raw coverage results, shard-aware */
|
|
3748
|
+
coverageFilesDirectory: string;
|
|
2903
3749
|
htmlDir: string | undefined;
|
|
2904
3750
|
enabled: boolean;
|
|
2905
3751
|
customProviderModule: string | undefined;
|
|
@@ -2916,5 +3762,5 @@ type RuntimeConfig = Pick<SerializedConfig, "allowOnly" | "testTimeout" | "hookT
|
|
|
2916
3762
|
type RuntimeOptions = Partial<RuntimeConfig>;
|
|
2917
3763
|
type BrowserTraceViewMode = "on" | "off" | "on-first-retry" | "on-all-retries" | "retain-on-failure";
|
|
2918
3764
|
|
|
2919
|
-
export { onTestFailed as
|
|
2920
|
-
export type {
|
|
3765
|
+
export { createChainable as J, afterAll as a$, afterEach as b0, aroundAll as b1, aroundEach as b2, beforeAll as b3, beforeEach as b4, onTestFailed as b5, onTestFinished as b6, disableDefaultColors as b9, SnapshotState as ba, _vitest_spy as bg, format as bi, inspect as bj, stringify as bk, fn as l, spyOn as s };
|
|
3766
|
+
export type { BenchRegistration as $, Awaitable as A, CancelReason as B, Config$1 as C, DomainSnapshotAdapter as D, ExpectStatic as E, File as F, TestTryOptions as G, TestContext as H, ImportDuration as I, AfterSuiteRunMeta as K, LabelColor as L, ModuleGraphData as M, Assertion as N, AsymmetricMatchersContaining as O, ProvidedContext as P, BaselineData as Q, RuntimeOptions as R, SerializedRootConfig as S, TestAnnotation as T, UserConsoleLog as U, VitestRunner as V, Bench as W, BenchFn as X, BenchFnOptions as Y, BenchFromSource as Z, BenchOptions as _, TestArtifact as a, BenchRegistrationInput as a0, BenchResult as a1, BenchRunOptions as a2, BenchStorage as a3, BenchmarkGroup as a4, BenchmarkProvider as a5, BrowserTraceArtifact as a6, DeeplyAllowMatchers as a7, DiffOptions as a8, DomainMatchResult as a9, SerializedError as aA, SnapshotData as aB, SnapshotMatchOptions as aC, SnapshotResult as aD, SnapshotSerializer as aE, SnapshotStateOptions as aF, SnapshotSummary as aG, SnapshotUpdateState as aH, SuiteFactory as aI, SuiteOptions as aJ, TaskCustomOptions as aK, TaskMeta as aL, TaskState as aM, TestAnnotationArtifact as aN, TestArtifactBase as aO, TestArtifactLocation as aP, TestArtifactRegistry as aQ, TestAttachment as aR, TestBenchmark as aS, TestBenchmarkTask as aT, TestError as aU, TestFunction as aV, TestOptions as aW, TestTagDefinition as aX, TestTags as aY, UncheckedSnapshot as aZ, VisualRegressionArtifact as a_, FailureScreenshotArtifact as aa, JestAssertion as ab, RawMatcherFn as ac, Matchers as ad, MatchersObject as ae, MockContext as af, MockResult as ag, MockResultIncomplete as ah, MockResultReturn as ai, MockResultThrow as aj, MockSettledResult as ak, MockSettledResultFulfilled as al, MockSettledResultIncomplete as am, MockSettledResultRejected as an, Mocked as ao, MockedClass as ap, MockedFunction as aq, MockedObject as ar, OnTestFailedHandler as as, OnTestFinishedHandler as at, ParsedStack as au, RunMode as av, TaskBase as aw, TaskResult as ax, RuntimeConfig as ay, SerializedCoverageConfig as az, TaskResultPack as b, SequenceHooks as b7, SequenceSetupFiles as b8, PromisifyAssertion as bb, Tester as bc, Plugin as bd, FileSpecification as be, SerializedDiffOptions as bf, StringifyOptions as bh, SnapshotEnvironment as bl, SnapshotEnvironmentOptions as bm, SerializableRetry as bn, BrowserTraceViewMode as bo, Arrayable as bp, ModuleType as bq, AsyncLeak as br, PrettyFormatOptions as bs, FetchCachedFileSystemResult as bt, ResolveFunctionResult as bu, TaskEventPack as c, Test as d, TaskPopulated as e, MatcherState as f, SyncExpectationResult as g, AsyncExpectationResult as h, ExpectationResult as i, Procedure as j, Mock as k, MaybeMockedDeep as m, MaybeMocked as n, MaybePartiallyMocked as o, MaybePartiallyMockedDeep as p, MockInstance as q, TestAPI as r, SuiteCollector as t, SuiteAPI as u, Suite as v, SuiteHooks as w, SerializedConfig as x, VitestRunnerImportSource as y, Task as z };
|