vitest 0.0.101 → 0.0.105

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,4 +1,4 @@
1
- import { c as commonjsGlobal } from './_commonjsHelpers-bdec4bbd.js';
1
+ import { q as commonjsGlobal } from './utils-5307e690.js';
2
2
  import assert$1 from 'assert';
3
3
  import require$$2 from 'events';
4
4
 
@@ -2,11 +2,15 @@ import path$5 from 'path';
2
2
  import fs$5 from 'fs';
3
3
  import require$$0 from 'util';
4
4
  import require$$0$1 from 'child_process';
5
- import { c as commonjsGlobal } from './_commonjsHelpers-bdec4bbd.js';
6
- import { a as signalExit, b as onetime$1 } from './index-825cb54c.js';
5
+ import { q as commonjsGlobal } from './utils-5307e690.js';
6
+ import { a as signalExit, b as onetime$1 } from './index-4cf13e25.js';
7
7
  import require$$0$2 from 'os';
8
8
  import require$$0$4 from 'buffer';
9
9
  import require$$0$3 from 'stream';
10
+ import 'tty';
11
+ import 'local-pkg';
12
+ import 'chai';
13
+ import 'tinyspy';
10
14
  import 'assert';
11
15
  import 'events';
12
16
 
@@ -0,0 +1,31 @@
1
+ import { g as getCurrentSuite, w as withTimeout, a as getDefaultHookTimeout, s as suite, t as test, d as describe, i as it } from './suite-101bab76.js';
2
+ import chai, { assert, should, expect } from 'chai';
3
+ import { s as spies, a as spyOn, f as fn, v as vitest, b as vi } from './utils-5307e690.js';
4
+
5
+ const beforeAll = (fn, timeout) => getCurrentSuite().on("beforeAll", withTimeout(fn, timeout ?? getDefaultHookTimeout()));
6
+ const afterAll = (fn, timeout) => getCurrentSuite().on("afterAll", withTimeout(fn, timeout ?? getDefaultHookTimeout()));
7
+ const beforeEach = (fn, timeout) => getCurrentSuite().on("beforeEach", withTimeout(fn, timeout ?? getDefaultHookTimeout()));
8
+ const afterEach = (fn, timeout) => getCurrentSuite().on("afterEach", withTimeout(fn, timeout ?? getDefaultHookTimeout()));
9
+
10
+ var index = /*#__PURE__*/Object.freeze({
11
+ __proto__: null,
12
+ suite: suite,
13
+ test: test,
14
+ describe: describe,
15
+ it: it,
16
+ beforeAll: beforeAll,
17
+ afterAll: afterAll,
18
+ beforeEach: beforeEach,
19
+ afterEach: afterEach,
20
+ assert: assert,
21
+ should: should,
22
+ expect: expect,
23
+ chai: chai,
24
+ spies: spies,
25
+ spyOn: spyOn,
26
+ fn: fn,
27
+ vitest: vitest,
28
+ vi: vi
29
+ });
30
+
31
+ export { afterAll as a, beforeAll as b, beforeEach as c, afterEach as d, index as i };
package/dist/index.d.ts CHANGED
@@ -150,6 +150,12 @@ declare class Any extends AsymmetricMatcher<any> {
150
150
  getExpectedType(): string;
151
151
  toAsymmetricMatcher(): string;
152
152
  }
153
+ declare class StringMatching extends AsymmetricMatcher<RegExp> {
154
+ constructor(sample: string | RegExp, inverse?: boolean);
155
+ asymmetricMatch(other: string): boolean;
156
+ toString(): string;
157
+ getExpectedType(): string;
158
+ }
153
159
 
154
160
  declare type Awaitable<T> = T | PromiseLike<T>;
155
161
  declare type Nullable<T> = T | null | undefined;
