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.
Files changed (62) hide show
  1. package/LICENSE.md +1 -1
  2. package/dist/browser.d.ts +6 -5
  3. package/dist/browser.js +6 -6
  4. package/dist/chunks/{base.CzXt2BO_.js → base.Cof-UHJf.js} +17 -21
  5. package/dist/chunks/{browser.d.FGQ9_rK6.d.ts → browser.d.C7tWgUvw.d.ts} +4 -3
  6. package/dist/chunks/{cac.CLrZKo1g.js → cac.BYbt0aJp.js} +30 -16
  7. package/dist/chunks/{cli-api.De07GUeT.js → cli-api.COfZo8lK.js} +5226 -4385
  8. package/dist/chunks/{config.d.QBNYCgFU.d.ts → config.d.B3YV4t0O.d.ts} +169 -93
  9. package/dist/chunks/{console.DtI4yxfN.js → console.CQZ877Hi.js} +6 -3
  10. package/dist/chunks/{constants.-juJ8b_4.js → constants.DLYM6cZY.js} +1 -1
  11. package/dist/chunks/{coverage.-bm5IxnW.js → coverage.9iqXE2gN.js} +1 -1
  12. package/dist/chunks/{coverage.cTDc4uSS.js → coverage.jGCktcGP.js} +1 -1
  13. package/dist/chunks/{creator.C5g4egeG.js → creator.DHWmytIK.js} +11 -11
  14. package/dist/chunks/{doctor.BK86Cncq.js → doctor.B-oPbwps.js} +2 -2
  15. package/dist/chunks/{environment.d.BY56MoGs.d.ts → environment.d.BFQtFKdZ.d.ts} +1 -1
  16. package/dist/chunks/{globals.CXEE6_2C.js → globals.ZKtKSkEf.js} +7 -6
  17. package/dist/chunks/{index.CK-t0WMg.js → index.Bi0NXYPf.js} +165 -62
  18. package/dist/chunks/{index.aTZaPVhf.js → index.CZzC1gGg.js} +299 -440
  19. package/dist/chunks/{index.1TqnEahn.js → index.Di8au7q4.js} +104 -72
  20. package/dist/chunks/{index.CoUIxZd4.js → index.w_oBZ9N8.js} +5 -5
  21. package/dist/chunks/{init-forks.CRxIPOJR.js → init-forks.BaDXQSD8.js} +1 -1
  22. package/dist/chunks/{init-threads.Dv3kwST_.js → init-threads.ZX_Vov0z.js} +1 -1
  23. package/dist/chunks/{init.PvxYpuCm.js → init.CO4AB7HZ.js} +4 -4
  24. package/dist/chunks/{module-dependencies.CwNPkcV4.js → module-dependencies._2Eei3FO.js} +1 -1
  25. package/dist/chunks/{native.cdzHIdmv.js → native.upB-V0CK.js} +1 -1
  26. package/dist/chunks/{nativeModuleMocker.BxrHJNAF.js → nativeModuleMocker.Dh5azSB4.js} +4 -3
  27. package/dist/chunks/{nativeModuleRunner.xi64Afb2.js → nativeModuleRunner.9xPIMzi7.js} +1 -1
  28. package/dist/chunks/{node.uQulW0ei.js → node.B9mkVmLH.js} +1 -1
  29. package/dist/chunks/{pathe.M-eThtNZ.Ba-7h1rE.js → pathe.M-eThtNZ.zq3TM4NT.js} +1 -1
  30. package/dist/chunks/{plugin.d.C8mmycim.d.ts → plugin.d.LRFSN46m.d.ts} +191 -32
  31. package/dist/chunks/rawSnapshot.DqSiqIEx.js +356 -0
  32. package/dist/chunks/{resolver.CtCcxIy1.js → resolver.BzpmeQeT.js} +1 -1
  33. package/dist/chunks/{rpc.DpkUyY1N.js → rpc.Uhkwr2NM.js} +2 -2
  34. package/dist/chunks/{rpc.d.Cft1biqy.d.ts → rpc.d.3FOhdFx8.d.ts} +1 -1
  35. package/dist/chunks/{run.BPv-BBRv.js → run.CjdgFZiW.js} +28 -7
  36. package/dist/chunks/{setup-common.HGAqWOnX.js → setup-common.CqAQCXzx.js} +2 -2
  37. package/dist/chunks/{source-map.DdKI5IHB.js → source-map.DakdQc29.js} +43 -37
  38. package/dist/chunks/{source-map.d.kzFtk_dj.d.ts → source-map.d.BkG8YK_3.d.ts} +2 -1
  39. package/dist/chunks/{task-utils.d.PFh2BV6Q.d.ts → task-utils.d.D-gFPNFi.d.ts} +2 -1
  40. package/dist/chunks/{utils.DSfl_w8V.js → utils.BBk_icFG.js} +6 -3
  41. package/dist/chunks/{vm.FGl2rw_t.js → vm.b4MbCAJQ.js} +27 -14
  42. package/dist/chunks/{worker.d.BH-r1bPu.d.ts → worker.d.CyJRpyfZ.d.ts} +3 -3
  43. package/dist/cli.js +3 -3
  44. package/dist/config.cjs +1 -1
  45. package/dist/config.d.ts +11 -11
  46. package/dist/config.js +1 -1
  47. package/dist/index.d.ts +21 -15
  48. package/dist/index.js +6 -5
  49. package/dist/module-evaluator.d.ts +3 -2
  50. package/dist/node.d.ts +30 -12
  51. package/dist/node.js +16 -14
  52. package/dist/runtime.d.ts +4 -4
  53. package/dist/runtime.js +5 -4
  54. package/dist/task-utils.js +10 -4
  55. package/dist/worker.d.ts +4 -4
  56. package/dist/worker.js +14 -13
  57. package/dist/workers/forks.js +15 -14
  58. package/dist/workers/runVmTests.js +16 -12
  59. package/dist/workers/threads.js +15 -14
  60. package/dist/workers/vmForks.js +11 -10
  61. package/dist/workers/vmThreads.js +11 -10
  62. 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: Config$1;
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 a1, afterAll as b7, afterEach as b8, aroundAll as b9, aroundEach as ba, beforeAll as bb, beforeEach as bc, onTestFailed as bd, onTestFinished as be, disableDefaultColors as bh, SnapshotState as bn, format as f, inspect as i, stringify as s, spyOn as x, fn as y };
3797
- export type { TestContext as $, Awaitable as A, MaybeMocked as B, Config$1 as C, DiffOptions as D, ExpectStatic as E, FileSpecification as F, MaybePartiallyMocked as G, MaybePartiallyMockedDeep as H, MockInstance as I, TestAPI as J, SuiteCollector as K, LabelColor as L, ModuleGraphData as M, SuiteAPI as N, Suite as O, ParsedStack as P, SuiteHooks as Q, RuntimeOptions as R, SerializedCoverageConfig as S, TestError as T, UserConsoleLog as U, VitestRunner as V, VitestRunnerImportSource as W, Task as X, CancelReason as Y, TestTryOptions as Z, File as a, TestAttachment as a$, ImportDuration as a0, AfterSuiteRunMeta as a2, Assertion as a3, AsymmetricMatchersContaining as a4, BaselineData as a5, Bench as a6, BenchFn as a7, BenchFnOptions as a8, BenchFromSource as a9, MockedClass as aA, MockedFunction as aB, MockedObject as aC, OnTestFailedHandler as aD, OnTestFinishedHandler as aE, RunMode as aF, TaskBase as aG, TaskResult as aH, RuntimeConfig as aI, SerializedError as aJ, SnapshotData as aK, SnapshotMatchOptions as aL, SnapshotResult as aM, SnapshotSerializer as aN, SnapshotStateOptions as aO, SnapshotSummary as aP, SnapshotUpdateState as aQ, SuiteFactory as aR, SuiteOptions as aS, TaskCustomOptions as aT, TaskMeta as aU, TaskState as aV, TestAnnotationArtifact as aW, TestAnnotationLocation as aX, TestArtifactBase as aY, TestArtifactLocation as aZ, TestArtifactRegistry as a_, BenchOptions as aa, BenchRegistration as ab, BenchRegistrationInput as ac, BenchResult as ad, BenchRunOptions as ae, BenchStorage as af, BenchmarkGroup as ag, BenchmarkProvider as ah, BrowserTraceArtifact as ai, DeeplyAllowMatchers as aj, DomainMatchResult as ak, FailureScreenshotArtifact as al, JestAssertion as am, RawMatcherFn as an, Matchers as ao, MatchersObject as ap, MockContext as aq, MockResult as ar, MockResultIncomplete as as, MockResultReturn as at, MockResultThrow as au, MockSettledResult as av, MockSettledResultFulfilled as aw, MockSettledResultIncomplete as ax, MockSettledResultRejected as ay, Mocked as az, SerializedConfig as b, TestBenchmark as b0, TestBenchmarkTask as b1, TestFunction as b2, TestOptions as b3, TestTags as b4, UncheckedSnapshot as b5, VisualRegressionArtifact as b6, SequenceHooks as bf, SequenceSetupFiles as bg, SerializableRetry as bi, BrowserTraceViewMode as bj, Arrayable as bk, AsyncLeak as bl, PrettyFormatOptions as bm, PromisifyAssertion as bo, Tester as bp, Plugin as bq, SnapshotEnvironment as br, SnapshotEnvironmentOptions as bs, FetchCachedFileSystemResult as bt, ResolveFunctionResult as bu, SerializedDiffOptions as c, StringifyOptions as d, TestTagDefinition as e, TestAnnotation as g, TestArtifact as h, TaskResultPack as j, TaskEventPack as k, SerializedRootConfig as l, Test as m, TaskPopulated as n, ProvidedContext as o, MatcherState as p, SyncExpectationResult as q, AsyncExpectationResult as r, DomainSnapshotAdapter as t, ExpectationResult as u, Procedure as v, Mock as w, MaybeMockedDeep as z };
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.DdKI5IHB.js';
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.Ba-7h1rE.js';
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 = 63315;
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.cTDc4uSS.js';
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.Ba-7h1rE.js';
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.1TqnEahn.js';
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.Ba-7h1rE.js';
11
- import './nativeModuleRunner.xi64Afb2.js';
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.-juJ8b_4.js';
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.DdKI5IHB.js';
35
- import './run.BPv-BBRv.js';
34
+ import './source-map.DakdQc29.js';
35
+ import './run.CjdgFZiW.js';
36
36
  import '../task-utils.js';
