vitest 0.18.1 → 0.20.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 (38) hide show
  1. package/LICENSE.md +5 -5
  2. package/dist/browser.d.ts +1890 -0
  3. package/dist/browser.mjs +22 -0
  4. package/dist/{chunk-api-setup.9d3f7670.mjs → chunk-api-setup.7c4c8879.mjs} +24 -6
  5. package/dist/{chunk-constants.d4406290.mjs → chunk-constants.16825f0c.mjs} +5 -4
  6. package/dist/{chunk-env-node.bbba78e5.mjs → chunk-defaults.1c51d585.mjs} +461 -457
  7. package/dist/{chunk-install-pkg.2dcb2c04.mjs → chunk-install-pkg.6c6dc0c2.mjs} +11 -10
  8. package/dist/chunk-integrations-globals.56a11010.mjs +26 -0
  9. package/dist/{chunk-utils-global.0a7416cf.mjs → chunk-mock-date.9160e13b.mjs} +16 -41
  10. package/dist/chunk-node-git.43dbdd42.mjs +1139 -0
  11. package/dist/chunk-runtime-chain.b6c2cdbc.mjs +2041 -0
  12. package/dist/chunk-runtime-error.0aa0dc06.mjs +648 -0
  13. package/dist/{chunk-runtime-chain.b60d57da.mjs → chunk-runtime-hooks.3ee34848.mjs} +14 -2014
  14. package/dist/{chunk-runtime-mocker.1d853e3a.mjs → chunk-runtime-mocker.0a8f7c5e.mjs} +23 -17
  15. package/dist/{chunk-runtime-rpc.9d1f4c48.mjs → chunk-runtime-rpc.dbf0b31d.mjs} +3 -1
  16. package/dist/chunk-utils-global.fa20c2f6.mjs +5 -0
  17. package/dist/{chunk-utils-source-map.c03f8bc4.mjs → chunk-utils-source-map.8198ebd9.mjs} +2 -2
  18. package/dist/chunk-utils-timers.b48455ed.mjs +27 -0
  19. package/dist/chunk-vite-node-client.a247c2c2.mjs +320 -0
  20. package/dist/chunk-vite-node-debug.c5887932.mjs +76 -0
  21. package/dist/{chunk-vite-node-externalize.6956d2d9.mjs → chunk-vite-node-externalize.2e90dadf.mjs} +165 -1182
  22. package/dist/{chunk-vite-node-utils.8077cd3c.mjs → chunk-vite-node-utils.9dfd1e3f.mjs} +4 -312
  23. package/dist/cli.mjs +10 -10
  24. package/dist/config.cjs +6 -3
  25. package/dist/config.d.ts +2 -0
  26. package/dist/config.mjs +6 -3
  27. package/dist/entry.mjs +17 -598
  28. package/dist/index.d.ts +81 -6
  29. package/dist/index.mjs +10 -5
  30. package/dist/loader.mjs +35 -0
  31. package/dist/node.d.ts +71 -4
  32. package/dist/node.mjs +13 -12
  33. package/dist/suite.mjs +15 -0
  34. package/dist/vendor-index.61438b77.mjs +335 -0
  35. package/dist/{vendor-index.4bf9c627.mjs → vendor-index.62ce5c33.mjs} +11 -343
  36. package/dist/worker.mjs +9 -6
  37. package/package.json +12 -4
  38. package/dist/chunk-integrations-globals.00b6e1ad.mjs +0 -23
package/dist/index.d.ts CHANGED
@@ -1,8 +1,10 @@
1
- import { ViteDevServer, TransformResult, CommonServerOptions } from 'vite';
1
+ import { ViteDevServer, TransformResult, CommonServerOptions, AliasOptions } from 'vite';
2
2
  import { Stats } from 'fs';
3
3
  import { SpyImpl } from 'tinyspy';
4
4
  import { MessagePort } from 'worker_threads';
