vitest 5.0.5 → 5.1.0
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 +1 -1
- package/dist/browser.d.ts +6 -5
- package/dist/browser.js +6 -6
- package/dist/chunks/{base.CzXt2BO_.js → base.Cof-UHJf.js} +17 -21
- package/dist/chunks/{browser.d.FGQ9_rK6.d.ts → browser.d.C7tWgUvw.d.ts} +4 -3
- package/dist/chunks/{cac.CLrZKo1g.js → cac.BYbt0aJp.js} +30 -16
- package/dist/chunks/{cli-api.De07GUeT.js → cli-api.COfZo8lK.js} +5226 -4385
- package/dist/chunks/{config.d.QBNYCgFU.d.ts → config.d.B3YV4t0O.d.ts} +169 -93
- package/dist/chunks/{console.DtI4yxfN.js → console.CQZ877Hi.js} +6 -3
- package/dist/chunks/{constants.-juJ8b_4.js → constants.DLYM6cZY.js} +1 -1
- package/dist/chunks/{coverage.-bm5IxnW.js → coverage.9iqXE2gN.js} +1 -1
- package/dist/chunks/{coverage.cTDc4uSS.js → coverage.jGCktcGP.js} +1 -1
- package/dist/chunks/{creator.C5g4egeG.js → creator.DHWmytIK.js} +11 -11
- package/dist/chunks/{doctor.BK86Cncq.js → doctor.B-oPbwps.js} +2 -2
- package/dist/chunks/{environment.d.BY56MoGs.d.ts → environment.d.BFQtFKdZ.d.ts} +1 -1
- package/dist/chunks/{globals.CXEE6_2C.js → globals.ZKtKSkEf.js} +7 -6
- package/dist/chunks/{index.CK-t0WMg.js → index.Bi0NXYPf.js} +165 -62
- package/dist/chunks/{index.aTZaPVhf.js → index.CZzC1gGg.js} +299 -440
- package/dist/chunks/{index.1TqnEahn.js → index.Di8au7q4.js} +104 -72
- package/dist/chunks/{index.CoUIxZd4.js → index.w_oBZ9N8.js} +5 -5
- package/dist/chunks/{init-forks.CRxIPOJR.js → init-forks.BaDXQSD8.js} +1 -1
- package/dist/chunks/{init-threads.Dv3kwST_.js → init-threads.ZX_Vov0z.js} +1 -1
- package/dist/chunks/{init.PvxYpuCm.js → init.CO4AB7HZ.js} +4 -4
- package/dist/chunks/{module-dependencies.CwNPkcV4.js → module-dependencies._2Eei3FO.js} +1 -1
- package/dist/chunks/{native.cdzHIdmv.js → native.upB-V0CK.js} +1 -1
- package/dist/chunks/{nativeModuleMocker.BxrHJNAF.js → nativeModuleMocker.Dh5azSB4.js} +4 -3
- package/dist/chunks/{nativeModuleRunner.xi64Afb2.js → nativeModuleRunner.9xPIMzi7.js} +1 -1
- package/dist/chunks/{node.uQulW0ei.js → node.B9mkVmLH.js} +1 -1
- package/dist/chunks/{pathe.M-eThtNZ.Ba-7h1rE.js → pathe.M-eThtNZ.zq3TM4NT.js} +1 -1
- package/dist/chunks/{plugin.d.C8mmycim.d.ts → plugin.d.LRFSN46m.d.ts} +191 -32
- package/dist/chunks/rawSnapshot.DqSiqIEx.js +356 -0
- package/dist/chunks/{resolver.CtCcxIy1.js → resolver.BzpmeQeT.js} +1 -1
- package/dist/chunks/{rpc.DpkUyY1N.js → rpc.Uhkwr2NM.js} +2 -2
- package/dist/chunks/{rpc.d.Cft1biqy.d.ts → rpc.d.3FOhdFx8.d.ts} +1 -1
- package/dist/chunks/{run.BPv-BBRv.js → run.CjdgFZiW.js} +28 -7
- package/dist/chunks/{setup-common.HGAqWOnX.js → setup-common.CqAQCXzx.js} +2 -2
- package/dist/chunks/{source-map.DdKI5IHB.js → source-map.DakdQc29.js} +43 -37
- package/dist/chunks/{source-map.d.kzFtk_dj.d.ts → source-map.d.BkG8YK_3.d.ts} +2 -1
- package/dist/chunks/{task-utils.d.PFh2BV6Q.d.ts → task-utils.d.D-gFPNFi.d.ts} +2 -1
- package/dist/chunks/{utils.DSfl_w8V.js → utils.BBk_icFG.js} +6 -3
- package/dist/chunks/{vm.FGl2rw_t.js → vm.b4MbCAJQ.js} +27 -14
- package/dist/chunks/{worker.d.BH-r1bPu.d.ts → worker.d.CyJRpyfZ.d.ts} +3 -3
- package/dist/cli.js +3 -3
- package/dist/config.cjs +1 -1
- package/dist/config.d.ts +11 -11
- package/dist/config.js +1 -1
- package/dist/index.d.ts +21 -15
- package/dist/index.js +6 -5
- package/dist/module-evaluator.d.ts +3 -2
- package/dist/node.d.ts +30 -12
- package/dist/node.js +16 -14
- package/dist/runtime.d.ts +4 -4
- package/dist/runtime.js +5 -4
- package/dist/task-utils.js +10 -4
- package/dist/worker.d.ts +4 -4
- package/dist/worker.js +14 -13
- package/dist/workers/forks.js +15 -14
- package/dist/workers/runVmTests.js +16 -12
- package/dist/workers/threads.js +15 -14
- package/dist/workers/vmForks.js +11 -10
- package/dist/workers/vmThreads.js +11 -10
- package/package.json +17 -17
|
@@ -1,93 +1,7 @@
|
|
|
1
|
+
/// <reference types="chai" />
|
|
1
2
|
import { Disposable } from 'vitest/optional-runtime-types.js';
|
|
2
3
|
import { Fn, FnOptions, BenchOptions as BenchOptions$1, TaskResultCompleted, TaskResultRuntimeInfo, TaskResultTimestampProviderInfo, Statistics } from 'tinybench';
|
|
3
4
|
|
|
4
|
-
type VoidVarArgsFunc = (...args: unknown[]) => void;
|
|
5
|
-
type SetImmediate = (callback: VoidVarArgsFunc, ...args: unknown[]) => NodeImmediate;
|
|
6
|
-
type SetTimeout = (callback: VoidVarArgsFunc, delay?: number, ...args: unknown[]) => TimerId;
|
|
7
|
-
type ClearTimeout = (id?: TimerId) => void;
|
|
8
|
-
type SetInterval = (callback: VoidVarArgsFunc, delay?: number, ...args: unknown[]) => TimerId;
|
|
9
|
-
type ClearInterval = (id?: TimerId) => void;
|
|
10
|
-
type QueueMicrotask = (callback: VoidVarArgsFunc) => void;
|
|
11
|
-
type TimeRemaining = () => number;
|
|
12
|
-
type IdleDeadline = {
|
|
13
|
-
didTimeout: boolean;
|
|
14
|
-
timeRemaining: TimeRemaining;
|
|
15
|
-
};
|
|
16
|
-
type RequestIdleCallbackCallback = (deadline: IdleDeadline) => any;
|
|
17
|
-
type RequestIdleCallback = (callback: RequestIdleCallbackCallback, options?: {
|
|
18
|
-
timeout?: number;
|
|
19
|
-
}) => number;
|
|
20
|
-
type AnimationFrameCallback = (timestamp: number) => any;
|
|
21
|
-
type RequestAnimationFrame = (callback: AnimationFrameCallback) => TimerId;
|
|
22
|
-
type CancelAnimationFrame = (id: TimerId) => void;
|
|
23
|
-
type CancelIdleCallback = (id: TimerId) => void;
|
|
24
|
-
type ClearImmediate = (id: NodeImmediate) => void;
|
|
25
|
-
type TemporalTimelike = {
|
|
26
|
-
epochMilliseconds: number;
|
|
27
|
-
};
|
|
28
|
-
type FakeMethod = "setTimeout" | "clearTimeout" | "setImmediate" | "clearImmediate" | "setInterval" | "clearInterval" | "Date" | "nextTick" | "hrtime" | "requestAnimationFrame" | "cancelAnimationFrame" | "requestIdleCallback" | "cancelIdleCallback" | "performance" | "queueMicrotask" | "Intl" | "Temporal";
|
|
29
|
-
type TimerId = number | NodeImmediate | Timer;
|
|
30
|
-
type GlobalObject = Record<string, any> & {
|
|
31
|
-
setTimeout?: SetTimeout;
|
|
32
|
-
clearTimeout?: ClearTimeout;
|
|
33
|
-
setInterval?: SetInterval;
|
|
34
|
-
clearInterval?: ClearInterval;
|
|
35
|
-
setImmediate?: SetImmediate;
|
|
36
|
-
clearImmediate?: ClearImmediate;
|
|
37
|
-
queueMicrotask?: QueueMicrotask;
|
|
38
|
-
requestAnimationFrame?: RequestAnimationFrame;
|
|
39
|
-
cancelAnimationFrame?: CancelAnimationFrame;
|
|
40
|
-
requestIdleCallback?: RequestIdleCallback;
|
|
41
|
-
cancelIdleCallback?: CancelIdleCallback;
|
|
42
|
-
process?: any;
|
|
43
|
-
performance?: any;
|
|
44
|
-
Performance?: any;
|
|
45
|
-
Intl?: any;
|
|
46
|
-
Temporal?: any;
|
|
47
|
-
Promise?: typeof Promise;
|
|
48
|
-
Date: typeof Date & {
|
|
49
|
-
isFake?: boolean;
|
|
50
|
-
toSource?: () => string;
|
|
51
|
-
clock?: any;
|
|
52
|
-
};
|
|
53
|
-
};
|
|
54
|
-
type TimerInitialProps = {
|
|
55
|
-
func: VoidVarArgsFunc;
|
|
56
|
-
args?: unknown[];
|
|
57
|
-
type?: 'Timeout' | 'Interval' | 'Immediate' | 'AnimationFrame' | 'IdleCallback';
|
|
58
|
-
delay?: number;
|
|
59
|
-
callAt?: number;
|
|
60
|
-
createdAt?: number;
|
|
61
|
-
immediate?: boolean;
|
|
62
|
-
id?: number;
|
|
63
|
-
error?: Error;
|
|
64
|
-
interval?: number;
|
|
65
|
-
animation?: boolean;
|
|
66
|
-
requestIdleCallback?: boolean;
|
|
67
|
-
order?: number;
|
|
68
|
-
heapIndex?: number;
|
|
69
|
-
};
|
|
70
|
-
type Config$1 = {
|
|
71
|
-
now?: number | Date | TemporalTimelike;
|
|
72
|
-
toFake?: FakeMethod[];
|
|
73
|
-
toNotFake?: FakeMethod[];
|
|
74
|
-
loopLimit?: number;
|
|
75
|
-
shouldAdvanceTime?: boolean;
|
|
76
|
-
advanceTimeDelta?: number;
|
|
77
|
-
shouldClearNativeTimers?: boolean;
|
|
78
|
-
ignoreMissingTimers?: boolean;
|
|
79
|
-
target?: GlobalObject;
|
|
80
|
-
};
|
|
81
|
-
type Timer = TimerInitialProps;
|
|
82
|
-
type NodeImmediateHasRef = () => boolean;
|
|
83
|
-
type NodeImmediateRef = () => NodeImmediate;
|
|
84
|
-
type NodeImmediateUnref = () => NodeImmediate;
|
|
85
|
-
type NodeImmediate = {
|
|
86
|
-
hasRef: NodeImmediateHasRef;
|
|
87
|
-
ref: NodeImmediateRef;
|
|
88
|
-
unref: NodeImmediateUnref;
|
|
89
|
-
};
|
|
90
|
-
|
|
91
5
|
/**
|
|
92
6
|
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
93
7
|
*
|
|
@@ -250,7 +164,7 @@ interface PrettyFormatOptions {
|
|
|
250
164
|
quoteKeys?: boolean;
|
|
251
165
|
}
|
|
252
166
|
type OptionsReceived = PrettyFormatOptions;
|
|
253
|
-
interface Config {
|
|
167
|
+
interface Config$1 {
|
|
254
168
|
callToJSON: boolean;
|
|
255
169
|
compareKeys: CompareKeys;
|
|
256
170
|
colors: Colors;
|
|
@@ -270,10 +184,10 @@ interface Config {
|
|
|
270
184
|
quoteKeys: boolean;
|
|
271
185
|
maxOutputLength: number;
|
|
272
186
|
}
|
|
273
|
-
type Printer = (val: unknown, config: Config, indentation: string, depth: number, refs: Refs, hasCalledToJSON?: boolean) => string;
|
|
187
|
+
type Printer = (val: unknown, config: Config$1, indentation: string, depth: number, refs: Refs, hasCalledToJSON?: boolean) => string;
|
|
274
188
|
type Test$1 = (arg0: any) => boolean;
|
|
275
189
|
interface NewPlugin {
|
|
276
|
-
serialize: (val: any, config: Config, indentation: string, depth: number, refs: Refs, printer: Printer) => string;
|
|
190
|
+
serialize: (val: any, config: Config$1, indentation: string, depth: number, refs: Refs, printer: Printer) => string;
|
|
277
191
|
test: Test$1;
|
|
278
192
|
}
|
|
279
193
|
interface PluginOptions {
|
|
@@ -370,6 +284,32 @@ interface RawSnapshotInfo {
|
|
|
370
284
|
readonly?: boolean;
|
|
371
285
|
content?: string;
|
|
372
286
|
}
|
|
287
|
+
interface RawSnapshot extends RawSnapshotInfo {
|
|
288
|
+
snapshot: string;
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
interface InlineSnapshot {
|
|
292
|
+
snapshot: string;
|
|
293
|
+
testId: string;
|
|
294
|
+
file: string;
|
|
295
|
+
line: number;
|
|
296
|
+
column: number;
|
|
297
|
+
assertionName?: string;
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
interface InlineSnapshotUpdate extends InlineSnapshot {
|
|
301
|
+
type: "inline";
|
|
302
|
+
}
|
|
303
|
+
interface FileSnapshotUpdate {
|
|
304
|
+
type: "file";
|
|
305
|
+
file: string;
|
|
306
|
+
key: string;
|
|
307
|
+
snapshot: string;
|
|
308
|
+
}
|
|
309
|
+
interface RawSnapshotUpdate extends RawSnapshot {
|
|
310
|
+
type: "raw";
|
|
311
|
+
}
|
|
312
|
+
type SnapshotUpdate = InlineSnapshotUpdate | FileSnapshotUpdate | RawSnapshotUpdate;
|
|
373
313
|
|
|
374
314
|
interface SnapshotEnvironment {
|
|
375
315
|
getVersion: () => string;
|
|
@@ -407,6 +347,7 @@ interface SnapshotReturnOptions {
|
|
|
407
347
|
expected?: string;
|
|
408
348
|
key: string;
|
|
409
349
|
pass: boolean;
|
|
350
|
+
update?: SnapshotUpdate;
|
|
410
351
|
}
|
|
411
352
|
interface SaveStatus {
|
|
412
353
|
deleted: boolean;
|
|
@@ -459,6 +400,7 @@ declare class SnapshotState {
|
|
|
459
400
|
private _resolveKey;
|
|
460
401
|
private _resolveInlineStack;
|
|
461
402
|
private _reconcile;
|
|
403
|
+
private _createUpdate;
|
|
462
404
|
save(): Promise<SaveStatus>;
|
|
463
405
|
getUncheckedCount(): number;
|
|
464
406
|
getUncheckedKeys(): Array<string>;
|
|
@@ -607,6 +549,109 @@ interface Memorize {
|
|
|
607
549
|
declare function diff(a: any, b: any, options?: DiffOptions, memorize?: Memorize): string | undefined;
|
|
608
550
|
declare function printDiffOrStringify(received: unknown, expected: unknown, options?: DiffOptions, memory?: StringifiedMemory): string | undefined;
|
|
609
551
|
|
|
552
|
+
type VoidVarArgsFunc = (...args: unknown[]) => void;
|
|
553
|
+
type SetImmediate = (callback: VoidVarArgsFunc, ...args: unknown[]) => NodeImmediate;
|
|
554
|
+
type SetTimeout = (callback: VoidVarArgsFunc, delay?: number, ...args: unknown[]) => TimerId;
|
|
555
|
+
type ClearTimeout = (id?: TimerId) => void;
|
|
556
|
+
type SetInterval = (callback: VoidVarArgsFunc, delay?: number, ...args: unknown[]) => TimerId;
|
|
557
|
+
type ClearInterval = (id?: TimerId) => void;
|
|
558
|
+
type QueueMicrotask = (callback: VoidVarArgsFunc) => void;
|
|
559
|
+
type TimeRemaining = () => number;
|
|
560
|
+
type IdleDeadline = {
|
|
561
|
+
didTimeout: boolean;
|
|
562
|
+
timeRemaining: TimeRemaining;
|
|
563
|
+
};
|
|
564
|
+
type RequestIdleCallbackCallback = (deadline: IdleDeadline) => any;
|
|
565
|
+
type RequestIdleCallback = (callback: RequestIdleCallbackCallback, options?: {
|
|
566
|
+
timeout?: number;
|
|
567
|
+
}) => number;
|
|
568
|
+
type AnimationFrameCallback = (timestamp: number) => any;
|
|
569
|
+
type RequestAnimationFrame = (callback: AnimationFrameCallback) => TimerId;
|
|
570
|
+
type CancelAnimationFrame = (id: TimerId) => void;
|
|
571
|
+
type CancelIdleCallback = (id: TimerId) => void;
|
|
572
|
+
type ClearImmediate = (id: NodeImmediate) => void;
|
|
573
|
+
type TemporalTimelike = {
|
|
574
|
+
epochMilliseconds: number;
|
|
575
|
+
};
|
|
576
|
+
type FakeMethod = "setTimeout" | "clearTimeout" | "setImmediate" | "clearImmediate" | "setInterval" | "clearInterval" | "Date" | "nextTick" | "hrtime" | "requestAnimationFrame" | "cancelAnimationFrame" | "requestIdleCallback" | "cancelIdleCallback" | "performance" | "queueMicrotask" | "Intl" | "Temporal";
|
|
577
|
+
type TimerId = number | NodeImmediate | Timer;
|
|
578
|
+
type GlobalObject = Record<string, any> & {
|
|
579
|
+
setTimeout?: SetTimeout;
|
|
580
|
+
clearTimeout?: ClearTimeout;
|
|
581
|
+
setInterval?: SetInterval;
|
|
582
|
+
clearInterval?: ClearInterval;
|
|
583
|
+
setImmediate?: SetImmediate;
|
|
584
|
+
clearImmediate?: ClearImmediate;
|
|
585
|
+
queueMicrotask?: QueueMicrotask;
|
|
586
|
+
requestAnimationFrame?: RequestAnimationFrame;
|
|
587
|
+
cancelAnimationFrame?: CancelAnimationFrame;
|
|
588
|
+
requestIdleCallback?: RequestIdleCallback;
|
|
589
|
+
cancelIdleCallback?: CancelIdleCallback;
|
|
590
|
+
process?: any;
|
|
591
|
+
performance?: any;
|
|
592
|
+
Performance?: any;
|
|
593
|
+
Intl?: any;
|
|
594
|
+
Temporal?: any;
|
|
595
|
+
Promise?: typeof Promise;
|
|
596
|
+
Date: typeof Date & {
|
|
597
|
+
isFake?: boolean;
|
|
598
|
+
toSource?: () => string;
|
|
599
|
+
clock?: any;
|
|
600
|
+
};
|
|
601
|
+
};
|
|
602
|
+
type TimerInitialProps = {
|
|
603
|
+
func: VoidVarArgsFunc;
|
|
604
|
+
args?: unknown[];
|
|
605
|
+
type?: 'Timeout' | 'Interval' | 'Immediate' | 'AnimationFrame' | 'IdleCallback';
|
|
606
|
+
delay?: number;
|
|
607
|
+
callAt?: number;
|
|
608
|
+
createdAt?: number;
|
|
609
|
+
immediate?: boolean;
|
|
610
|
+
id?: number;
|
|
611
|
+
error?: Error;
|
|
612
|
+
interval?: number;
|
|
613
|
+
animation?: boolean;
|
|
614
|
+
requestIdleCallback?: boolean;
|
|
615
|
+
order?: number;
|
|
616
|
+
heapIndex?: number;
|
|
617
|
+
};
|
|
618
|
+
type Config = {
|
|
619
|
+
now?: number | Date | TemporalTimelike;
|
|
620
|
+
toFake?: FakeMethod[];
|
|
621
|
+
toNotFake?: FakeMethod[];
|
|
622
|
+
loopLimit?: number;
|
|
623
|
+
shouldAdvanceTime?: boolean;
|
|
624
|
+
advanceTimeDelta?: number;
|
|
625
|
+
shouldClearNativeTimers?: boolean;
|
|
626
|
+
ignoreMissingTimers?: boolean;
|
|
627
|
+
target?: GlobalObject;
|
|
628
|
+
};
|
|
629
|
+
type Timer = TimerInitialProps;
|
|
630
|
+
type NodeImmediateHasRef = () => boolean;
|
|
631
|
+
type NodeImmediateRef = () => NodeImmediate;
|
|
632
|
+
type NodeImmediateUnref = () => NodeImmediate;
|
|
633
|
+
type NodeImmediate = {
|
|
634
|
+
hasRef: NodeImmediateHasRef;
|
|
635
|
+
ref: NodeImmediateRef;
|
|
636
|
+
unref: NodeImmediateUnref;
|
|
637
|
+
};
|
|
638
|
+
|
|
639
|
+
/**
|
|
640
|
+
* Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
|
|
641
|
+
*
|
|
642
|
+
* This source code is licensed under the MIT license found in the
|
|
643
|
+
* LICENSE file in the root directory of https://github.com/jestjs/jest.
|
|
644
|
+
*/
|
|
645
|
+
|
|
646
|
+
interface FakeTimersConfig extends Config {
|
|
647
|
+
/**
|
|
648
|
+
* Mock timer APIs imported from `node:timers` and `node:timers/promises`.
|
|
649
|
+
*
|
|
650
|
+
* @default false
|
|
651
|
+
*/
|
|
652
|
+
fakeNodeBuiltins?: boolean;
|
|
653
|
+
}
|
|
654
|
+
|
|
610
655
|
interface AfterSuiteRunMeta {
|
|
611
656
|
coverage?: unknown;
|
|
612
657
|
testFiles: string[];
|
|
@@ -2429,6 +2474,23 @@ interface TaskMeta {
|
|
|
2429
2474
|
__vitest_label__?: string;
|
|
2430
2475
|
}
|
|
2431
2476
|
/**
|
|
2477
|
+
* The result of an individual test attempt.
|
|
2478
|
+
*/
|
|
2479
|
+
interface TaskResultAttempt {
|
|
2480
|
+
/** The state after applying the test's expected failure option. */
|
|
2481
|
+
state: "pass" | "fail" | "skip";
|
|
2482
|
+
/** Errors produced by this attempt. */
|
|
2483
|
+
errors?: TestError[];
|
|
2484
|
+
/** How long in milliseconds the attempt took to run. */
|
|
2485
|
+
duration: number;
|
|
2486
|
+
/** Time in milliseconds when the attempt started running. */
|
|
2487
|
+
startTime: number;
|
|
2488
|
+
/** The zero-based retry index within the repeat. */
|
|
2489
|
+
retryIndex: number;
|
|
2490
|
+
/** The zero-based repeat index. */
|
|
2491
|
+
repeatIndex: number;
|
|
2492
|
+
}
|
|
2493
|
+
/**
|
|
2432
2494
|
* The result of calling a task.
|
|
2433
2495
|
*/
|
|
2434
2496
|
interface TaskResult {
|
|
@@ -2445,6 +2507,10 @@ interface TaskResult {
|
|
|
2445
2507
|
*/
|
|
2446
2508
|
errors?: TestError[];
|
|
2447
2509
|
/**
|
|
2510
|
+
* Individual results for every retry and repeat attempt.
|
|
2511
|
+
*/
|
|
2512
|
+
attempts?: TaskResultAttempt[];
|
|
2513
|
+
/**
|
|
2448
2514
|
* How long in milliseconds the task took to run.
|
|
2449
2515
|
*/
|
|
2450
2516
|
duration?: number;
|
|
@@ -3388,6 +3454,10 @@ interface FailureScreenshotArtifactAttachment extends TestAttachment {
|
|
|
3388
3454
|
interface FailureScreenshotArtifact extends TestArtifactBase {
|
|
3389
3455
|
type: "internal:failureScreenshot";
|
|
3390
3456
|
attachments: [FailureScreenshotArtifactAttachment] | [];
|
|
3457
|
+
/** The zero-based retry index of the attempt that took the screenshot. */
|
|
3458
|
+
retryIndex?: number;
|
|
3459
|
+
/** The zero-based repeat index of the attempt that took the screenshot. */
|
|
3460
|
+
repeatIndex?: number;
|
|
3391
3461
|
}
|
|
3392
3462
|
/**
|
|
3393
3463
|
* @experimental
|
|
@@ -3480,6 +3550,7 @@ interface FileSpecification {
|
|
|
3480
3550
|
testNamePattern?: RegExp | undefined;
|
|
3481
3551
|
testTagsFilter?: string[] | undefined;
|
|
3482
3552
|
testIds?: string[] | undefined;
|
|
3553
|
+
testNames?: string[] | undefined;
|
|
3483
3554
|
}
|
|
3484
3555
|
type VitestRunnerImportSource = "collect" | "setup";
|
|
3485
3556
|
type CancelReason = "keyboard-input" | "test-failure" | (string & Record<string, never>);
|
|
@@ -3655,7 +3726,7 @@ interface SerializedConfig {
|
|
|
3655
3726
|
restoreMocks: boolean;
|
|
3656
3727
|
unstubGlobals: boolean;
|
|
3657
3728
|
unstubEnvs: boolean;
|
|
3658
|
-
fakeTimers:
|
|
3729
|
+
fakeTimers: FakeTimersConfig;
|
|
3659
3730
|
defines: Record<string, any>;
|
|
3660
3731
|
expect: {
|
|
3661
3732
|
requireAssertions?: boolean;
|
|
@@ -3729,10 +3800,13 @@ interface SerializedConfig {
|
|
|
3729
3800
|
trace: BrowserTraceViewMode;
|
|
3730
3801
|
traceView: {
|
|
3731
3802
|
enabled: boolean;
|
|
3803
|
+
mode: BrowserTraceViewRecordingMode;
|
|
3732
3804
|
recordCanvas: boolean;
|
|
3733
3805
|
inlineImages: boolean;
|
|
3806
|
+
ariaSnapshot: boolean;
|
|
3734
3807
|
};
|
|
3735
3808
|
trackUnhandledErrors: boolean;
|
|
3809
|
+
importMapMocks: boolean | undefined;
|
|
3736
3810
|
detailsPanelPosition: "right" | "bottom";
|
|
3737
3811
|
};
|
|
3738
3812
|
standalone: boolean;
|
|
@@ -3761,6 +3835,7 @@ interface SerializedConfig {
|
|
|
3761
3835
|
viteModuleRunner: boolean;
|
|
3762
3836
|
nodeLoader: boolean;
|
|
3763
3837
|
recordDependencies: boolean;
|
|
3838
|
+
traceTimeline: boolean;
|
|
3764
3839
|
openTelemetry: {
|
|
3765
3840
|
enabled: boolean;
|
|
3766
3841
|
sdkPath?: string;
|
|
@@ -3791,7 +3866,8 @@ type RuntimeConfig = Pick<SerializedConfig, "allowOnly" | "testTimeout" | "hookT
|
|
|
3791
3866
|
};
|
|
3792
3867
|
};
|
|
3793
3868
|
type RuntimeOptions = Partial<RuntimeConfig>;
|
|
3869
|
+
type BrowserTraceViewRecordingMode = "off" | "on" | "failure-only";
|
|
3794
3870
|
type BrowserTraceViewMode = "on" | "off" | "on-first-retry" | "on-all-retries" | "retain-on-failure";
|
|
3795
3871
|
|
|
3796
|
-
export { _vitest_spy as _, createChainable as
|
|
3797
|
-
export type {
|
|
3872
|
+
export { fn as B, _vitest_spy as _, createChainable as a2, afterAll as b9, afterEach as ba, aroundAll as bb, aroundEach as bc, beforeAll as bd, beforeEach as be, onTestFailed as bf, onTestFinished as bg, disableDefaultColors as bj, SnapshotState as bq, format as f, inspect as i, stringify as s, spyOn as z };
|
|
3873
|
+
export type { TestTryOptions as $, Awaitable as A, MaybeMockedDeep as C, DiffOptions as D, ExpectStatic as E, FileSpecification as F, MaybeMocked as G, MaybePartiallyMocked as H, MaybePartiallyMockedDeep as I, MockInstance as J, TestAPI as K, LabelColor as L, ModuleGraphData as M, SuiteCollector as N, SuiteAPI as O, ParsedStack as P, Suite as Q, RuntimeOptions as R, SerializedCoverageConfig as S, TestError as T, UserConsoleLog as U, VitestRunner as V, SuiteHooks as W, VitestRunnerImportSource as X, Task as Y, CancelReason as Z, File as a, TestArtifactLocation as a$, TestContext as a0, ImportDuration as a1, AfterSuiteRunMeta as a3, Assertion as a4, AsymmetricMatchersContaining as a5, BaselineData as a6, Bench as a7, BenchFn as a8, BenchFnOptions as a9, Mocked as aA, MockedClass as aB, MockedFunction as aC, MockedObject as aD, OnTestFailedHandler as aE, OnTestFinishedHandler as aF, RunMode as aG, TaskBase as aH, TaskResult as aI, TaskResultAttempt as aJ, RuntimeConfig as aK, SerializedError as aL, SnapshotData as aM, SnapshotMatchOptions as aN, SnapshotResult as aO, SnapshotSerializer as aP, SnapshotStateOptions as aQ, SnapshotSummary as aR, SnapshotUpdateState as aS, SuiteFactory as aT, SuiteOptions as aU, TaskCustomOptions as aV, TaskMeta as aW, TaskState as aX, TestAnnotationArtifact as aY, TestAnnotationLocation as aZ, TestArtifactBase as a_, BenchFromSource as aa, BenchOptions as ab, BenchRegistration as ac, BenchRegistrationInput as ad, BenchResult as ae, BenchRunOptions as af, BenchStorage as ag, BenchmarkGroup as ah, BenchmarkProvider as ai, BrowserTraceArtifact as aj, DeeplyAllowMatchers as ak, DomainMatchResult as al, FailureScreenshotArtifact as am, JestAssertion as an, RawMatcherFn as ao, Matchers as ap, MatchersObject as aq, MockContext as ar, MockResult as as, MockResultIncomplete as at, MockResultReturn as au, MockResultThrow as av, MockSettledResult as aw, MockSettledResultFulfilled as ax, MockSettledResultIncomplete as ay, MockSettledResultRejected as az, SerializedConfig as b, TestArtifactRegistry as b0, TestAttachment as b1, TestBenchmark as b2, TestBenchmarkTask as b3, TestFunction as b4, TestOptions as b5, TestTags as b6, UncheckedSnapshot as b7, VisualRegressionArtifact as b8, SequenceHooks as bh, SequenceSetupFiles as bi, SerializableRetry as bk, BrowserTraceViewMode as bl, BrowserTraceViewRecordingMode as bm, Arrayable as bn, AsyncLeak as bo, PrettyFormatOptions as bp, PromisifyAssertion as br, Tester as bs, Plugin as bt, SnapshotEnvironment as bu, SnapshotEnvironmentOptions as bv, FetchCachedFileSystemResult as bw, ResolveFunctionResult as bx, SerializedDiffOptions as c, StringifyOptions as d, FakeTimersConfig as e, TestTagDefinition as g, TestAnnotation as h, TestArtifact as j, TaskResultPack as k, TaskEventPack as l, SerializedRootConfig as m, Test as n, TaskPopulated as o, ProvidedContext as p, MatcherState as q, SyncExpectationResult as r, AsyncExpectationResult as t, DomainSnapshotAdapter as u, ExpectationResult as v, Procedure as w, Mock as x, TemporalTimelike as y };
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { Console } from 'node:console';
|
|
2
2
|
import { relative } from 'node:path';
|
|
3
3
|
import { Writable } from 'node:stream';
|
|
4
|
-
import { a as getSafeTimers } from './source-map.
|
|
4
|
+
import { a as getSafeTimers } from './source-map.DakdQc29.js';
|
|
5
5
|
import { $ } from './tinyrainbow.Do8I1XRG.js';
|
|
6
|
-
import { g as getWorkerState } from './utils.DYj33du9.js';
|
|
6
|
+
import { g as getWorkerState, E as EnvironmentTeardownError } from './utils.DYj33du9.js';
|
|
7
7
|
import './index.D0heQG4v.js';
|
|
8
|
-
import './pathe.M-eThtNZ.
|
|
8
|
+
import './pathe.M-eThtNZ.zq3TM4NT.js';
|
|
9
9
|
|
|
10
10
|
const RealDate = globalThis.Date;
|
|
11
11
|
const UNKNOWN_TEST_ID = "__vitest__unknown_test__";
|
|
@@ -78,6 +78,9 @@ function createCustomConsole(defaultState) {
|
|
|
78
78
|
time: time || RealDate.now(),
|
|
79
79
|
size,
|
|
80
80
|
origin
|
|
81
|
+
}).catch((error) => {
|
|
82
|
+
// the log is already sent, the worker only closed before the reporter answered
|
|
83
|
+
if (!(error instanceof EnvironmentTeardownError)) throw error;
|
|
81
84
|
});
|
|
82
85
|
}
|
|
83
86
|
const stdout = new Writable({ write(data, encoding, callback) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// if changed, update also jsdocs and docs
|
|
2
2
|
const defaultPort = 51204;
|
|
3
|
-
const defaultBrowserPort =
|
|
3
|
+
const defaultBrowserPort = 23315;
|
|
4
4
|
const defaultInspectPort = 9229;
|
|
5
5
|
const API_PATH = "/__vitest_api__";
|
|
6
6
|
const CONFIG_NAMES = ["vitest.config", "vite.config"];
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { r as resolveCoverageProviderModule } from './coverage.
|
|
1
|
+
import { r as resolveCoverageProviderModule } from './coverage.jGCktcGP.js';
|
|
2
2
|
|
|
3
3
|
async function startCoverageInsideWorker(options, loader, runtimeOptions) {
|
|
4
4
|
const coverageModule = await resolveCoverageProviderModule(options, loader);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { r as resolve } from './pathe.M-eThtNZ.
|
|
1
|
+
import { r as resolve } from './pathe.M-eThtNZ.zq3TM4NT.js';
|
|
2
2
|
|
|
3
3
|
function getCoverageFilesDirectory(reportsDirectory, shard) {
|
|
4
4
|
return resolve(reportsDirectory, `.tmp${shard ? `-${shard.index}-${shard.count}` : ""}`);
|
|
@@ -2,13 +2,13 @@ import { existsSync, writeFileSync, readFileSync } from 'node:fs';
|
|
|
2
2
|
import { mkdir, writeFile } from 'node:fs/promises';
|
|
3
3
|
import { resolve, dirname, relative } from 'node:path';
|
|
4
4
|
import { detectPackageManager, installPackage } from './index.BoyTG_B7.js';
|
|
5
|
-
import { p as prompt, n as findConfigFile } from './index.
|
|
5
|
+
import { p as prompt, n as findConfigFile } from './index.Di8au7q4.js';
|
|
6
6
|
import { x } from 'tinyexec';
|
|
7
7
|
import { $ } from './tinyrainbow.Do8I1XRG.js';
|
|
8
8
|
import 'node:process';
|
|
9
9
|
import 'node:url';
|
|
10
|
-
import './pathe.M-eThtNZ.
|
|
11
|
-
import './nativeModuleRunner.
|
|
10
|
+
import './pathe.M-eThtNZ.zq3TM4NT.js';
|
|
11
|
+
import './nativeModuleRunner.9xPIMzi7.js';
|
|
12
12
|
import 'node:module';
|
|
13
13
|
import 'node:assert';
|
|
14
14
|
import 'node:v8';
|
|
@@ -16,7 +16,7 @@ import 'node:util';
|
|
|
16
16
|
import 'vite/module-runner';
|
|
17
17
|
import 'tinyglobby';
|
|
18
18
|
import 'vite';
|
|
19
|
-
import './constants
|
|
19
|
+
import './constants.DLYM6cZY.js';
|
|
20
20
|
import './defaults.B1FCaFfh.js';
|
|
21
21
|
import 'node:os';
|
|
22
22
|
import './env.BKKtU2WC.js';
|
|
@@ -31,24 +31,24 @@ import 'node:stream';
|
|
|
31
31
|
import './display.BlTmubjj.js';
|
|
32
32
|
import './index.D0heQG4v.js';
|
|
33
33
|
import 'node:perf_hooks';
|
|
34
|
-
import './source-map.
|
|
35
|
-
import './run.
|
|
34
|
+
import './source-map.DakdQc29.js';
|
|
35
|
+
import './run.CjdgFZiW.js';
|
|
36
36
|
import '../task-utils.js';
|
|
37
37
|
import 'obug';
|
|
38
|
-
import './resolver.
|
|
38
|
+
import './resolver.BzpmeQeT.js';
|
|
39
39
|
import 'es-module-lexer';
|
|
40
40
|
import './offset.Dy-5Fdfn.js';
|
|
41
|
-
import './utils.
|
|
41
|
+
import './utils.BBk_icFG.js';
|
|
42
42
|
import '#module-evaluator';
|
|
43
43
|
import 'picomatch';
|
|
44
|
-
import './module-dependencies.
|
|
45
|
-
import './coverage.
|
|
44
|
+
import './module-dependencies._2Eei3FO.js';
|
|
45
|
+
import './coverage.jGCktcGP.js';
|
|
46
46
|
import 'node:tty';
|
|
47
47
|
import 'node:events';
|
|
48
48
|
import './index.DmDMHCg8.js';
|
|
49
49
|
import 'node:child_process';
|
|
50
50
|
import 'node:worker_threads';
|
|
51
|
-
import './cac.
|
|
51
|
+
import './cac.BYbt0aJp.js';
|
|
52
52
|
import 'events';
|
|
53
53
|
import 'readline';
|
|
54
54
|
|
|
@@ -4,7 +4,7 @@ import { tmpdir } from 'node:os';
|
|
|
4
4
|
import { join } from 'node:path';
|
|
5
5
|
import { performance } from 'node:perf_hooks';
|
|
6
6
|
import { pathToFileURL } from 'node:url';
|
|
7
|
-
import { t as toArray, r as resolve } from './pathe.M-eThtNZ.
|
|
7
|
+
import { t as toArray, r as resolve } from './pathe.M-eThtNZ.zq3TM4NT.js';
|
|
8
8
|
import { $ } from './tinyrainbow.Do8I1XRG.js';
|
|
9
9
|
import { distDir } from '../path.js';
|
|
10
10
|
|
|
@@ -100,7 +100,7 @@ function log(...args) {
|
|
|
100
100
|
console.log(...args);
|
|
101
101
|
}
|
|
102
102
|
async function doctor(cliFilters, options) {
|
|
103
|
-
const { prepareVitest } = await import('./cli-api.
|
|
103
|
+
const { prepareVitest } = await import('./cli-api.COfZo8lK.js').then(function (n) { return n.j; });
|
|
104
104
|
log();
|
|
105
105
|
log($.inverse($.bold($.blue(" DOCTOR "))), "resolving the current configuration...");
|
|
106
106
|
const ctx = await prepareVitest({
|
|
@@ -1,18 +1,19 @@
|
|
|
1
|
-
import { g as globalApis } from './constants
|
|
2
|
-
import { i as index } from './index.
|
|
3
|
-
import './run.
|
|
1
|
+
import { g as globalApis } from './constants.DLYM6cZY.js';
|
|
2
|
+
import { i as index } from './index.CZzC1gGg.js';
|
|
3
|
+
import './run.CjdgFZiW.js';
|
|
4
4
|
import './index.D0heQG4v.js';
|
|
5
5
|
import './tinyrainbow.Do8I1XRG.js';
|
|
6
6
|
import './display.BlTmubjj.js';
|
|
7
|
-
import './pathe.M-eThtNZ.
|
|
8
|
-
import './source-map.
|
|
7
|
+
import './pathe.M-eThtNZ.zq3TM4NT.js';
|
|
8
|
+
import './source-map.DakdQc29.js';
|
|
9
9
|
import '../task-utils.js';
|
|
10
10
|
import './utils.DYj33du9.js';
|
|
11
11
|
import './spy.DDMXghXv.js';
|
|
12
12
|
import 'chai';
|
|
13
13
|
import './plugins.DPQHVT0p.js';
|
|
14
|
+
import './rawSnapshot.DqSiqIEx.js';
|
|
14
15
|
import './offset.Dy-5Fdfn.js';
|
|
15
|
-
import './rpc.
|
|
16
|
+
import './rpc.Uhkwr2NM.js';
|
|
16
17
|
import 'vite/module-runner';
|
|
17
18
|
import './index.DmDMHCg8.js';
|
|
18
19
|
import 'tinybench';
|