vitest 0.0.63 → 0.0.67

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.
@@ -1,6 +1,47 @@
1
- import { Awaitable } from '@antfu/utils';
1
+ import { TransformResult, ViteDevServer } from 'vite';
2
2
  import { OptionsReceived } from 'pretty-format';
3
3
 
4
+ declare class StateManager {
5
+ filesMap: Record<string, File>;
6
+ idMap: Record<string, Task>;
7
+ taskFileMap: WeakMap<Task, File>;
8
+ getFiles(keys?: string[]): File[];
9
+ collectFiles(files: File[]): void;
10
+ updateId(task: Task): void;
11
+ updateTasks(packs: TaskResultPack[]): void;
12
+ }
13
+
14
+ declare class SnapshotManager {
15
+ config: ResolvedConfig;
16
+ summary: SnapshotSummary;
17
+ constructor(config: ResolvedConfig);
18
+ clear(): void;
19
+ add(result: SnapshotResult): void;
20
+ }
21
+
22
+ declare type Awaitable<T> = T | PromiseLike<T>;
23
+ declare type Nullable<T> = T | null | undefined;
24
+ declare type Arrayable<T> = T | Array<T>;
25
+ interface ModuleCache {
26
+ promise?: Promise<any>;
27
+ exports?: any;
28
+ transformResult?: TransformResult;
29
+ }
30
+ interface EnvironmentReturn {
31
+ teardown: (global: any) => Awaitable<void>;
32
+ }
33
+ interface Environment {
34
+ name: string;
35
+ setup(global: any): Awaitable<EnvironmentReturn>;
36
+ }
37
+ interface VitestContext {
38
+ config: ResolvedConfig;
39
+ server: ViteDevServer;
40
+ state: StateManager;
41
+ snapshot: SnapshotManager;
42
+ reporter: Reporter;
43
+ }
44
+
4
45
  declare type RunMode = 'run' | 'skip' | 'only' | 'todo';
5
46
  declare type TaskState = RunMode | 'pass' | 'fail';
6
47
  declare type ComputeMode = 'serial' | 'concurrent';
@@ -222,6 +263,8 @@ interface UserOptions {
222
263
  */
223
264
  minThreads?: number;
224
265
  interpretDefault?: boolean;
266
+ testTimeout?: number;
267
+ hookTimeout?: number;
225
268
  }
226
269
  interface CliOptions extends UserOptions {
227
270
  /**
@@ -238,6 +281,7 @@ interface CliOptions extends UserOptions {
238
281
  * - `vite.config.ts`
239
282
  */
240
283
  config?: string | undefined;
284
+ dom?: boolean;
241
285
  }
242
286
  interface ResolvedConfig extends Omit<Required<CliOptions>, 'config' | 'filters'> {
243
287
  config?: string;
@@ -247,4 +291,4 @@ interface ResolvedConfig extends Omit<Required<CliOptions>, 'config' | 'filters'
247
291
  snapshotOptions: SnapshotStateOptions;
248
292
  }
249
293
 
250
- export { CliOptions as C, File as F, GlobalContext as G, HookListener as H, ResolvedConfig as R, SnapshotResult as S, TaskResultPack as T, UserOptions as U, TestFactory as a, SuiteCollector as b, TestFunction as c, SuiteHooks as d, RunMode as e, TaskState as f, ComputeMode as g, TaskBase as h, TaskResult as i, Suite as j, Test as k, Task as l, TestCollector as m, Reporter as n, SnapshotData as o, SnapshotUpdateState as p, SnapshotStateOptions as q, SnapshotMatchOptions as r, UncheckedSnapshot as s, SnapshotSummary as t };
294
+ export { Awaitable as A, CliOptions as C, EnvironmentReturn as E, File as F, GlobalContext as G, HookListener as H, ModuleCache as M, Nullable as N, ResolvedConfig as R, SnapshotResult as S, TaskResultPack as T, UserOptions as U, VitestContext as V, TestFactory as a, SuiteCollector as b, TestFunction as c, SuiteHooks as d, RunMode as e, TaskState as f, ComputeMode as g, TaskBase as h, TaskResult as i, Suite as j, Test as k, Task as l, TestCollector as m, Reporter as n, SnapshotData as o, SnapshotUpdateState as p, SnapshotStateOptions as q, SnapshotMatchOptions as r, UncheckedSnapshot as s, SnapshotSummary as t, Arrayable as u, Environment as v };
@@ -1,5 +1,5 @@
1
- import { R as ResolvedConfig } from '../options-654578ef';
2
- import '@antfu/utils';
1
+ import { R as ResolvedConfig } from '../options-63a726fa';
2
+ import 'vite';
3
3
  import 'pretty-format';
4
4
 
5
5
  declare function run(files: string[], config: ResolvedConfig): Promise<void>;