5
- export { assert, default as chai, should } from 'chai';
5
+ import * as chai from 'chai';
6
+ export { chai };
7
+ export { assert, should } from 'chai';
6
8
 
7
9
  /**
8
10
  * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
@@ -264,7 +266,6 @@ declare class ViteNodeRunner {
264
266
  */
265
267
  interopedImport(path: string): Promise<any>;
266
268
  hasNestedDefault(target: any): any;
267
- private debugLog;
268
269
  }
269
270
  interface DepsHandlingOptions {
270
271
  external?: (string | RegExp)[];
@@ -335,6 +336,33 @@ interface ViteNodeServerOptions {
335
336
  ssr?: RegExp[];
336
337
  web?: RegExp[];
337
338
  };
339
+ debug?: DebuggerOptions;
340
+ }
341
+ interface DebuggerOptions {
342
+ /**
343
+ * Dump the transformed module to filesystem
344
+ * Passing a string will dump to the specified path
345
+ */
346
+ dumpModules?: boolean | string;
347
+ /**
348
+ * Read dumpped module from filesystem whenever exists.
349
+ * Useful for debugging by modifying the dump result from the filesystem.
350
+ */
351
+ loadDumppedModules?: boolean;
352
+ }
353
+
354
+ declare class Debugger {
355
+ options: DebuggerOptions;
356
+ dumpDir: string | undefined;
357
+ initPromise: Promise<void> | undefined;
358
+ externalizeMap: Map<string, string>;
359
+ constructor(root: string, options: DebuggerOptions);
360
+ clearDump(): Promise<void>;
361
+ encodeId(id: string): string;
362
+ recordExternalize(id: string, path: string): Promise<void>;
363
+ dumpFile(id: string, result: TransformResult | null): Promise<void>;
364
+ loadDump(id: string): Promise<TransformResult | null>;
365
+ writeInfo(): Promise<void>;
338
366
  }
339
367
 