37
37
  import 'obug';
38
- import './resolver.CtCcxIy1.js';
38
+ import './resolver.BzpmeQeT.js';
39
39
  import 'es-module-lexer';
40
40
  import './offset.Dy-5Fdfn.js';
41
- import './utils.DSfl_w8V.js';
41
+ import './utils.BBk_icFG.js';
42
42
  import '#module-evaluator';
43
43
  import 'picomatch';
44
- import './module-dependencies.CwNPkcV4.js';
45
- import './coverage.cTDc4uSS.js';
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.CLrZKo1g.js';
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.Ba-7h1rE.js';
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.De07GUeT.js').then(function (n) { return n.g; });
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,4 +1,4 @@
1
- import { A as Awaitable } from './config.d.QBNYCgFU.js';
1
+ import { A as Awaitable } from './config.d.B3YV4t0O.js';
2
2
 
3
3
  interface EnvironmentReturn {
4
4
  teardown: (global: any) => Awaitable<void>;
@@ -1,18 +1,19 @@
1
- import { g as globalApis } from './constants.-juJ8b_4.js';
2
- import { i as index } from './index.aTZaPVhf.js';
3
- import './run.BPv-BBRv.js';
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.Ba-7h1rE.js';
8
- import './source-map.DdKI5IHB.js';
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.DpkUyY1N.js';
16
+ import './rpc.Uhkwr2NM.js';
16
17
  import 'vite/module-runner';
17
18
  import './index.DmDMHCg8.js';
18
19
  import 'tinybench';