vitest 5.0.4 → 5.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/LICENSE.md +1 -1
- package/dist/browser.d.ts +4 -4
- package/dist/browser.js +3 -3
- package/dist/chunks/{base.CYbb9pQW.js → base.PJyN9N0u.js} +13 -11
- package/dist/chunks/{browser.d.FGQ9_rK6.d.ts → browser.d.D7a15z82.d.ts} +4 -3
- package/dist/chunks/{cac.DTXWs6Ni.js → cac.Ccf5Je_F.js} +21 -9
- package/dist/chunks/{cli-api.Bx28WXzL.js → cli-api.DE22LIzq.js} +4584 -4369
- package/dist/chunks/{config.d.QBNYCgFU.d.ts → config.d.BgktgHfG.d.ts} +134 -93
- package/dist/chunks/{console.DtI4yxfN.js → console.DrMPSuFo.js} +5 -2
- package/dist/chunks/{constants.-juJ8b_4.js → constants.DLYM6cZY.js} +1 -1
- package/dist/chunks/{creator.CLL8QFMS.js → creator.BQ3onxbh.js} +5 -5
- package/dist/chunks/{doctor.Bqc8NDDb.js → doctor.CPlMs7-y.js} +1 -1
- package/dist/chunks/{environment.d.BY56MoGs.d.ts → environment.d.CbTLsZSj.d.ts} +1 -1
- package/dist/chunks/{globals.CTWMSIPL.js → globals.TipXUFcZ.js} +5 -5
- package/dist/chunks/{index.GYMZ12wH.js → index.B03wg4V0.js} +5 -3
- package/dist/chunks/{index.CPNMO3h-.js → index.BFXLpwll.js} +119 -43
- package/dist/chunks/{index.uwTEEBsB.js → index.BXttT2gP.js} +37 -18
- package/dist/chunks/{index.B8VfM7Mf.js → index.D14IAvnE.js} +149 -96
- package/dist/chunks/{init-forks.CbYYa5xq.js → init-forks.BL1E3__4.js} +1 -1
- package/dist/chunks/{init-threads.DtjdvxPl.js → init-threads.CYXAGzKQ.js} +1 -1
- package/dist/chunks/{init.DrHtV5zd.js → init.DVorxUyL.js} +3 -3
- package/dist/chunks/{nativeModuleMocker.D8f4cW4A.js → nativeModuleMocker.3uBcOd84.js} +26 -4
- package/dist/chunks/{plugin.d.C8mmycim.d.ts → plugin.d.olEn8IL9.d.ts} +108 -20
- package/dist/chunks/{rpc.DpkUyY1N.js → rpc.BV0XpJ5q.js} +1 -1
- package/dist/chunks/{rpc.d.Cft1biqy.d.ts → rpc.d.DGFP7vWr.d.ts} +1 -1
- package/dist/chunks/{run.Cm2sd7-x.js → run.BfrMbGVD.js} +59 -32
- package/dist/chunks/{setup-common.BABL3z3m.js → setup-common.llxJkJaD.js} +2 -2
- package/dist/chunks/{source-map.DdKI5IHB.js → source-map.BjWcsIL9.js} +32 -24
- package/dist/chunks/{source-map.d.kzFtk_dj.d.ts → source-map.d.C5A_Tr6V.d.ts} +2 -1
- package/dist/chunks/{task-utils.d.PFh2BV6Q.d.ts → task-utils.d.BUh7ylUT.d.ts} +2 -1
- package/dist/chunks/{vm.Uo_C9Uld.js → vm.Cwj01UFE.js} +16 -5
- package/dist/chunks/{worker.d.BH-r1bPu.d.ts → worker.d.gsA26mmR.d.ts} +3 -3
- package/dist/cli.js +2 -2
- package/dist/config.cjs +1 -1
- package/dist/config.d.ts +11 -11
- package/dist/config.js +1 -1
- package/dist/index.d.ts +14 -13
- package/dist/index.js +4 -4
- package/dist/module-evaluator.d.ts +3 -2
- package/dist/module-evaluator.js +16 -12
- package/dist/node.d.ts +29 -11
- package/dist/node.js +7 -7
- package/dist/runtime.d.ts +4 -4
- package/dist/runtime.js +3 -2
- package/dist/task-utils.js +3 -1
- package/dist/worker.d.ts +4 -4
- package/dist/worker.js +9 -9
- package/dist/workers/forks.js +10 -10
- package/dist/workers/runVmTests.js +10 -8
- package/dist/workers/threads.js +10 -10
- package/dist/workers/vmForks.js +9 -8
- package/dist/workers/vmThreads.js +9 -8
- package/package.json +14 -14
|
@@ -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 {
|
|
@@ -607,6 +521,109 @@ interface Memorize {
|
|
|
607
521
|
declare function diff(a: any, b: any, options?: DiffOptions, memorize?: Memorize): string | undefined;
|
|
608
522
|
declare function printDiffOrStringify(received: unknown, expected: unknown, options?: DiffOptions, memory?: StringifiedMemory): string | undefined;
|
|
609
523
|
|
|
524
|
+
type VoidVarArgsFunc = (...args: unknown[]) => void;
|
|
525
|
+
type SetImmediate = (callback: VoidVarArgsFunc, ...args: unknown[]) => NodeImmediate;
|
|
526
|
+
type SetTimeout = (callback: VoidVarArgsFunc, delay?: number, ...args: unknown[]) => TimerId;
|
|
527
|
+
type ClearTimeout = (id?: TimerId) => void;
|
|
528
|
+
type SetInterval = (callback: VoidVarArgsFunc, delay?: number, ...args: unknown[]) => TimerId;
|
|
529
|
+
type ClearInterval = (id?: TimerId) => void;
|
|
530
|
+
type QueueMicrotask = (callback: VoidVarArgsFunc) => void;
|
|
531
|
+
type TimeRemaining = () => number;
|
|
532
|
+
type IdleDeadline = {
|
|
533
|
+
didTimeout: boolean;
|
|
534
|
+
timeRemaining: TimeRemaining;
|
|
535
|
+
};
|
|
536
|
+
type RequestIdleCallbackCallback = (deadline: IdleDeadline) => any;
|
|
537
|
+
type RequestIdleCallback = (callback: RequestIdleCallbackCallback, options?: {
|
|
538
|
+
timeout?: number;
|
|
539
|
+
}) => number;
|
|
540
|
+
type AnimationFrameCallback = (timestamp: number) => any;
|
|
541
|
+
type RequestAnimationFrame = (callback: AnimationFrameCallback) => TimerId;
|
|
542
|
+
type CancelAnimationFrame = (id: TimerId) => void;
|
|
543
|
+
type CancelIdleCallback = (id: TimerId) => void;
|
|
544
|
+
type ClearImmediate = (id: NodeImmediate) => void;
|
|
545
|
+
type TemporalTimelike = {
|
|
546
|
+
epochMilliseconds: number;
|
|
547
|
+
};
|
|
548
|
+
type FakeMethod = "setTimeout" | "clearTimeout" | "setImmediate" | "clearImmediate" | "setInterval" | "clearInterval" | "Date" | "nextTick" | "hrtime" | "requestAnimationFrame" | "cancelAnimationFrame" | "requestIdleCallback" | "cancelIdleCallback" | "performance" | "queueMicrotask" | "Intl" | "Temporal";
|
|
549
|
+
type TimerId = number | NodeImmediate | Timer;
|
|
550
|
+
type GlobalObject = Record<string, any> & {
|
|
551
|
+
setTimeout?: SetTimeout;
|
|
552
|
+
clearTimeout?: ClearTimeout;
|
|
553
|
+
setInterval?: SetInterval;
|
|
554
|
+
clearInterval?: ClearInterval;
|
|
555
|
+
setImmediate?: SetImmediate;
|
|
556
|
+
clearImmediate?: ClearImmediate;
|
|
557
|
+
queueMicrotask?: QueueMicrotask;
|
|
558
|
+
requestAnimationFrame?: RequestAnimationFrame;
|
|
559
|
+
cancelAnimationFrame?: CancelAnimationFrame;
|
|
560
|
+
requestIdleCallback?: RequestIdleCallback;
|
|
561
|
+
cancelIdleCallback?: CancelIdleCallback;
|
|
562
|
+
process?: any;
|
|
563
|
+
performance?: any;
|
|
564
|
+
Performance?: any;
|
|
565
|
+
Intl?: any;
|
|
566
|
+
Temporal?: any;
|
|
567
|
+
Promise?: typeof Promise;
|
|
568
|
+
Date: typeof Date & {
|
|
569
|
+
isFake?: boolean;
|
|
570
|
+
toSource?: () => string;
|
|
571
|
+
clock?: any;
|
|
572
|
+
};
|
|
573
|
+
};
|
|
574
|
+
type TimerInitialProps = {
|
|
575
|
+
func: VoidVarArgsFunc;
|
|
576
|
+
args?: unknown[];
|
|
577
|
+
type?: 'Timeout' | 'Interval' | 'Immediate' | 'AnimationFrame' | 'IdleCallback';
|
|
578
|
+
delay?: number;
|
|
579
|
+
callAt?: number;
|
|
580
|
+
createdAt?: number;
|
|
581
|
+
immediate?: boolean;
|
|
582
|
+
id?: number;
|
|
583
|
+
error?: Error;
|
|
584
|
+
interval?: number;
|
|
585
|
+
animation?: boolean;
|
|
586
|
+
requestIdleCallback?: boolean;
|
|
587
|
+
order?: number;
|
|
588
|
+
heapIndex?: number;
|
|
589
|
+
};
|
|
590
|
+
type Config = {
|
|
591
|
+
now?: number | Date | TemporalTimelike;
|
|
592
|
+
toFake?: FakeMethod[];
|
|
593
|
+
toNotFake?: FakeMethod[];
|
|
594
|
+
loopLimit?: number;
|
|
595
|
+
shouldAdvanceTime?: boolean;
|
|
596
|
+
advanceTimeDelta?: number;
|
|
597
|
+
shouldClearNativeTimers?: boolean;
|
|
598
|
+
ignoreMissingTimers?: boolean;
|
|
599
|
+
target?: GlobalObject;
|
|
600
|
+
};
|
|
601
|
+
type Timer = TimerInitialProps;
|
|
602
|
+
type NodeImmediateHasRef = () => boolean;
|
|
603
|
+
type NodeImmediateRef = () => NodeImmediate;
|
|
604
|
+
type NodeImmediateUnref = () => NodeImmediate;
|
|
605
|
+
type NodeImmediate = {
|
|
606
|
+
hasRef: NodeImmediateHasRef;
|
|
607
|
+
ref: NodeImmediateRef;
|
|
608
|
+
unref: NodeImmediateUnref;
|
|
609
|
+
};
|
|
610
|
+
|
|
611
|
+
/**
|
|
612
|
+
* Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
|
|
613
|
+
*
|
|
614
|
+
* This source code is licensed under the MIT license found in the
|
|
615
|
+
* LICENSE file in the root directory of https://github.com/jestjs/jest.
|
|
616
|
+
*/
|
|
617
|
+
|
|
618
|
+
interface FakeTimersConfig extends Config {
|
|
619
|
+
/**
|
|
620
|
+
* Mock timer APIs imported from `node:timers` and `node:timers/promises`.
|
|
621
|
+
*
|
|
622
|
+
* @default false
|
|
623
|
+
*/
|
|
624
|
+
fakeNodeBuiltins?: boolean;
|
|
625
|
+
}
|
|
626
|
+
|
|
610
627
|
interface AfterSuiteRunMeta {
|
|
611
628
|
coverage?: unknown;
|
|
612
629
|
testFiles: string[];
|
|
@@ -2429,6 +2446,23 @@ interface TaskMeta {
|
|
|
2429
2446
|
__vitest_label__?: string;
|
|
2430
2447
|
}
|
|
2431
2448
|
/**
|
|
2449
|
+
* The result of an individual test attempt.
|
|
2450
|
+
*/
|
|
2451
|
+
interface TaskResultAttempt {
|
|
2452
|
+
/** The state after applying the test's expected failure option. */
|
|
2453
|
+
state: "pass" | "fail" | "skip";
|
|
2454
|
+
/** Errors produced by this attempt. */
|
|
2455
|
+
errors?: TestError[];
|
|
2456
|
+
/** How long in milliseconds the attempt took to run. */
|
|
2457
|
+
duration: number;
|
|
2458
|
+
/** Time in milliseconds when the attempt started running. */
|
|
2459
|
+
startTime: number;
|
|
2460
|
+
/** The zero-based retry index within the repeat. */
|
|
2461
|
+
retryIndex: number;
|
|
2462
|
+
/** The zero-based repeat index. */
|
|
2463
|
+
repeatIndex: number;
|
|
2464
|
+
}
|
|
2465
|
+
/**
|
|
2432
2466
|
* The result of calling a task.
|
|
2433
2467
|
*/
|
|
2434
2468
|
interface TaskResult {
|
|
@@ -2445,6 +2479,10 @@ interface TaskResult {
|
|
|
2445
2479
|
*/
|
|
2446
2480
|
errors?: TestError[];
|
|
2447
2481
|
/**
|
|
2482
|
+
* Individual results for every retry and repeat attempt.
|
|
2483
|
+
*/
|
|
2484
|
+
attempts?: TaskResultAttempt[];
|
|
2485
|
+
/**
|
|
2448
2486
|
* How long in milliseconds the task took to run.
|
|
2449
2487
|
*/
|
|
2450
2488
|
duration?: number;
|
|
@@ -3480,6 +3518,7 @@ interface FileSpecification {
|
|
|
3480
3518
|
testNamePattern?: RegExp | undefined;
|
|
3481
3519
|
testTagsFilter?: string[] | undefined;
|
|
3482
3520
|
testIds?: string[] | undefined;
|
|
3521
|
+
testNames?: string[] | undefined;
|
|
3483
3522
|
}
|
|
3484
3523
|
type VitestRunnerImportSource = "collect" | "setup";
|
|
3485
3524
|
type CancelReason = "keyboard-input" | "test-failure" | (string & Record<string, never>);
|
|
@@ -3655,7 +3694,7 @@ interface SerializedConfig {
|
|
|
3655
3694
|
restoreMocks: boolean;
|
|
3656
3695
|
unstubGlobals: boolean;
|
|
3657
3696
|
unstubEnvs: boolean;
|
|
3658
|
-
fakeTimers:
|
|
3697
|
+
fakeTimers: FakeTimersConfig;
|
|
3659
3698
|
defines: Record<string, any>;
|
|
3660
3699
|
expect: {
|
|
3661
3700
|
requireAssertions?: boolean;
|
|
@@ -3731,8 +3770,10 @@ interface SerializedConfig {
|
|
|
3731
3770
|
enabled: boolean;
|
|
3732
3771
|
recordCanvas: boolean;
|
|
3733
3772
|
inlineImages: boolean;
|
|
3773
|
+
ariaSnapshot: boolean;
|
|
3734
3774
|
};
|
|
3735
3775
|
trackUnhandledErrors: boolean;
|
|
3776
|
+
importMapMocks: boolean | undefined;
|
|
3736
3777
|
detailsPanelPosition: "right" | "bottom";
|
|
3737
3778
|
};
|
|
3738
3779
|
standalone: boolean;
|
|
@@ -3793,5 +3834,5 @@ type RuntimeConfig = Pick<SerializedConfig, "allowOnly" | "testTimeout" | "hookT
|
|
|
3793
3834
|
type RuntimeOptions = Partial<RuntimeConfig>;
|
|
3794
3835
|
type BrowserTraceViewMode = "on" | "off" | "on-first-retry" | "on-all-retries" | "retain-on-failure";
|
|
3795
3836
|
|
|
3796
|
-
export { _vitest_spy as _, createChainable as
|
|
3797
|
-
export type {
|
|
3837
|
+
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 bp, format as f, inspect as i, stringify as s, spyOn as z };
|
|
3838
|
+
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, Arrayable as bm, AsyncLeak as bn, PrettyFormatOptions as bo, PromisifyAssertion as bq, Tester as br, Plugin as bs, SnapshotEnvironment as bt, SnapshotEnvironmentOptions as bu, FetchCachedFileSystemResult as bv, ResolveFunctionResult as bw, 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,9 +1,9 @@
|
|
|
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.BjWcsIL9.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
8
|
import './pathe.M-eThtNZ.Ba-7h1rE.js';
|
|
9
9
|
|
|
@@ -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"];
|
|
@@ -2,7 +2,7 @@ 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.D14IAvnE.js';
|
|
6
6
|
import { x } from 'tinyexec';
|
|
7
7
|
import { $ } from './tinyrainbow.Do8I1XRG.js';
|
|
8
8
|
import 'node:process';
|
|
@@ -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,8 +31,8 @@ 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.BjWcsIL9.js';
|
|
35
|
+
import './run.BfrMbGVD.js';
|
|
36
36
|
import '../task-utils.js';
|
|
37
37
|
import 'obug';
|
|
38
38
|
import './resolver.CtCcxIy1.js';
|
|
@@ -48,7 +48,7 @@ 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.Ccf5Je_F.js';
|
|
52
52
|
import 'events';
|
|
53
53
|
import 'readline';
|
|
54
54
|
|
|
@@ -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.DE22LIzq.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,18 @@
|
|
|
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.BXttT2gP.js';
|
|
3
|
+
import './run.BfrMbGVD.js';
|
|
4
4
|
import './index.D0heQG4v.js';
|
|
5
5
|
import './tinyrainbow.Do8I1XRG.js';
|
|
6
6
|
import './display.BlTmubjj.js';
|
|
7
7
|
import './pathe.M-eThtNZ.Ba-7h1rE.js';
|
|
8
|
-
import './source-map.
|
|
8
|
+
import './source-map.BjWcsIL9.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
14
|
import './offset.Dy-5Fdfn.js';
|
|
15
|
-
import './rpc.
|
|
15
|
+
import './rpc.BV0XpJ5q.js';
|
|
16
16
|
import 'vite/module-runner';
|
|
17
17
|
import './index.DmDMHCg8.js';
|
|
18
18
|
import 'tinybench';
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import * as chai from 'chai';
|
|
2
2
|
import { createHook } from 'node:async_hooks';
|
|
3
3
|
import { t as takeCoverageInsideWorker } from './coverage.-bm5IxnW.js';
|
|
4
|
-
import { r as rpc } from './rpc.
|
|
5
|
-
import { l as loadDiffConfig, a as loadSnapshotSerializers } from './setup-common.
|
|
4
|
+
import { r as rpc } from './rpc.BV0XpJ5q.js';
|
|
5
|
+
import { l as loadDiffConfig, a as loadSnapshotSerializers } from './setup-common.llxJkJaD.js';
|
|
6
6
|
import { g as getWorkerState } from './utils.DYj33du9.js';
|
|
7
|
-
import { T as TestRunner } from './index.
|
|
7
|
+
import { T as TestRunner } from './index.BXttT2gP.js';
|
|
8
8
|
|
|
9
9
|
function setupChaiConfig(config) {
|
|
10
10
|
Object.assign(chai.config, config);
|
|
@@ -50,6 +50,8 @@ function detectAsyncLeaks(testFile, projectName) {
|
|
|
50
50
|
} finally {
|
|
51
51
|
Error.stackTraceLimit = limit;
|
|
52
52
|
}
|
|
53
|
+
// a builtin loaded on first use can create pending promises at the module level
|
|
54
|
+
if (stack.includes("node:internal/bootstrap/realm")) return;
|
|
53
55
|
if (!stack.includes(testFile)) {
|
|
54
56
|
const trigger = resources.get(triggerAsyncId);
|
|
55
57
|
if (!trigger) return;
|