340
368
  declare class ViteNodeServer {
@@ -346,6 +374,8 @@ declare class ViteNodeServer {
346
374
  timestamp: number;
347
375
  result: FetchResult;
348
376
  }>;
377
+ externalizeCache: Map<string, Promise<string | false>>;
378
+ debugger?: Debugger;
349
379
  constructor(server: ViteDevServer, options?: ViteNodeServerOptions);
350
380
  shouldExternalize(id: string): Promise<string | false>;
351
381
  resolveId(id: string, importer?: string): Promise<ViteNodeResolveId | null>;
@@ -372,17 +402,27 @@ interface WorkerPool {
372
402
  close: () => Promise<void>;
373
403
  }
374
404
 
405
+ interface CollectingPromise {
406
+ promise: Promise<void>;
407
+ resolve: () => void;
408
+ }
375
409
  declare class StateManager {
376
410
  filesMap: Map<string, File>;
411
+ pathsSet: Set<string>;
412
+ collectingPromise: CollectingPromise | undefined;
377
413
  idMap: Map<string, Task>;
378
414
  taskFileMap: WeakMap<Task, File>;
379
415
  errorsSet: Set<unknown>;
380
416
  catchError(err: unknown, type: string): void;
381
417
  clearErrors(): void;
382
418
  getUnhandledErrors(): unknown[];
419
+ startCollectingPaths(): void;
420
+ finishCollectingPaths(): void;
421
+ getPaths(): Promise<string[]>;
383
422
  getFiles(keys?: string[]): File[];
384
423
  getFilepaths(): string[];
385
424
  getFailedFilepaths(): string[];
425
+ collectPaths(paths?: string[]): void;
386
426
  collectFiles(files?: File[]): void;
387
427
  clearFiles(paths?: string[]): void;
388
428
  updateId(task: Task): void;
@@ -528,7 +568,7 @@ declare abstract class BaseReporter implements Reporter {
528
568
  start: number;
529
569
  end: number;
530
570
  watchFilters?: string[];
531
- isTTY: boolean;
571
+ isTTY: false;
532
572
  ctx: Vitest;
533
573
  private _filesInWatchMode;
534
574
  private _lastRunTimeout;
@@ -584,6 +624,10 @@ declare class DotReporter extends BaseReporter {
584
624
  onUserConsoleLog(log: UserConsoleLog): void;
585
625
  }
586
626
 
627
+ interface Callsite {
628
+ line: number;
629
+ column: number;
630
+ }
587
631
  declare class JsonReporter implements Reporter {
588
632
  start: number;
589
633
  ctx: Vitest;
@@ -596,6 +640,7 @@ declare class JsonReporter implements Reporter {
596
640
  * @param report
597
641
  */
598
642
  writeReport(report: string): Promise<void>;
643
+ protected getFailureLocation(test: Test): Callsite | undefined;
599
644
  }
600
645
 
601
646
  declare class VerboseReporter extends DefaultReporter {
@@ -882,6 +927,7 @@ interface Suite extends TaskBase {
882
927
  interface File extends Suite {
883
928
  filepath: string;
884
929
  collectDuration?: number;
930
+ setupDuration?: number;
885
931
  }
886
932
  interface Test<ExtraContext = {}> extends TaskBase {
887
933
  type: 'test';
@@ -970,6 +1016,7 @@ interface TestContext {
970
1016
 
971
1017
  interface Reporter {
972
1018
  onInit?(ctx: Vitest): void;
1019
+ onPathsCollected?: (paths?: string[]) => Awaitable<void>;
973
1020
  onCollected?: (files?: File[]) => Awaitable<void>;
974
1021
  onFinished?: (files?: File[], errors?: unknown[]) => Awaitable<void>;
975
1022
  onTaskUpdate?: (packs: TaskResultPack[]) => Awaitable<void>;
@@ -1180,6 +1227,12 @@ interface InlineConfig {
1180
1227
  * @default 10000
1181
1228
  */
1182
1229
  hookTimeout?: number;
1230
+ /**
1231
+ * Default timeout to wait for close when Vitest shuts down, in milliseconds
1232
+ *
1233
+ * @default 1000
1234
+ */
1235
+ teardownTimeout?: number;
1183
1236
  /**
1184
1237
  * Silent mode
1185
1238
  *
@@ -1248,6 +1301,11 @@ interface InlineConfig {
1248
1301
  * @internal WIP
1249
1302
  */
1250
1303
  ui?: boolean;
1304
+ /**
1305
+ * Use in browser environment
1306
+ * @experimental
1307
+ */
1308
+ browser?: boolean;
1251
1309
  /**
1252
1310
  * Open UI automatically.
1253
1311
  *
@@ -1359,6 +1417,16 @@ interface InlineConfig {
1359
1417
  */
1360
1418
  seed?: number;
1361
1419
  };
1420
+ /**
1421
+ * Specifies an `Object`, or an `Array` of `Object`,
1422
+ * which defines aliases used to replace values in `import` or `require` statements.
1423
+ * Will be merged with the default aliases inside `resolve.alias`.
1424
+ */
1425
+ alias?: AliasOptions;
1426
+ /**
1427
+ * Ignore any unhandled errors that occur
1428
+ */
1429
+ dangerouslyIgnoreUnhandledErrors?: boolean;
1362
1430
  }
1363
1431
  interface UserConfig extends InlineConfig {
1364
1432
  /**
@@ -1710,6 +1778,7 @@ interface WorkerRPC {
1710
1778
  getSourceMap: (id: string, force?: boolean) => Promise<RawSourceMap | undefined>;
1711
1779
  onFinished: (files: File[], errors?: unknown[]) => void;
1712
1780
  onWorkerExit: (code?: number) => void;
1781
+ onPathsCollected: (paths: string[]) => void;
1713
1782
  onUserConsoleLog: (log: UserConsoleLog) => void;
1714
1783
  onUnhandledRejection: (err: unknown) => void;
1715
1784
  onCollected: (files: File[]) => void;
@@ -1724,6 +1793,7 @@ interface WorkerGlobalState {
1724
1793
  current?: Test;
1725
1794
  filepath?: string;
1726
1795
  moduleCache: ModuleCacheMap;
1796
+ browserHashMap?: Map<string, string>;
1727
1797
  mockMap: MockMap;
1728
1798
  }
1729
1799
 
@@ -1801,7 +1871,7 @@ declare type MaybeMocked<T> = T extends Procedure ? MockedFunction<T> : T extend
1801
1871
  interface Constructable {
1802
1872
  new (...args: any[]): any;
1803
1873
  }
1804
- declare type MockedClass<T extends Constructable> = MockInstance<InstanceType<T>, T extends new (...args: infer P) => any ? P : never> & {
1874
+ declare type MockedClass<T extends Constructable> = MockInstance<T extends new (...args: infer P) => any ? P : never, InstanceType<T>> & {
1805
1875
  prototype: T extends {
1806
1876
  prototype: any;
1807
1877
  } ? Mocked<T['prototype']> : never;
@@ -1959,7 +2029,12 @@ interface TransformResultWithSource extends TransformResult {
1959
2029
  source?: string;
1960
2030
  }
1961
2031
  interface WebSocketHandlers {
2032
+ onWatcherStart: () => Promise<void>;
2033
+ onFinished(files?: File[]): Promise<void>;
2034
+ onCollected(files?: File[]): Promise<void>;
2035
+ onTaskUpdate(packs: TaskResultPack[]): void;
1962
2036
  getFiles(): File[];
2037
+ getPaths(): Promise<string[]>;
1963
2038
  getConfig(): ResolvedConfig;
1964
2039
  getModuleGraph(id: string): Promise<ModuleGraphData>;
1965
2040
  getTransformResult(id: string): Promise<TransformResultWithSource | undefined>;
@@ -1968,7 +2043,7 @@ interface WebSocketHandlers {
1968
2043
  rerun(files: string[]): Promise<void>;
1969
2044
  updateSnapshot(file?: File): Promise<void>;
1970
2045
  }
1971
- interface WebSocketEvents extends Pick<Reporter, 'onCollected' | 'onFinished' | 'onTaskUpdate' | 'onUserConsoleLog'> {
2046
+ interface WebSocketEvents extends Pick<Reporter, 'onCollected' | 'onFinished' | 'onTaskUpdate' | 'onUserConsoleLog' | 'onPathsCollected'> {
1972
2047
  }
1973
2048
 
1974
2049
  export { ApiConfig, ArgumentsType$1 as ArgumentsType, Arrayable, Awaitable, BuiltinEnvironment, C8Options, Constructable$1 as Constructable, CoverageReporter, DeepMerge, DoneCallback, EnhancedSpy, Environment, EnvironmentOptions, EnvironmentReturn, ErrorWithDiff, File, HookCleanupCallback, HookListener, InlineConfig, JSDOMOptions, MergeInsertions, Mock, MockContext, MockInstance, Mocked, MockedClass, MockedFunction, MockedObject, ModuleCache, ModuleGraphData, MutableArray, Nullable, ParsedStack, Position, Reporter, ResolveIdFunction, ResolvedC8Options, ResolvedConfig, RunMode, RuntimeContext, SnapshotData, SnapshotMatchOptions, SnapshotResult, SnapshotStateOptions, SnapshotSummary, SnapshotUpdateState, SpyInstance, Suite, SuiteAPI, SuiteCollector, SuiteFactory, SuiteHooks, Task, TaskBase, TaskResult, TaskResultPack, TaskState, Test, TestAPI, TestContext, TestFunction, TransformResultWithSource, UncheckedSnapshot, UserConfig, UserConsoleLog, Vitest, WebSocketEvents, WebSocketHandlers, WorkerContext, WorkerGlobalState, WorkerRPC, afterAll, afterEach, beforeAll, beforeEach, createExpect, describe, globalExpect as expect, getRunningMode, isFirstRun, isWatchMode, it, runOnce, suite, test, vi, vitest, withCallback };
package/dist/index.mjs CHANGED
@@ -1,13 +1,18 @@
1
- export { p as afterAll, u as afterEach, o as beforeAll, q as beforeEach, x as createExpect, k as describe, y as expect, A as getRunningMode, n as isFirstRun, B as isWatchMode, l as it, m as runOnce, j as suite, t as test, v as vi, z as vitest, w as withCallback } from './chunk-runtime-chain.b60d57da.mjs';
2
- export { assert, default as chai, should } from 'chai';
1
+ export { c as createExpect, d as describe, b as expect, i as it, s as suite, t as test } from './chunk-runtime-chain.b6c2cdbc.mjs';
2
+ export { a as afterAll, d as afterEach, b as beforeAll, c as beforeEach, h as getRunningMode, f as isFirstRun, j as isWatchMode, e as runOnce, v as vi, g as vitest, w as withCallback } from './chunk-runtime-hooks.3ee34848.mjs';
3
+ import * as chai from 'chai';
4
+ export { chai };
5
+ export { assert, should } from 'chai';
3
6
  import 'util';
4
- import './chunk-utils-global.0a7416cf.mjs';
7
+ import './chunk-mock-date.9160e13b.mjs';
5
8
  import 'path';
6
9
  import 'tty';
7
10
  import 'local-pkg';
8
11
  import './vendor-_commonjsHelpers.4da45ef5.mjs';
9
- import './chunk-runtime-rpc.9d1f4c48.mjs';
12
+ import './chunk-runtime-rpc.dbf0b31d.mjs';
13
+ import './chunk-utils-global.fa20c2f6.mjs';
14
+ import './chunk-utils-timers.b48455ed.mjs';
10
15
  import 'fs';
11
- import './chunk-utils-source-map.c03f8bc4.mjs';
16
+ import './chunk-utils-source-map.8198ebd9.mjs';
12
17
  import './spy.mjs';
13
18
  import 'tinyspy';
@@ -0,0 +1,35 @@
1
+ import { pathToFileURL } from 'url';
2
+ import { i as isNodeBuiltin, d as normalizeModuleId } from './chunk-vite-node-utils.9dfd1e3f.mjs';
3
+ import './chunk-mock-date.9160e13b.mjs';
4
+ import { g as getWorkerState } from './chunk-utils-global.fa20c2f6.mjs';
5
+ import 'module';
6
+ import 'path';
7
+ import 'fs';
8
+ import 'assert';
9
+ import 'util';
10
+ import 'tty';
11
+ import 'local-pkg';
12
+
13
+ const resolve = async (url, context, next) => {
14
+ const { parentURL } = context;
15
+ if (!parentURL || !parentURL.includes("node_modules") || isNodeBuiltin(url))
16
+ return next(url, context, next);
17
+ const id = normalizeModuleId(url);
18
+ const importer = normalizeModuleId(parentURL);
19
+ const state = getWorkerState();
20
+ const resolver = state == null ? void 0 : state.rpc.resolveId;
21
+ if (resolver) {
22
+ const resolved = await resolver(id, importer);
23
+ if (resolved) {
24
+ return {
25
+ url: pathToFileURL(resolved.id).toString()
26
+ };
27
+ }
28
+ }
29
+ return next(url, context, next);
30
+ };
31
+ const load = (url, context, next) => {
32
+ return next(url, context, next);
33
+ };
34
+
35
+ export { load, resolve };
package/dist/node.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { ViteDevServer, TransformResult, CommonServerOptions, UserConfig as UserConfig$1, Plugin as Plugin$1 } from 'vite';
1
+ import { ViteDevServer, TransformResult, AliasOptions, CommonServerOptions, UserConfig as UserConfig$1, Plugin as Plugin$1 } from 'vite';
2
2
  import { Stats } from 'fs';
3
3
 
4
4
  interface UpdatePayload {
@@ -108,7 +108,6 @@ declare class ViteNodeRunner {
108
108
  */
109
109
  interopedImport(path: string): Promise<any>;
110
110
  hasNestedDefault(target: any): any;
111
- private debugLog;
112
111
  }
113
112
  interface DepsHandlingOptions {
114
113
  external?: (string | RegExp)[];
@@ -179,6 +178,33 @@ interface ViteNodeServerOptions {
179
178
  ssr?: RegExp[];
180
179
  web?: RegExp[];
181
180
  };
181
+ debug?: DebuggerOptions;
182
+ }
183
+ interface DebuggerOptions {
184
+ /**
185
+ * Dump the transformed module to filesystem
186
+ * Passing a string will dump to the specified path
187
+ */
188
+ dumpModules?: boolean | string;
189
+ /**
190
+ * Read dumpped module from filesystem whenever exists.
191
+ * Useful for debugging by modifying the dump result from the filesystem.
192
+ */
193
+ loadDumppedModules?: boolean;
194
+ }
195
+
196
+ declare class Debugger {
197
+ options: DebuggerOptions;
198
+ dumpDir: string | undefined;
199
+ initPromise: Promise<void> | undefined;
200
+ externalizeMap: Map<string, string>;
201
+ constructor(root: string, options: DebuggerOptions);
202
+ clearDump(): Promise<void>;
203
+ encodeId(id: string): string;
204
+ recordExternalize(id: string, path: string): Promise<void>;
205
+ dumpFile(id: string, result: TransformResult | null): Promise<void>;
206
+ loadDump(id: string): Promise<TransformResult | null>;
207
+ writeInfo(): Promise<void>;
182
208
  }
183
209
 
184
210
  declare class ViteNodeServer {
@@ -190,6 +216,8 @@ declare class ViteNodeServer {
190
216
  timestamp: number;
191
217
  result: FetchResult;
192
218
  }>;
219
+ externalizeCache: Map<string, Promise<string | false>>;
220
+ debugger?: Debugger;
193
221
  constructor(server: ViteDevServer, options?: ViteNodeServerOptions);
194
222
  shouldExternalize(id: string): Promise<string | false>;
195
223
  resolveId(id: string, importer?: string): Promise<ViteNodeResolveId | null>;
@@ -357,7 +385,7 @@ declare abstract class BaseReporter implements Reporter {
357
385
  start: number;
358
386
  end: number;
359
387
  watchFilters?: string[];
360
- isTTY: boolean;
388
+ isTTY: false;
361
389
  ctx: Vitest;
362
390
  private _filesInWatchMode;
363
391
  private _lastRunTimeout;
@@ -439,6 +467,10 @@ declare class DotReporter extends BaseReporter {
439
467
  onUserConsoleLog(log: UserConsoleLog): void;
440
468
  }
441
469
 
470
+ interface Callsite {
471
+ line: number;
472
+ column: number;
473
+ }
442
474
  declare class JsonReporter implements Reporter {
443
475
  start: number;
444
476
  ctx: Vitest;
@@ -451,6 +483,7 @@ declare class JsonReporter implements Reporter {
451
483
  * @param report
452
484
  */
453
485
  writeReport(report: string): Promise<void>;
486
+ protected getFailureLocation(test: Test): Callsite | undefined;
454
487
  }
455
488
 
456
489
  declare class VerboseReporter extends DefaultReporter {
@@ -716,6 +749,7 @@ interface Suite extends TaskBase {
716
749
  interface File extends Suite {
717
750
  filepath: string;
718
751
  collectDuration?: number;
752
+ setupDuration?: number;
719
753
  }
720
754
  interface Test<ExtraContext = {}> extends TaskBase {
721
755
  type: 'test';
@@ -750,6 +784,7 @@ interface TestContext {
750
784
 
751
785
  interface Reporter {
752
786
  onInit?(ctx: Vitest): void;
787
+ onPathsCollected?: (paths?: string[]) => Awaitable<void>;
753
788
  onCollected?: (files?: File[]) => Awaitable<void>;
754
789
  onFinished?: (files?: File[], errors?: unknown[]) => Awaitable<void>;
755
790
  onTaskUpdate?: (packs: TaskResultPack[]) => Awaitable<void>;
@@ -959,6 +994,12 @@ interface InlineConfig {
959
994
  * @default 10000
960
995
  */
961
996
  hookTimeout?: number;
997
+ /**
998
+ * Default timeout to wait for close when Vitest shuts down, in milliseconds
999
+ *
1000
+ * @default 1000
1001
+ */
1002
+ teardownTimeout?: number;
962
1003
  /**
963
1004
  * Silent mode
964
1005
  *
@@ -1027,6 +1068,11 @@ interface InlineConfig {
1027
1068
  * @internal WIP
1028
1069
  */
1029
1070
  ui?: boolean;
1071
+ /**
1072
+ * Use in browser environment
1073
+ * @experimental
1074
+ */
1075
+ browser?: boolean;
1030
1076
  /**
1031
1077
  * Open UI automatically.
1032
1078
  *
@@ -1138,6 +1184,16 @@ interface InlineConfig {
1138
1184
  */
1139
1185
  seed?: number;
1140
1186
  };
1187
+ /**
1188
+ * Specifies an `Object`, or an `Array` of `Object`,
1189
+ * which defines aliases used to replace values in `import` or `require` statements.
1190
+ * Will be merged with the default aliases inside `resolve.alias`.
1191
+ */
1192
+ alias?: AliasOptions;
1193
+ /**
1194
+ * Ignore any unhandled errors that occur
1195
+ */
1196
+ dangerouslyIgnoreUnhandledErrors?: boolean;
1141
1197
  }
1142
1198
  interface UserConfig extends InlineConfig {
1143
1199
  /**
@@ -1480,17 +1536,27 @@ interface WorkerPool {
1480
1536
  close: () => Promise<void>;
1481
1537
  }
1482
1538
 
1539
+ interface CollectingPromise {
1540
+ promise: Promise<void>;
1541
+ resolve: () => void;
1542
+ }
1483
1543
  declare class StateManager {
1484
1544
  filesMap: Map<string, File>;
1545
+ pathsSet: Set<string>;
1546
+ collectingPromise: CollectingPromise | undefined;
1485
1547
  idMap: Map<string, Task>;
1486
1548
  taskFileMap: WeakMap<Task, File>;
1487
1549
  errorsSet: Set<unknown>;
1488
1550
  catchError(err: unknown, type: string): void;
1489
1551
  clearErrors(): void;
1490
1552
  getUnhandledErrors(): unknown[];
1553
+ startCollectingPaths(): void;
1554
+ finishCollectingPaths(): void;
1555
+ getPaths(): Promise<string[]>;
1491
1556
  getFiles(keys?: string[]): File[];
1492
1557
  getFilepaths(): string[];
1493
1558
  getFailedFilepaths(): string[];
1559
+ collectPaths(paths?: string[]): void;
1494
1560
  collectFiles(files?: File[]): void;
1495
1561
  clearFiles(paths?: string[]): void;
1496
1562
  updateId(task: Task): void;
@@ -1619,7 +1685,8 @@ declare class VitestMocker {
1619
1685
  private resolvePath;
1620
1686
  private resolveMocks;
1621
1687
  private callFunctionMock;
1622
- getDependencyMock(dep: string): string | (() => unknown) | null;
1688
+ private getMockPath;
1689
+ getDependencyMock(id: string): string | (() => unknown) | null;
1623
1690
  normalizePath(path: string): string;
1624
1691
  getFsPath(path: string, external: string | null): string;
1625
1692
  resolveMockPath(mockPath: string, external: string | null): string | null;
package/dist/node.mjs CHANGED
@@ -1,33 +1,34 @@
1
- export { B as BaseSequencer, V as VitestPlugin, c as createVitest, s as startVitest } from './chunk-vite-node-externalize.6956d2d9.mjs';
2
- export { V as VitestRunner } from './chunk-runtime-mocker.1d853e3a.mjs';
3
- import './chunk-env-node.bbba78e5.mjs';
1
+ export { B as BaseSequencer, V as VitestPlugin, c as createVitest, s as startVitest } from './chunk-vite-node-externalize.2e90dadf.mjs';
2
+ export { V as VitestRunner } from './chunk-runtime-mocker.0a8f7c5e.mjs';
3
+ import './chunk-mock-date.9160e13b.mjs';
4
+ import 'path';
5
+ import 'tty';
4
6
  import 'local-pkg';
7
+ import './chunk-defaults.1c51d585.mjs';
5
8
  import 'fs';
6
9
  import 'module';
7
10
  import 'url';
8
- import './chunk-utils-global.0a7416cf.mjs';
9
- import 'path';
10
- import 'tty';
11
11
  import 'vite';
12
12
  import 'process';
13
- import './chunk-constants.d4406290.mjs';
13
+ import './chunk-constants.16825f0c.mjs';
14
14
  import 'os';
15
15
  import 'util';
16
16
  import 'stream';
17
17
  import 'events';
18
18
  import './vendor-_commonjsHelpers.4da45ef5.mjs';
19
- import './chunk-vite-node-utils.8077cd3c.mjs';
19
+ import './chunk-vite-node-client.a247c2c2.mjs';
20
20
  import 'vm';
21
+ import './chunk-vite-node-utils.9dfd1e3f.mjs';
21
22
  import 'assert';
22
23
  import 'debug';
23
24
  import 'worker_threads';
24
25
  import 'tinypool';
25
26
  import 'perf_hooks';
26
- import './chunk-utils-source-map.c03f8bc4.mjs';
27
+ import './chunk-utils-source-map.8198ebd9.mjs';
28
+ import './chunk-utils-timers.b48455ed.mjs';
27
29
  import 'crypto';
28
- import 'buffer';
29
- import 'child_process';
30
- import './vendor-index.4bf9c627.mjs';
30
+ import './vendor-index.61438b77.mjs';
31
31
  import './chunk-magic-string.efe26975.mjs';
32
32
  import 'readline';
33
33
  import './vendor-index.de788b6a.mjs';
34
+ import './chunk-utils-global.fa20c2f6.mjs';
package/dist/suite.mjs ADDED
@@ -0,0 +1,15 @@
1
+ import 'util';
2
+ import './chunk-mock-date.9160e13b.mjs';
3
+ export { e as clearCollectorContext, o as createSuiteHooks, f as defaultSuite, d as describe, g as getCurrentSuite, i as it, s as suite, t as test } from './chunk-runtime-chain.b6c2cdbc.mjs';
4
+ import './chunk-utils-global.fa20c2f6.mjs';
5
+ import 'path';
6
+ import 'tty';
7
+ import 'local-pkg';
8
+ import 'chai';
9
+ import './vendor-_commonjsHelpers.4da45ef5.mjs';
10
+ import './chunk-runtime-rpc.dbf0b31d.mjs';
11
+ import './chunk-utils-timers.b48455ed.mjs';
12
+ import 'fs';
13
+ import './chunk-utils-source-map.8198ebd9.mjs';
14
+ import './spy.mjs';
15
+ import 'tinyspy';