@@ -303,12 +309,12 @@ interface InlineConfig {
303
309
  /**
304
310
  * Include globs for test files
305
311
  *
306
- * @default ['**\/*.test.ts']
312
+ * @default ['**\/*.{test,spec}.{js,mjs,cjs,ts,mts,cts,jsx,tsx}']
307
313
  */
308
314
  include?: string[];
309
315
  /**
310
316
  * Exclude globs for test files
311
- * @default ['**\/node_modules\/**']
317
+ * @default ['node_modules', 'dist', '.idea', '.git', '.cache']
312
318
  */
313
319
  exclude?: string[];
314
320
  /**
@@ -426,6 +432,21 @@ interface InlineConfig {
426
432
  * @default false
427
433
  */
428
434
  api?: boolean | number;
435
+ /**
436
+ * Will call `.mockClear()` on all spies before each test
437
+ * @default false
438
+ */
439
+ clearMocks?: boolean;
440
+ /**
441
+ * Will call `.mockReset()` on all spies before each test
442
+ * @default false
443
+ */
444
+ mockReset?: boolean;
445
+ /**
446
+ * Will call `.mockRestore()` on all spies before each test
447
+ * @default false
448
+ */
449
+ restoreMocks?: boolean;
429
450
  }
430
451
  interface UserConfig extends InlineConfig {
431
452
  /**
@@ -446,6 +467,10 @@ interface UserConfig extends InlineConfig {
446
467
  * Do not watch
447
468
  */
448
469
  run?: boolean;
470
+ /**
471
+ * Pass with no tests
472
+ */
473
+ passWithNoTests?: boolean;
449
474
  }
450
475
  interface ResolvedConfig extends Omit<Required<UserConfig>, 'config' | 'filters'> {
451
476
  config?: string;
@@ -490,6 +515,7 @@ declare global {
490
515
  rpc: RpcCall;
491
516
  send: RpcSend;
492
517
  current?: Test;
518
+ filepath?: string;
493
519
  moduleCache: Map<string, ModuleCache>;
494
520
  };
495
521
  }
