vitest 0.29.7 → 0.29.8

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 (39) hide show
  1. package/LICENSE.md +1 -185
  2. package/dist/browser.d.ts +12 -2
  3. package/dist/browser.js +5 -3
  4. package/dist/child.js +4 -5
  5. package/dist/{chunk-api-setup.ac7748ac.js → chunk-api-setup.3aabe9ac.js} +16 -7
  6. package/dist/{chunk-install-pkg.863031f2.js → chunk-install-pkg.6aa7cf6d.js} +7 -6
  7. package/dist/{chunk-integrations-coverage.e0a6acd2.js → chunk-integrations-coverage.d93ee824.js} +5 -5
  8. package/dist/{chunk-integrations-globals.a473e88a.js → chunk-integrations-globals.49802775.js} +8 -7
  9. package/dist/{chunk-integrations-run-once.a2b4758b.js → chunk-integrations-run-once.ea614f17.js} +2 -1
  10. package/dist/{chunk-integrations-utils.d7c85bd9.js → chunk-integrations-utils.23c19408.js} +2 -2
  11. package/dist/{chunk-node-pkg.f9696901.js → chunk-node-pkg.30d8b37e.js} +155 -2330
  12. package/dist/{chunk-runtime-mocker.344fec90.js → chunk-runtime-mocker.3283818a.js} +3 -3
  13. package/dist/{chunk-runtime-rpc.1b5714dc.js → chunk-runtime-rpc.d6aa57f8.js} +1 -1
  14. package/dist/{chunk-runtime-setup.a49dc2f9.js → chunk-runtime-setup.5d504677.js} +2 -2
  15. package/dist/{chunk-utils-base.81f83dbd.js → chunk-utils-base.b5ddfcc9.js} +4 -1
  16. package/dist/{chunk-utils-env.04ffbef7.js → chunk-utils-env.6b856dbf.js} +2 -8
  17. package/dist/chunk-utils-global.fd174983.js +8 -0
  18. package/dist/{chunk-utils-import.39ffe9c5.js → chunk-utils-import.e488ace3.js} +194 -195
  19. package/dist/{chunk-utils-tasks.b41c8284.js → chunk-utils-tasks.8781fd71.js} +2 -2
  20. package/dist/cli.js +7 -6
  21. package/dist/config.cjs +0 -5
  22. package/dist/config.d.ts +1 -5
  23. package/dist/config.js +0 -5
  24. package/dist/coverage.d.ts +1 -1
  25. package/dist/entry.js +11 -10
  26. package/dist/environments.d.ts +1 -1
  27. package/dist/index.d.ts +8 -13
  28. package/dist/index.js +9 -8
  29. package/dist/loader.js +2 -1
  30. package/dist/node.d.ts +2 -2
  31. package/dist/node.js +9 -8
  32. package/dist/runners.d.ts +1 -1
  33. package/dist/runners.js +6 -5
  34. package/dist/{types-fafda418.d.ts → types-94cfe4b4.d.ts} +23 -16
  35. package/dist/utils.d.ts +1 -0
  36. package/dist/utils.js +1 -0
  37. package/dist/worker.js +7 -8
  38. package/package.json +18 -7
  39. package/utils.d.ts +1 -0
package/dist/entry.js CHANGED
@@ -1,32 +1,33 @@
1
1
  import { startTests } from '@vitest/runner';
2
2
  import { resolve } from 'pathe';
3
- import { g as getWorkerState, r as resetModules } from './chunk-utils-env.04ffbef7.js';
4
- import { R as RealDate, g as globalExpect, a as vi } from './chunk-utils-import.39ffe9c5.js';
3
+ import { r as resetModules } from './chunk-utils-env.6b856dbf.js';
4
+ import { R as RealDate, g as globalExpect, a as vi } from './chunk-utils-import.e488ace3.js';
5
5
  import { d as distDir } from './chunk-paths.e36446b4.js';
6
- import { s as startCoverageInsideWorker, t as takeCoverageInsideWorker, a as stopCoverageInsideWorker } from './chunk-integrations-coverage.e0a6acd2.js';
6
+ import { a as startCoverageInsideWorker, t as takeCoverageInsideWorker, s as stopCoverageInsideWorker } from './chunk-integrations-coverage.d93ee824.js';
7
7
  import { createRequire } from 'node:module';
8
8
  import { isatty } from 'node:tty';
9
9
  import { installSourcemapsSupport } from 'vite-node/source-map';
10
10
  import { setupColors, createColors, getSafeTimers } from '@vitest/utils';
11
11
  import { e as environments } from './chunk-env-node.affdd278.js';
12
- import { i as index } from './chunk-integrations-utils.d7c85bd9.js';
12
+ import { i as index } from './chunk-integrations-utils.23c19408.js';
13
13
  import { s as setupSnapshotEnvironment } from './chunk-snapshot-env.a347d647.js';
14
14
  import { promises, existsSync } from 'node:fs';
15
- import { r as rpc } from './chunk-runtime-rpc.1b5714dc.js';
16
- import { s as setupCommonEnv } from './chunk-runtime-setup.a49dc2f9.js';
15
+ import { r as rpc } from './chunk-runtime-rpc.d6aa57f8.js';
16
+ import { s as setupCommonEnv } from './chunk-runtime-setup.5d504677.js';
17
+ import { g as getWorkerState } from './chunk-utils-global.fd174983.js';
17
18
  import 'std-env';
18
19
  import '@vitest/runner/utils';
19
20
  import 'chai';
20
21
  import './vendor-_commonjsHelpers.addc3445.js';
21
22
  import '@vitest/expect';
22
- import './chunk-utils-base.81f83dbd.js';
23
- import './chunk-utils-tasks.b41c8284.js';
23
+ import './chunk-utils-base.b5ddfcc9.js';
24
+ import './chunk-utils-tasks.8781fd71.js';
24
25
  import 'util';
25
26
  import '@vitest/spy';
26
27
  import 'node:url';
27
- import 'local-pkg';
28
28
  import 'node:console';
29
- import './chunk-integrations-run-once.a2b4758b.js';
29
+ import 'local-pkg';
30
+ import './chunk-integrations-run-once.ea614f17.js';
30
31
 