@@ -541,6 +567,37 @@ interface JestMockCompat<TArgs extends any[] = any[], TReturns = any> {
541
567
  interface JestMockCompatFn<TArgs extends any[] = any, TReturns = any> extends JestMockCompat<TArgs, TReturns> {
542
568
  (...args: TArgs): TReturns;
543
569
  }
570
+ declare type MockableFunction = (...args: Array<any>) => any;
571
+ declare type MethodKeysOf<T> = {
572
+ [K in keyof T]: T[K] extends MockableFunction ? K : never;
573
+ }[keyof T];
574
+ declare type PropertyKeysOf<T> = {
575
+ [K in keyof T]: T[K] extends MockableFunction ? never : K;
576
+ }[keyof T];
577
+ declare type ArgumentsOf<T> = T extends (...args: infer A) => any ? A : never;
578
+ declare type ConstructorArgumentsOf<T> = T extends new (...args: infer A) => any ? A : never;
579
+ declare type MaybeMockedConstructor<T> = T extends new (...args: Array<any>) => infer R ? JestMockCompatFn<ConstructorArgumentsOf<T>, R> : T;
580
+ declare type MockedFunction<T extends MockableFunction> = MockWithArgs<T> & {
581
+ [K in keyof T]: T[K];
582
+ };
583
+ declare type MockedFunctionDeep<T extends MockableFunction> = MockWithArgs<T> & MockedObjectDeep<T>;
584
+ declare type MockedObject<T> = MaybeMockedConstructor<T> & {
585
+ [K in MethodKeysOf<T>]: T[K] extends MockableFunction ? MockedFunction<T[K]> : T[K];
586
+ } & {
587
+ [K in PropertyKeysOf<T>]: T[K];
588
+ };
589
+ declare type MockedObjectDeep<T> = MaybeMockedConstructor<T> & {
590
+ [K in MethodKeysOf<T>]: T[K] extends MockableFunction ? MockedFunctionDeep<T[K]> : T[K];
591
+ } & {
592
+ [K in PropertyKeysOf<T>]: MaybeMockedDeep<T[K]>;
593
+ };
594
+ declare type MaybeMockedDeep<T> = T extends MockableFunction ? MockedFunctionDeep<T> : T extends object ? MockedObjectDeep<T> : T;
595
+ declare type MaybeMocked<T> = T extends MockableFunction ? MockedFunction<T> : T extends object ? MockedObject<T> : T;
596
+ interface MockWithArgs<T extends MockableFunction> extends JestMockCompatFn<ArgumentsOf<T>, ReturnType<T>> {
597
+ new (...args: ConstructorArgumentsOf<T>): T;
598
+ (...args: ArgumentsOf<T>): ReturnType<T>;
599
+ }
600
+ declare const spies: Set<JestMockCompat<any[], any>>;
544
601
  declare function spyOn<T, K extends keyof T>(obj: T, method: K, accessType?: 'get' | 'set'): T[K] extends (...args: infer TArgs) => infer TReturnValue ? JestMockCompat<TArgs, TReturnValue> : JestMockCompat;
545
602
  declare type Awaited<T> = T extends Promise<infer R> ? R : never;
546
603
  declare function fn<TArgs extends any[] = any[], R = any>(): JestMockCompatFn<TArgs, R>;
@@ -548,6 +605,7 @@ declare function fn<TArgs extends any[] = any[], R = any>(implementation: (...ar
548
605
 
549
606
  declare class VitestUtils {
550
607
  private _timers;
608
+ private _systemDate;
551
609
  constructor();
552
610
  useFakeTimers(): void;
553
611
  useRealTimers(): void;
@@ -555,17 +613,22 @@ declare class VitestUtils {
555
613
  runAllTimers(): void | Promise<void>;
556
614
  advanceTimersByTime(ms: number): void | Promise<void>;
557
615
  advanceTimersToNextTimer(): void | Promise<void>;
558
- runAllTicks(): void | Promise<void>;
559
- setSystemTime(time?: number | Date): void;
560
- getRealSystemTime(): number;
561
616
  getTimerCount(): number;
617
+ setSystemDate(date: string | number | Date): void;
618
+ resetSystemDate(): void;
619
+ getSystemDate(): string | number | Date;
562
620
  spyOn: typeof spyOn;
563
621
  fn: typeof fn;
564
- mock: (path: string) => string;
622
+ mock(path: string): void;
623
+ unmock(path: string): void;
624
+ importActual<T>(path: string): Promise<T>;
625
+ importMock<T>(path: string): Promise<T>;
626
+ mocked<T>(item: T, deep?: false): MaybeMocked<T>;
627
+ mocked<T>(item: T, deep: true): MaybeMockedDeep<T>;
565
628
  isMockFunction(fn: any): any;
566
- clearAllMocks(): void;
567
- resetAllMocks(): void;
568
- restoreAllMocks(): void;
629
+ clearAllMocks(): this;
630
+ resetAllMocks(): this;
631
+ restoreAllMocks(): this;
569
632
  }
570
633
  declare const vitest: VitestUtils;
571
634
  declare const vi: VitestUtils;
@@ -589,6 +652,7 @@ declare global {
589
652
  objectContaining(expected: any): ObjectContaining;
590
653
  any(constructor: unknown): Any;
591
654
  arrayContaining(expected: any): ArrayContaining;
655
+ stringMatching(expected: RegExp): StringMatching;
592
656
  }
593
657
  interface Assertion {
594
658
  chaiEqual(expected: any): void;
@@ -643,4 +707,4 @@ declare global {
643
707
  }
644
708
  }
645
709
 
646
- export { ArgumentsType, Arrayable, Awaitable, BuiltinEnvironment, ComputeMode, DoneCallback, Environment, EnvironmentReturn, File, HookListener, InlineConfig, JestMockCompat, JestMockCompatContext, JestMockCompatFn, ModuleCache, Nullable, Reporter, ResolvedConfig, RpcCall, RpcMap, RpcPayload, RpcSend, RunMode, RuntimeContext, SnapshotData, SnapshotMatchOptions, SnapshotResult, SnapshotStateOptions, SnapshotSummary, SnapshotUpdateState, Suite, SuiteCollector, SuiteHooks, Task, TaskBase, TaskResult, TaskResultPack, TaskState, Test, TestCollector, TestFactory, TestFunction, UncheckedSnapshot, UserConfig, UserConsoleLog, WorkerContext, afterAll, afterEach, beforeAll, beforeEach, describe, fn, it, spyOn, suite, test, vi, vitest };
710
+ export { ArgumentsOf, ArgumentsType, Arrayable, Awaitable, BuiltinEnvironment, ComputeMode, ConstructorArgumentsOf, DoneCallback, Environment, EnvironmentReturn, File, HookListener, InlineConfig, JestMockCompat, JestMockCompatContext, JestMockCompatFn, MaybeMocked, MaybeMockedConstructor, MaybeMockedDeep, MethodKeysOf, MockWithArgs, MockableFunction, MockedFunction, MockedFunctionDeep, MockedObject, MockedObjectDeep, ModuleCache, Nullable, PropertyKeysOf, Reporter, ResolvedConfig, RpcCall, RpcMap, RpcPayload, RpcSend, RunMode, RuntimeContext, SnapshotData, SnapshotMatchOptions, SnapshotResult, SnapshotStateOptions, SnapshotSummary, SnapshotUpdateState, Suite, SuiteCollector, SuiteHooks, Task, TaskBase, TaskResult, TaskResultPack, TaskState, Test, TestCollector, TestFactory, TestFunction, UncheckedSnapshot, UserConfig, UserConsoleLog, WorkerContext, afterAll, afterEach, beforeAll, beforeEach, describe, fn, it, spies, spyOn, suite, test, vi, vitest };
package/dist/index.js CHANGED
@@ -1,8 +1,8 @@
1
- export { d as describe, i as it, s as suite, t as test } from './suite-4f3fb0b5.js';
2
- export { a as afterAll, d as afterEach, b as beforeAll, c as beforeEach, f as fn, s as spyOn, e as vi, v as vitest } from './index-f580d714.js';
1
+ export { d as describe, i as it, s as suite, t as test } from './suite-101bab76.js';
2
+ export { a as afterAll, d as afterEach, b as beforeAll, c as beforeEach } from './index-a76b4291.js';
3
3
  export { assert, default as chai, expect, should } from 'chai';
4
+ export { f as fn, s as spies, a as spyOn, b as vi, v as vitest } from './utils-5307e690.js';
4
5
  import './index-9e71c815.js';
5
- import './utils-c8e62373.js';
6
6
  import 'tty';
7
7
  import 'local-pkg';
8
8
  import 'path';
@@ -1,9 +1,11 @@
1
- import { A as API_PATH } from './constants-a1417084.js';
1
+ import { A as API_PATH } from './constants-9320a46c.js';
2
2
  import 'url';
3
- import './utils-c8e62373.js';
3
+ import './utils-5307e690.js';
4
4
  import 'tty';
5
5
  import 'local-pkg';
6
6
  import 'path';
7
+ import 'chai';
8
+ import 'tinyspy';
7
9
 
8
10
  /*! (c) 2020 Andrea Giammarchi */
9
11
 
package/dist/node.d.ts ADDED
@@ -0,0 +1,328 @@
1
+ import { ViteDevServer, UserConfig as UserConfig$1 } from 'vite';
2
+ import { OptionsReceived } from 'pretty-format';
3
+
4
+ declare type Awaitable<T> = T | PromiseLike<T>;
5
+ declare type ArgumentsType<T> = T extends (...args: infer U) => any ? U : never;
6
+ interface UserConsoleLog {
7
+ content: string;
8
+ type: 'stdout' | 'stderr';
9
+ taskId?: string;
10
+ }
11
+
12
+ declare type RunMode = 'run' | 'skip' | 'only' | 'todo';
13
+ declare type TaskState = RunMode | 'pass' | 'fail';
14
+ declare type ComputeMode = 'serial' | 'concurrent';
15
+ interface TaskBase {
16
+ id: string;
17
+ name: string;
18
+ mode: RunMode;
19
+ computeMode: ComputeMode;
20
+ suite?: Suite;
21
+ file?: File;
22
+ result?: TaskResult;
23
+ }
24
+ interface TaskResult {
25
+ state: TaskState;
26
+ start: number;
27
+ end?: number;
28
+ error?: unknown;
29
+ }
30
+ declare type TaskResultPack = [id: string, result: TaskResult | undefined];
31
+ interface Suite extends TaskBase {
32
+ type: 'suite';
33
+ tasks: Task[];
34
+ }
35
+ interface File extends Suite {
36
+ filepath: string;
37
+ }
38
+ interface Test extends TaskBase {
39
+ type: 'test';
40
+ suite: Suite;
41
+ result?: TaskResult;
42
+ fails?: boolean;
43
+ }
44
+ declare type Task = Test | Suite | File;
45
+
46
+ interface Reporter {
47
+ onStart?: (files?: string[]) => Awaitable<void>;
48
+ onFinished?: (files?: File[]) => Awaitable<void>;
49
+ onTaskUpdate?: (pack: TaskResultPack) => Awaitable<void>;
50
+ onWatcherStart?: () => Awaitable<void>;
51
+ onWatcherRerun?: (files: string[], trigger: string) => Awaitable<void>;
52
+ onServerRestart?: () => Awaitable<void>;
53
+ onUserConsoleLog?: (log: UserConsoleLog) => Awaitable<void>;
54
+ }
55
+
56
+ declare type SnapshotUpdateState = 'all' | 'new' | 'none';
57
+ declare type SnapshotStateOptions = {
58
+ updateSnapshot: SnapshotUpdateState;
59
+ expand?: boolean;
60
+ snapshotFormat?: OptionsReceived;
61
+ };
62
+ interface SnapshotResult {
63
+ filepath: string;
64
+ added: number;
65
+ fileDeleted: boolean;
66
+ matched: number;
67
+ unchecked: number;
68
+ uncheckedKeys: Array<string>;
69
+ unmatched: number;
70
+ updated: number;
71
+ }
72
+ interface UncheckedSnapshot {
73
+ filePath: string;
74
+ keys: Array<string>;
75
+ }
76
+ interface SnapshotSummary {
77
+ added: number;
78
+ didUpdate: boolean;
79
+ failure: boolean;
80
+ filesAdded: number;
81
+ filesRemoved: number;
82
+ filesRemovedList: Array<string>;
83
+ filesUnmatched: number;
84
+ filesUpdated: number;
85
+ matched: number;
86
+ total: number;
87
+ unchecked: number;
88
+ uncheckedKeysByFile: Array<UncheckedSnapshot>;
89
+ unmatched: number;
90
+ updated: number;
91
+ }
92
+
93
+ declare type BuiltinEnvironment = 'node' | 'jsdom' | 'happy-dom';
94
+ interface InlineConfig {
95
+ /**
96
+ * Include globs for test files
97
+ *
98
+ * @default ['**\/*.{test,spec}.{js,mjs,cjs,ts,mts,cts,jsx,tsx}']
99
+ */
100
+ include?: string[];
101
+ /**
102
+ * Exclude globs for test files
103
+ * @default ['node_modules', 'dist', '.idea', '.git', '.cache']
104
+ */
105
+ exclude?: string[];
106
+ /**
107
+ * Handling for dependencies inlining or externalizing
108
+ */
109
+ deps?: {
110
+ /**
111
+ * Externalize means that Vite will bypass the package to native Node.
112
+ *
113
+ * Externalized dependencies will not be applied Vite's transformers and resolvers.
114
+ * And does not support HMR on reload.
115
+ *
116
+ * Typically, packages under `node_modules` are externalized.
117
+ */
118
+ external?: (string | RegExp)[];
119
+ /**
120
+ * Vite will process inlined modules.
121
+ *
122
+ * This could be helpful to handle packages that ship `.js` in ESM format (that Node can't handle).
123
+ */
124
+ inline?: (string | RegExp)[];
125
+ };
126
+ /**
127
+ * Register apis globally
128
+ *
129
+ * @default false
130
+ */
131
+ global?: boolean;
132
+ /**
133
+ * Running environment
134
+ *
135
+ * Supports 'node', 'jsdom', 'happy-dom'
136
+ *
137
+ * @default 'node'
138
+ */
139
+ environment?: BuiltinEnvironment;
140
+ /**
141
+ * Update snapshot files
142
+ *
143
+ * @default false
144
+ */
145
+ update?: boolean;
146
+ /**
147
+ * Watch mode
148
+ *
149
+ * @default false
150
+ */
151
+ watch?: boolean;
152
+ /**
153
+ * Project root
154
+ */
155
+ root?: string;
156
+ /**
157
+ * Custom reporter for output
158
+ */
159
+ reporters?: Reporter | Reporter[];
160
+ /**
161
+ * Enable multi-threading
162
+ *
163
+ * @default true
164
+ */
165
+ threads?: boolean;
166
+ /**
167
+ * Maximum number of threads
168
+ *
169
+ * @default available CPUs
170
+ */
171
+ maxThreads?: number;
172
+ /**
173
+ * Minimum number of threads
174
+ *
175
+ * @default available CPUs
176
+ */
177
+ minThreads?: number;
178
+ interpretDefault?: boolean;
179
+ /**
180
+ * Default timeout of a test in milliseconds
181
+ *
182
+ * @default 5000
183
+ */
184
+ testTimeout?: number;
185
+ /**
186
+ * Default timeout of a hook in milliseconds
187
+ *
188
+ * @default 5000
189
+ */
190
+ hookTimeout?: number;
191
+ /**
192
+ * Silent mode
193
+ *
194
+ * @default false
195
+ */
196
+ silent?: boolean;
197
+ /**
198
+ * Path to setup files
199
+ */
200
+ setupFiles?: string | string[];
201
+ /**
202
+ * Pattern of file paths to be ignore from triggering watch rerun
203
+ *
204
+ * @default ['**\/node_modules\/**', '**\/dist/**']
205
+ */
206
+ watchIgnore?: (string | RegExp)[];
207
+ /**
208
+ * Open Vitest UI
209
+ * @internal WIP
210
+ */
211
+ open?: boolean;
212
+ /**
213
+ * Listen to port and serve API
214
+ *
215
+ * When set to true, the default port is 55555
216
+ *
217
+ * @internal WIP
218
+ * @default false
219
+ */
220
+ api?: boolean | number;
221
+ /**
222
+ * Will call `.mockClear()` on all spies before each test
223
+ * @default false
224
+ */
225
+ clearMocks?: boolean;
226
+ /**
227
+ * Will call `.mockReset()` on all spies before each test
228
+ * @default false
229
+ */
230
+ mockReset?: boolean;
231
+ /**
232
+ * Will call `.mockRestore()` on all spies before each test
233
+ * @default false
234
+ */
235
+ restoreMocks?: boolean;
236
+ }
237
+ interface UserConfig extends InlineConfig {
238
+ /**
239
+ * Path to the config file.
240
+ *
241
+ * Default resolving to one of:
242
+ * - `vitest.config.js`
243
+ * - `vitest.config.ts`
244
+ * - `vite.config.js`
245
+ * - `vite.config.ts`
246
+ */
247
+ config?: string | undefined;
248
+ /**
249
+ * Use happy-dom
250
+ */
251
+ dom?: boolean;
252
+ /**
253
+ * Do not watch
254
+ */
255
+ run?: boolean;
256
+ /**
257
+ * Pass with no tests
258
+ */
259
+ passWithNoTests?: boolean;
260
+ }
261
+ interface ResolvedConfig extends Omit<Required<UserConfig>, 'config' | 'filters'> {
262
+ config?: string;
263
+ filters?: string[];
264
+ depsInline: (string | RegExp)[];
265
+ depsExternal: (string | RegExp)[];
266
+ snapshotOptions: SnapshotStateOptions;
267
+ }
268
+
269
+ declare class SnapshotManager {
270
+ config: ResolvedConfig;
271
+ summary: SnapshotSummary;
272
+ constructor(config: ResolvedConfig);
273
+ clear(): void;
274
+ add(result: SnapshotResult): void;
275
+ }
276
+
277
+ declare type RunWithFiles = (files: string[], invalidates?: string[]) => Promise<void>;
278
+ interface WorkerPool {
279
+ runTests: RunWithFiles;
280
+ collectTests: RunWithFiles;
281
+ close: () => Promise<void>;
282
+ }
283
+
284
+ declare class StateManager {
285
+ filesMap: Record<string, File>;
286
+ idMap: Record<string, Task>;
287
+ taskFileMap: WeakMap<Task, File>;
288
+ getFiles(keys?: string[]): File[];
289
+ collectFiles(files: File[]): void;
290
+ updateId(task: Task): void;
291
+ updateTasks(packs: TaskResultPack[]): void;
292
+ }
293
+
294
+ declare class Vitest {
295
+ config: ResolvedConfig;
296
+ server: ViteDevServer;
297
+ state: StateManager;
298
+ snapshot: SnapshotManager;
299
+ reporters: Reporter[];
300
+ console: Console;
301
+ pool: WorkerPool | undefined;
302
+ invalidates: Set<string>;
303
+ changedTests: Set<string>;
304
+ runningPromise?: Promise<void>;
305
+ isFirstRun: boolean;
306
+ restartsCount: number;
307
+ private _onRestartListeners;
308
+ constructor();
309
+ setServer(options: UserConfig, server: ViteDevServer): void;
310
+ start(filters?: string[]): Promise<void>;
311
+ runFiles(files: string[]): Promise<void>;
312
+ log(...args: any[]): void;
313
+ error(...args: any[]): void;
314
+ private _rerunTimer;
315
+ private scheduleRerun;
316
+ private unregisterWatcher;
317
+ private registerWatcher;
318
+ private handleFileChanged;
319
+ close(): Promise<void>;
320
+ report<T extends keyof Reporter>(name: T, ...args: ArgumentsType<Reporter[T]>): Promise<void>;
321
+ globTestFiles(filters?: string[]): Promise<string[]>;
322
+ isTargetFile(id: string): boolean;
323
+ onServerRestarted(fn: () => void): void;
324
+ }
325
+
326
+ declare function createVitest(options: UserConfig, viteOverrides?: UserConfig$1): Promise<Vitest>;
327
+
328
+ export { Vitest, createVitest };
package/dist/node.js CHANGED
@@ -1,8 +1,10 @@
1
- export { c as createVitest } from './index-37755855.js';
2
- import './utils-c8e62373.js';
1
+ export { c as createVitest } from './index-1da01554.js';
2
+ import './utils-5307e690.js';
3
3
  import 'tty';
4
4
  import 'local-pkg';
5
5
  import 'path';
6
+ import 'chai';
7
+ import 'tinyspy';
6
8
  import 'vite';
7
9
  import 'process';
8
10
  import 'fs';
@@ -10,12 +12,11 @@ import 'os';
10
12
  import 'util';
11
13
  import 'stream';
12
14
  import 'events';
13
- import './constants-a1417084.js';
15
+ import './constants-9320a46c.js';
14
16
  import 'url';
15
17
  import 'perf_hooks';
16
- import './error-d97062cd.js';
17
- import './index-825cb54c.js';
18
- import './_commonjsHelpers-bdec4bbd.js';
18
+ import './error-4e165107.js';
19
+ import './index-4cf13e25.js';
19
20
  import 'assert';
20
21
  import 'worker_threads';
21
22
  import 'tinypool';
@@ -1,5 +1,5 @@
1
1
  import { n as nanoid } from './index-9e71c815.js';
2
- import { n as noop } from './utils-c8e62373.js';
2
+ import { n as noop } from './utils-5307e690.js';
3
3
 
4
4
  var __defProp = Object.defineProperty;
5
5
  var __defProps = Object.defineProperties;
@@ -198,4 +198,4 @@ function createSuite() {
198
198
  });
199
199
  }
200
200
 
201
- export { getDefaultHookTimeout as a, setHooks as b, createSuiteHooks as c, describe as d, clearContext as e, defaultSuite as f, getCurrentSuite as g, context as h, it as i, getHooks as j, getFn as k, suite as s, test as t, withTimeout as w };
201
+ export { getDefaultHookTimeout as a, defaultSuite as b, clearContext as c, describe as d, setHooks as e, getHooks as f, getCurrentSuite as g, context as h, it as i, getFn as j, suite as s, test as t, withTimeout as w };