31
32
  class NodeSnapshotEnvironment {
32
33
  resolvePath(filepath) {
@@ -1,4 +1,4 @@
1
- import { P as Environment } from './types-fafda418.js';
1
+ import { Q as Environment } from './types-94cfe4b4.js';
2
2
  import '@vitest/expect';
3
3
  import 'vite';
4
4
  import '@vitest/runner';
package/dist/index.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import { Test } from '@vitest/runner';
2
2
  export { SequenceHooks, SequenceSetupFiles, afterAll, afterEach, beforeAll, beforeEach, describe, it, onTestFailed, suite, test } from '@vitest/runner';
3
- import { B as BenchmarkAPI, F as FakeTimerInstallOpts, M as MockFactoryWithHelper, R as RuntimeConfig, a as ResolvedConfig, b as ModuleGraphData, S as SnapshotResult, c as Reporter } from './types-fafda418.js';
4
- export { x as AfterSuiteRunMeta, A as ApiConfig, G as ArgumentsType, D as Arrayable, z as Awaitable, a2 as BaseCoverageOptions, a9 as BenchFunction, a7 as Benchmark, B as BenchmarkAPI, a8 as BenchmarkResult, a6 as BenchmarkUserOptions, h as BuiltinEnvironment, j as CSSModuleScopeStrategy, C as CollectLineNumbers, e as CollectLines, K as Constructable, g as Context, o as ContextRPC, n as ContextTestEnvironment, a4 as CoverageC8Options, a3 as CoverageIstanbulOptions, a0 as CoverageOptions, Y as CoverageProvider, _ as CoverageProviderModule, $ as CoverageReporter, a5 as CustomProviderOptions, P as Environment, E as EnvironmentOptions, O as EnvironmentReturn, I as InlineConfig, J as JSDOMOptions, L as ModuleCache, b as ModuleGraphData, H as MutableArray, N as Nullable, X as OnServerRestartHandler, d as RawErrsMap, Z as ReportContext, c as Reporter, w as ResolveIdFunction, a as ResolvedConfig, a1 as ResolvedCoverageOptions, f as RootAndTarget, R as RuntimeConfig, m as RuntimeRPC, q as SnapshotData, t as SnapshotMatchOptions, S as SnapshotResult, s as SnapshotStateOptions, v as SnapshotSummary, r as SnapshotUpdateState, T as TscErrorInfo, l as TypecheckConfig, u as UncheckedSnapshot, U as UserConfig, Q as UserConsoleLog, p as Vitest, V as VitestEnvironment, i as VitestPool, k as VitestRunMode, W as WorkerContext, y as WorkerGlobalState } from './types-fafda418.js';
3
+ import { B as BenchmarkAPI, F as FakeTimerInstallOpts, M as MockFactoryWithHelper, R as RuntimeConfig, A as AfterSuiteRunMeta, U as UserConsoleLog, a as ResolvedConfig, b as ModuleGraphData, S as SnapshotResult, c as Reporter } from './types-94cfe4b4.js';
4
+ export { A as AfterSuiteRunMeta, k as ApiConfig, H as ArgumentsType, G as Arrayable, D as Awaitable, a2 as BaseCoverageOptions, a9 as BenchFunction, a7 as Benchmark, B as BenchmarkAPI, a8 as BenchmarkResult, a6 as BenchmarkUserOptions, h as BuiltinEnvironment, j as CSSModuleScopeStrategy, C as CollectLineNumbers, e as CollectLines, L as Constructable, g as Context, q as ContextRPC, p as ContextTestEnvironment, a4 as CoverageC8Options, a3 as CoverageIstanbulOptions, a0 as CoverageOptions, Y as CoverageProvider, _ as CoverageProviderModule, $ as CoverageReporter, a5 as CustomProviderOptions, Q as Environment, E as EnvironmentOptions, P as EnvironmentReturn, I as InlineConfig, J as JSDOMOptions, O as ModuleCache, b as ModuleGraphData, K as MutableArray, N as Nullable, X as OnServerRestartHandler, d as RawErrsMap, Z as ReportContext, c as Reporter, y as ResolveIdFunction, a as ResolvedConfig, a1 as ResolvedCoverageOptions, f as RootAndTarget, R as RuntimeConfig, o as RuntimeRPC, s as SnapshotData, v as SnapshotMatchOptions, S as SnapshotResult, u as SnapshotStateOptions, x as SnapshotSummary, t as SnapshotUpdateState, T as TscErrorInfo, m as TypecheckConfig, w as UncheckedSnapshot, n as UserConfig, U as UserConsoleLog, r as Vitest, V as VitestEnvironment, i as VitestPool, l as VitestRunMode, W as WorkerContext, z as WorkerGlobalState } from './types-94cfe4b4.js';
5
5
  import { spyOn, fn, MaybeMockedDeep, MaybeMocked, MaybePartiallyMocked, MaybePartiallyMockedDeep, EnhancedSpy } from '@vitest/spy';
6
6
  export { EnhancedSpy, Mock, MockContext, MockInstance, Mocked, MockedClass, MockedFunction, MockedObject, SpyInstance } from '@vitest/spy';
7
7
  export { S as SnapshotEnvironment } from './env-afee91f0.js';
@@ -184,11 +184,7 @@ declare function isFirstRun(): boolean;
184
184
  declare function createExpect(test?: Test): Vi.ExpectStatic;
185
185
  declare const globalExpect: Vi.ExpectStatic;
186
186
 
187
- declare class VitestUtils {
188
- private _timers;
189
- private _mockedDate;
190
- private _mocker;
191
- constructor();
187
+ interface VitestUtils {
192
188
  useFakeTimers(config?: FakeTimerInstallOpts): this;
193
189
  useRealTimers(): this;
194
190
  runOnlyPendingTimers(): this;
@@ -202,12 +198,11 @@ declare class VitestUtils {
202
198
  advanceTimersToNextTimerAsync(): Promise<this>;
203
199
  getTimerCount(): number;
204
200
  setSystemTime(time: number | string | Date): this;
205
- getMockedSystemTime(): string | number | Date | null;
201
+ getMockedSystemTime(): Date | null;
206
202
  getRealSystemTime(): number;
207
203
  clearAllTimers(): this;
208
204
  spyOn: typeof spyOn;
209
205
  fn: typeof fn;
210
- private getImporter;
211
206
  /**
212
207
  * Makes all `imports` to passed module to be mocked.
213
208
  * - If there is a factory, will return it's result. The call to `vi.mock` is hoisted to the top of the file,
@@ -285,18 +280,17 @@ declare class VitestUtils {
285
280
  partial: true;
286
281
  deep: true;
287
282
  }): MaybePartiallyMockedDeep<T>;
283
+ mocked<T>(item: T): MaybeMocked<T>;
288
284
  isMockFunction(fn: any): fn is EnhancedSpy;
289
285
  clearAllMocks(): this;
290
286
  resetAllMocks(): this;
291
287
  restoreAllMocks(): this;
292
- private _stubsGlobal;
293
- private _stubsEnv;
294
288
  /**
295
289
  * Makes value available on global namespace.
296
290
  * Useful, if you want to have global variables available, like `IntersectionObserver`.
297
291
  * You can return it back to original value with `vi.unstubGlobals`, or by enabling `unstubGlobals` config option.
298
292
  */
299
- stubGlobal(name: string | symbol | number, value: any): this;
293
+ stubGlobal(name: string | symbol | number, value: unknown): this;
300
294
  /**
301
295
  * Changes the value of `import.meta.env` and `process.env`.
302
296
  * You can return it back to original value with `vi.unstubEnvs`, or by enabling `unstubEnvs` config option.
@@ -317,7 +311,6 @@ declare class VitestUtils {
317
311
  * Will also wait for new imports, started during the wait.
318
312
  */
319
313
  dynamicImportSettled(): Promise<void>;
320
- private _config;
321
314
  /**
322
315
  * Updates runtime config. You can only change values that are used when executing tests.
323
316
  */
@@ -339,7 +332,9 @@ interface TransformResultWithSource extends TransformResult {
339
332
  interface WebSocketHandlers {
340
333
  onCollected(files?: File[]): Promise<void>;
341
334
  onTaskUpdate(packs: TaskResultPack[]): void;
335
+ onAfterSuiteRun(meta: AfterSuiteRunMeta): void;
342
336
  onDone(name: string): void;
337
+ sendLog(log: UserConsoleLog): void;
343
338
  getFiles(): File[];
344
339
  getPaths(): string[];
345
340
  getConfig(): ResolvedConfig;
package/dist/index.js CHANGED
@@ -1,22 +1,23 @@
1
1
  export { afterAll, afterEach, beforeAll, beforeEach, describe, it, onTestFailed, suite, test } from '@vitest/runner';
2
- export { b as bench, c as createExpect, g as expect, a as vi, v as vitest } from './chunk-utils-import.39ffe9c5.js';
3
- export { i as isFirstRun, r as runOnce } from './chunk-integrations-run-once.a2b4758b.js';
4
- import { d as dist } from './chunk-integrations-utils.d7c85bd9.js';
5
- export { b as assertType, g as getRunningMode, a as isWatchMode } from './chunk-integrations-utils.d7c85bd9.js';
2
+ export { b as bench, c as createExpect, g as expect, a as vi, v as vitest } from './chunk-utils-import.e488ace3.js';
3
+ export { i as isFirstRun, r as runOnce } from './chunk-integrations-run-once.ea614f17.js';
4
+ import { d as dist } from './chunk-integrations-utils.23c19408.js';
5
+ export { b as assertType, g as getRunningMode, a as isWatchMode } from './chunk-integrations-utils.23c19408.js';
6
6
  import * as chai from 'chai';
7
7
  export { chai };
8
8
  export { assert, should } from 'chai';
9
9
  import '@vitest/runner/utils';
10
10
  import '@vitest/utils';
11
- import './chunk-utils-env.04ffbef7.js';
11
+ import './chunk-utils-env.6b856dbf.js';
12
12
  import 'pathe';
13
13
  import 'std-env';
14
+ import './chunk-utils-global.fd174983.js';
14
15
  import './vendor-_commonjsHelpers.addc3445.js';
15
16
  import '@vitest/expect';
16
- import './chunk-runtime-rpc.1b5714dc.js';
17
+ import './chunk-runtime-rpc.d6aa57f8.js';
17
18
  import './chunk-snapshot-env.a347d647.js';
18
- import './chunk-utils-base.81f83dbd.js';
19
- import './chunk-utils-tasks.b41c8284.js';
19
+ import './chunk-utils-base.b5ddfcc9.js';
20
+ import './chunk-utils-tasks.8781fd71.js';
20
21
  import 'util';
21
22
  import '@vitest/spy';
22
23
 
package/dist/loader.js CHANGED
@@ -2,7 +2,8 @@ import { pathToFileURL, fileURLToPath } from 'node:url';
2
2
  import { readFile } from 'node:fs/promises';
3
3
  import { i as isNodeBuiltin, h as hasCJSSyntax } from './vendor-index.bdee400f.js';
4
4
  import { normalizeModuleId } from 'vite-node/utils';
5
- import { g as getWorkerState } from './chunk-utils-env.04ffbef7.js';
5
+ import './chunk-utils-env.6b856dbf.js';
6
+ import { g as getWorkerState } from './chunk-utils-global.fd174983.js';
6
7
  import 'acorn';
7
8
  import 'node:module';
8
9
  import 'node:fs';
package/dist/node.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { k as VitestRunMode, U as UserConfig, p as Vitest, aa as MockFactory, ab as MockMap, ac as TestSequencer } from './types-fafda418.js';
2
- export { ac as TestSequencer, ae as TestSequencerConstructor, p as Vitest, ad as startVitest } from './types-fafda418.js';
1
+ import { l as VitestRunMode, n as UserConfig, r as Vitest, aa as MockFactory, ab as MockMap, ac as TestSequencer } from './types-94cfe4b4.js';
2
+ export { ac as TestSequencer, ae as TestSequencerConstructor, r as Vitest, ad as startVitest } from './types-94cfe4b4.js';
3
3
  import { UserConfig as UserConfig$1, Plugin } from 'vite';
4
4
  import { ViteNodeRunner } from 'vite-node/client';
5
5
  import { ViteNodeRunnerOptions } from 'vite-node';
package/dist/node.js CHANGED
@@ -1,15 +1,16 @@
1
- export { B as BaseSequencer, V as VitestPlugin, c as createVitest, s as startVitest } from './chunk-node-pkg.f9696901.js';
2
- export { V as VitestExecutor } from './chunk-runtime-mocker.344fec90.js';
1
+ export { B as BaseSequencer, V as VitestPlugin, c as createVitest, s as startVitest } from './chunk-node-pkg.30d8b37e.js';
2
+ export { V as VitestExecutor } from './chunk-runtime-mocker.3283818a.js';
3
3
  import 'pathe';
4
4
  import './chunk-constants.bc18a549.js';
5
- import './chunk-integrations-coverage.e0a6acd2.js';
6
- import 'local-pkg';
5
+ import './chunk-integrations-coverage.d93ee824.js';
7
6
  import './chunk-env-node.affdd278.js';
8
7
  import 'node:console';
8
+ import 'local-pkg';
9
9
  import 'picocolors';
10
- import './chunk-utils-env.04ffbef7.js';
10
+ import './chunk-utils-env.6b856dbf.js';
11
11
  import 'std-env';
12
12
  import '@vitest/runner/utils';
13
+ import './chunk-utils-global.fd174983.js';
13
14
  import '@vitest/utils';
14
15
  import 'vite';
15
16
  import 'node:path';
@@ -37,7 +38,7 @@ import 'source-map';
37
38
  import 'module';
38
39
  import 'acorn';
39
40
  import 'acorn-walk';
40
- import './chunk-utils-base.81f83dbd.js';
41
+ import './chunk-utils-base.b5ddfcc9.js';
41
42
  import 'crypto';
42
43
  import './chunk-paths.e36446b4.js';
43
44
  import 'node:v8';
@@ -45,7 +46,7 @@ import './vendor-index.783e7f3e.js';
45
46
  import 'node:worker_threads';
46
47
  import 'tinypool';
47
48
  import 'perf_hooks';
48
- import './chunk-utils-tasks.b41c8284.js';
49
+ import './chunk-utils-tasks.8781fd71.js';
49
50
  import '@vitest/utils/diff';
50
51
  import 'vite-node/server';
51
52
  import './vendor-magic-string.es.b3bc5745.js';
@@ -57,4 +58,4 @@ import './vendor-index.bdee400f.js';
57
58
  import 'node:assert';
58
59
  import 'node:util';
59
60
  import '@vitest/spy';
60
- import './chunk-runtime-rpc.1b5714dc.js';
61
+ import './chunk-runtime-rpc.d6aa57f8.js';
package/dist/runners.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { VitestRunner, VitestRunnerImportSource, Suite, Test, TestContext } from '@vitest/runner';
2
- import { a as ResolvedConfig } from './types-fafda418.js';
2
+ import { a as ResolvedConfig } from './types-94cfe4b4.js';
3
3
  import '@vitest/expect';
4
4
  import 'vite';
5
5
  import '@vitest/runner/types';
package/dist/runners.js CHANGED
@@ -1,16 +1,17 @@
1
1
  import { setState, GLOBAL_EXPECT, getState } from '@vitest/expect';
2
- import { d as getSnapshotClient, c as createExpect, a as vi, e as getBenchOptions, f as getBenchFn } from './chunk-utils-import.39ffe9c5.js';
3
- import { g as getWorkerState } from './chunk-utils-env.04ffbef7.js';
4
- import { g as getFullName } from './chunk-utils-tasks.b41c8284.js';
2
+ import { d as getSnapshotClient, c as createExpect, a as vi, e as getBenchOptions, f as getBenchFn } from './chunk-utils-import.e488ace3.js';
3
+ import './chunk-utils-env.6b856dbf.js';
4
+ import { g as getWorkerState } from './chunk-utils-global.fd174983.js';
5
+ import { g as getFullName } from './chunk-utils-tasks.8781fd71.js';
5
6
  import { updateTask } from '@vitest/runner';
6
7
  import { createDefer, getSafeTimers } from '@vitest/utils';
7
8
  import '@vitest/runner/utils';
8
9
  import 'chai';
9
10
  import './vendor-_commonjsHelpers.addc3445.js';
10
- import './chunk-runtime-rpc.1b5714dc.js';
11
+ import './chunk-runtime-rpc.d6aa57f8.js';
11
12
  import 'pathe';
12
13
  import './chunk-snapshot-env.a347d647.js';
13
- import './chunk-utils-base.81f83dbd.js';
14
+ import './chunk-utils-base.b5ddfcc9.js';
14
15
  import 'util';
15
16
  import '@vitest/spy';
16
17
  import 'std-env';
@@ -252,16 +252,15 @@ declare class Typechecker {
252
252
  getTestPacks(): TaskResultPack[];
253
253
  }
254
254
 
255
- type RunWithFiles = (files: string[], invalidates?: string[]) => Promise<void>;
256
- interface ProcessPool {
257
- runTests: RunWithFiles;
258
- close: () => Promise<void>;
255
+ interface BrowserProviderOptions {
256
+ browser: string;
259
257
  }
260
-
261
258
  interface BrowserProvider {
262
- initialize(ctx: Vitest): Awaitable$1<void>;
263
- createPool(): ProcessPool;
264
- testFinished?(testId: string): Awaitable$1<void>;
259
+ name: string;
260
+ getSupportedBrowsers(): readonly string[];
261
+ initialize(ctx: Vitest, options: BrowserProviderOptions): Awaitable$1<void>;
262
+ openPage(url: string): Awaitable$1<void>;
263
+ close(): Awaitable$1<void>;
265
264
  }
266
265
  interface BrowserConfigOptions {
267
266
  /**
@@ -272,16 +271,14 @@ interface BrowserConfigOptions {
272
271
  enabled?: boolean;
273
272
  /**
274
273
  * Name of the browser
275
- *
276
- * @default tries to find the first available browser
277
274
  */
278
- name?: 'firefox' | 'chrome' | 'edge' | 'safari';
275
+ name: string;
279
276
  /**
280
277
  * browser provider
281
278
  *
282
- * @default 'webdriver'
279
+ * @default 'webdriverio'
283
280
  */
284
- provider?: string;
281
+ provider?: 'webdriverio' | 'playwright' | (string & {});
285
282
  /**
286
283
  * enable headless mode
287
284
  *
@@ -301,6 +298,12 @@ interface ResolvedBrowserOptions extends BrowserConfigOptions {
301
298
  api: ApiConfig;
302
299
  }
303
300
 
301
+ type RunWithFiles = (files: string[], invalidates?: string[]) => Promise<void>;
302
+ interface ProcessPool {
303
+ runTests: RunWithFiles;
304
+ close: () => Promise<void>;
305
+ }
306
+
304
307
  interface CollectingPromise {
305
308
  promise: Promise<void>;
306
309
  resolve: () => void;
@@ -309,6 +312,10 @@ declare class StateManager {
309
312
  filesMap: Map<string, File>;
310
313
  pathsSet: Set<string>;
311
314
  collectingPromise: CollectingPromise | undefined;
315
+ browserTestPromises: Map<string, {
316
+ resolve: (v: unknown) => void;
317
+ reject: (v: unknown) => void;
318
+ }>;
312
319
  idMap: Map<string, Task>;
313
320
  taskFileMap: WeakMap<Task, File>;
314
321
  errorsSet: Set<unknown>;
@@ -480,7 +487,7 @@ declare class Vitest {
480
487
  filterFiles(testFiles: string[], filters?: string[]): string[];
481
488
  globTestFiles(filters?: string[]): Promise<string[]>;
482
489
  isTargetFile(id: string, source?: string): Promise<boolean>;
483
- isBrowserEnabled(): boolean;
490
+ isBrowserEnabled(): boolean | 0;
484
491
  shouldKeepServer(): boolean;
485
492
  isInSourceTestFile(code: string): boolean;
486
493
  onServerRestart(fn: OnServerRestartHandler): void;
@@ -2154,7 +2161,7 @@ declare global {
2154
2161
  }
2155
2162
  interface AsymmetricMatchersContaining {
2156
2163
  stringContaining(expected: string): any;
2157
- objectContaining(expected: any): any;
2164
+ objectContaining<T = any>(expected: T): any;
2158
2165
  arrayContaining<T = unknown>(expected: Array<T>): any;
2159
2166
  stringMatching(expected: string | RegExp): any;
2160
2167
  }
@@ -2256,4 +2263,4 @@ type Context = RootAndTarget & {
2256
2263
  lastActivePath?: string;
2257
2264
  };
2258
2265
 
2259
- export { CoverageReporter as $, ApiConfig as A, BenchmarkAPI as B, CollectLineNumbers as C, Arrayable as D, EnvironmentOptions as E, FakeTimerInstallOpts as F, ArgumentsType$1 as G, MutableArray as H, InlineConfig as I, JSDOMOptions as J, Constructable as K, ModuleCache as L, MockFactoryWithHelper as M, Nullable as N, EnvironmentReturn as O, Environment as P, UserConsoleLog as Q, RuntimeConfig as R, SnapshotResult as S, TscErrorInfo as T, UserConfig as U, VitestEnvironment as V, WorkerContext as W, OnServerRestartHandler as X, CoverageProvider as Y, ReportContext as Z, CoverageProviderModule as _, ResolvedConfig as a, CoverageOptions as a0, ResolvedCoverageOptions as a1, BaseCoverageOptions as a2, CoverageIstanbulOptions as a3, CoverageC8Options as a4, CustomProviderOptions as a5, BenchmarkUserOptions as a6, Benchmark as a7, BenchmarkResult as a8, BenchFunction as a9, MockFactory as aa, MockMap as ab, TestSequencer as ac, startVitest as ad, TestSequencerConstructor as ae, HtmlOptions as af, FileOptions as ag, CloverOptions as ah, CoberturaOptions as ai, HtmlSpaOptions as aj, LcovOptions as ak, LcovOnlyOptions as al, TeamcityOptions as am, TextOptions as an, ProjectOptions as ao, ModuleGraphData as b, Reporter as c, RawErrsMap as d, CollectLines as e, RootAndTarget as f, Context as g, BuiltinEnvironment as h, VitestPool as i, CSSModuleScopeStrategy as j, VitestRunMode as k, TypecheckConfig as l, RuntimeRPC as m, ContextTestEnvironment as n, ContextRPC as o, Vitest as p, SnapshotData as q, SnapshotUpdateState as r, SnapshotStateOptions as s, SnapshotMatchOptions as t, UncheckedSnapshot as u, SnapshotSummary as v, ResolveIdFunction as w, AfterSuiteRunMeta as x, WorkerGlobalState as y, Awaitable as z };
2266
+ export { CoverageReporter as $, AfterSuiteRunMeta as A, BenchmarkAPI as B, CollectLineNumbers as C, Awaitable as D, EnvironmentOptions as E, FakeTimerInstallOpts as F, Arrayable as G, ArgumentsType$1 as H, InlineConfig as I, JSDOMOptions as J, MutableArray as K, Constructable as L, MockFactoryWithHelper as M, Nullable as N, ModuleCache as O, EnvironmentReturn as P, Environment as Q, RuntimeConfig as R, SnapshotResult as S, TscErrorInfo as T, UserConsoleLog as U, VitestEnvironment as V, WorkerContext as W, OnServerRestartHandler as X, CoverageProvider as Y, ReportContext as Z, CoverageProviderModule as _, ResolvedConfig as a, CoverageOptions as a0, ResolvedCoverageOptions as a1, BaseCoverageOptions as a2, CoverageIstanbulOptions as a3, CoverageC8Options as a4, CustomProviderOptions as a5, BenchmarkUserOptions as a6, Benchmark as a7, BenchmarkResult as a8, BenchFunction as a9, MockFactory as aa, MockMap as ab, TestSequencer as ac, startVitest as ad, TestSequencerConstructor as ae, HtmlOptions as af, FileOptions as ag, CloverOptions as ah, CoberturaOptions as ai, HtmlSpaOptions as aj, LcovOptions as ak, LcovOnlyOptions as al, TeamcityOptions as am, TextOptions as an, ProjectOptions as ao, ModuleGraphData as b, Reporter as c, RawErrsMap as d, CollectLines as e, RootAndTarget as f, Context as g, BuiltinEnvironment as h, VitestPool as i, CSSModuleScopeStrategy as j, ApiConfig as k, VitestRunMode as l, TypecheckConfig as m, UserConfig as n, RuntimeRPC as o, ContextTestEnvironment as p, ContextRPC as q, Vitest as r, SnapshotData as s, SnapshotUpdateState as t, SnapshotStateOptions as u, SnapshotMatchOptions as v, UncheckedSnapshot as w, SnapshotSummary as x, ResolveIdFunction as y, WorkerGlobalState as z };
@@ -0,0 +1 @@
1
+ export * from '@vitest/utils';
package/dist/utils.js ADDED
@@ -0,0 +1 @@
1
+ export * from '@vitest/utils';
package/dist/worker.js CHANGED
@@ -1,16 +1,13 @@
1
1
  import { c as createBirpc } from './vendor-index.783e7f3e.js';
2
2
  import { workerId } from 'tinypool';
3
- import { g as getWorkerState } from './chunk-utils-env.04ffbef7.js';
4
- import { s as startViteNode, m as moduleCache, a as mockMap } from './chunk-runtime-mocker.344fec90.js';
3
+ import { g as getWorkerState } from './chunk-utils-global.fd174983.js';
4
+ import { s as startViteNode, m as moduleCache, a as mockMap } from './chunk-runtime-mocker.3283818a.js';
5
5
  import { s as setupInspect } from './chunk-runtime-inspector.b1427a10.js';
6
- import { a as rpcDone } from './chunk-runtime-rpc.1b5714dc.js';
7
- import 'pathe';
8
- import 'std-env';
9
- import '@vitest/runner/utils';
10
- import '@vitest/utils';
6
+ import { a as rpcDone } from './chunk-runtime-rpc.d6aa57f8.js';
11
7
  import 'node:url';
12
8
  import 'vite-node/client';
13
9
  import 'vite-node/utils';
10
+ import 'pathe';
14
11
  import './vendor-index.bdee400f.js';
15
12
  import 'acorn';
16
13
  import 'node:module';
@@ -20,8 +17,10 @@ import 'node:process';
20
17
  import 'node:path';
21
18
  import 'node:v8';
22
19
  import 'node:util';
20
+ import '@vitest/runner/utils';
23
21
  import './chunk-paths.e36446b4.js';
24
- import './chunk-utils-base.81f83dbd.js';
22
+ import '@vitest/utils';
23
+ import './chunk-utils-base.b5ddfcc9.js';
25
24
  import '@vitest/spy';
26
25
  import 'node:inspector';
27
26
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "vitest",
3
3
  "type": "module",
4
- "version": "0.29.7",
4
+ "version": "0.29.8",
5
5
  "description": "A blazing fast unit test framework powered by Vite",
6
6
  "author": "Anthony Fu <anthonyfu117@hotmail.com>",
7
7
  "license": "MIT",
@@ -61,6 +61,10 @@
61
61
  "types": "./dist/environments.d.ts",
62
62
  "import": "./dist/environments.js"
63
63
  },
64
+ "./utils": {
65
+ "types": "./dist/utils.d.ts",
66
+ "import": "./dist/utils.js"
67
+ },
64
68
  "./config": {
65
69
  "types": "./config.d.ts",
66
70
  "require": "./dist/config.cjs",
@@ -93,7 +97,10 @@
93
97
  "@vitest/browser": "*",
94
98
  "@vitest/ui": "*",
95
99
  "happy-dom": "*",
96
- "jsdom": "*"
100
+ "jsdom": "*",
101
+ "playwright": "*",
102
+ "safaridriver": "*",
103
+ "webdriverio": "*"
97
104
  },
98
105
  "peerDependenciesMeta": {
99
106
  "@vitest/ui": {
@@ -114,6 +121,9 @@
114
121
  "safaridriver": {
115
122
  "optional": true
116
123
  },
124
+ "playwright": {
125
+ "optional": true
126
+ },
117
127
  "@edge-runtime/vm": {
118
128
  "optional": true
119
129
  }
@@ -138,11 +148,11 @@
138
148
  "tinyspy": "^1.0.2",
139
149
  "vite": "^3.0.0 || ^4.0.0",
140
150
  "why-is-node-running": "^2.2.2",
141
- "@vitest/utils": "0.29.7",
142
- "vite-node": "0.29.7",
143
- "@vitest/expect": "0.29.7",
144
- "@vitest/spy": "0.29.7",
145
- "@vitest/runner": "0.29.7"
151
+ "@vitest/runner": "0.29.8",
152
+ "vite-node": "0.29.8",
153
+ "@vitest/expect": "0.29.8",
154
+ "@vitest/spy": "0.29.8",
155
+ "@vitest/utils": "0.29.8"
146
156
  },
147
157
  "devDependencies": {
148
158
  "@ampproject/remapping": "^2.2.0",
@@ -177,6 +187,7 @@
177
187
  "natural-compare": "^1.4.0",
178
188
  "p-limit": "^4.0.0",
179
189
  "pkg-types": "^1.0.1",
190
+ "playwright": "^1.28.0",
180
191
  "pretty-format": "^27.5.1",
181
192
  "prompts": "^2.4.2",
182
193
  "rollup": "^2.79.1",
package/utils.d.ts ADDED
@@ -0,0 +1 @@
1
+ export * from './dist/utils.js'