@vitest/runner 4.0.0-beta.1 → 4.0.0-beta.2

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.
@@ -1759,8 +1759,8 @@ async function runSuite(suite, runner) {
1759
1759
  }
1760
1760
  }
1761
1761
  suite.result.duration = now$1() - start;
1762
- updateTask("suite-finished", suite, runner);
1763
1762
  await ((_runner$onAfterRunSui = runner.onAfterRunSuite) === null || _runner$onAfterRunSui === void 0 ? void 0 : _runner$onAfterRunSui.call(runner, suite));
1763
+ updateTask("suite-finished", suite, runner);
1764
1764
  }
1765
1765
  }
1766
1766
  let limitMaxConcurrency;
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { A as AfterAllListener, b as AfterEachListener, B as BeforeAllListener, d as BeforeEachListener, e as TaskHook, O as OnTestFailedHandler, f as OnTestFinishedHandler, a as Test, g as Custom, S as Suite, h as SuiteHooks, F as File, i as TaskUpdateEvent, T as Task, j as TestAPI, k as SuiteAPI, l as SuiteCollector } from './tasks.d-ZIXcbWf9.js';
2
- export { D as DoneCallback, E as ExtendedContext, m as Fixture, n as FixtureFn, o as FixtureOptions, p as Fixtures, H as HookCleanupCallback, q as HookListener, I as ImportDuration, r as InferFixturesTypes, R as RunMode, s as RuntimeContext, t as SequenceHooks, u as SequenceSetupFiles, v as SuiteFactory, w as TaskBase, x as TaskContext, y as TaskCustomOptions, z as TaskEventPack, G as TaskMeta, J as TaskPopulated, K as TaskResult, L as TaskResultPack, M as TaskState, N as TestAnnotation, P as TestAnnotationLocation, Q as TestAttachment, U as TestContext, V as TestFunction, W as TestOptions, X as Use } from './tasks.d-ZIXcbWf9.js';
1
+ import { A as AfterAllListener, b as AfterEachListener, B as BeforeAllListener, d as BeforeEachListener, e as TaskHook, O as OnTestFailedHandler, f as OnTestFinishedHandler, a as Test, S as Suite, g as SuiteHooks, F as File, h as TaskUpdateEvent, T as Task, i as TestAPI, j as SuiteAPI, k as SuiteCollector } from './tasks.d-BPS2nWLO.js';
2
+ export { l as Fixture, m as FixtureFn, n as FixtureOptions, o as Fixtures, H as HookCleanupCallback, p as HookListener, I as ImportDuration, q as InferFixturesTypes, R as RunMode, r as RuntimeContext, s as SequenceHooks, t as SequenceSetupFiles, u as SuiteFactory, v as TaskBase, w as TaskCustomOptions, x as TaskEventPack, y as TaskMeta, z as TaskPopulated, D as TaskResult, E as TaskResultPack, G as TaskState, J as TestAnnotation, K as TestAnnotationLocation, L as TestAttachment, M as TestContext, N as TestFunction, P as TestOptions, U as Use } from './tasks.d-BPS2nWLO.js';
3
3
  import { Awaitable } from '@vitest/utils';
4
4
  import { FileSpecification, VitestRunner } from './types.js';
5
5
  export { CancelReason, VitestRunnerConfig, VitestRunnerConstructor, VitestRunnerImportSource } from './types.js';
@@ -122,8 +122,8 @@ declare const onTestFailed: TaskHook<OnTestFailedHandler>;
122
122
  */
123
123
  declare const onTestFinished: TaskHook<OnTestFinishedHandler>;
124
124
 
125
- declare function setFn(key: Test | Custom, fn: () => Awaitable<void>): void;
126
- declare function getFn<Task = Test | Custom>(key: Task): () => Awaitable<void>;
125
+ declare function setFn(key: Test, fn: () => Awaitable<void>): void;
126
+ declare function getFn<Task = Test>(key: Task): () => Awaitable<void>;
127
127
  declare function setHooks(key: Suite, hooks: SuiteHooks): void;
128
128
  declare function getHooks(key: Suite): SuiteHooks;
129
129
 
@@ -258,4 +258,4 @@ declare function createTaskCollector(fn: (...args: any[]) => any, context?: Reco
258
258
 
259
259
  declare function getCurrentTest<T extends Test | undefined>(): T;
260
260
 
261
- export { AfterAllListener, AfterEachListener, BeforeAllListener, BeforeEachListener, Custom, TestAPI as CustomAPI, File, FileSpecification, OnTestFailedHandler, OnTestFinishedHandler, Suite, SuiteAPI, SuiteCollector, SuiteHooks, Task, TaskHook, TaskUpdateEvent, Test, TestAPI, VitestRunner, afterAll, afterEach, beforeAll, beforeEach, publicCollect as collectTests, createTaskCollector, describe, getCurrentSuite, getCurrentTest, getFn, getHooks, it, onTestFailed, onTestFinished, setFn, setHooks, startTests, suite, test, updateTask };
261
+ export { AfterAllListener, AfterEachListener, BeforeAllListener, BeforeEachListener, File, FileSpecification, OnTestFailedHandler, OnTestFinishedHandler, Suite, SuiteAPI, SuiteCollector, SuiteHooks, Task, TaskHook, TaskUpdateEvent, Test, TestAPI, VitestRunner, afterAll, afterEach, beforeAll, beforeEach, publicCollect as collectTests, createTaskCollector, describe, getCurrentSuite, getCurrentTest, getFn, getHooks, it, onTestFailed, onTestFinished, setFn, setHooks, startTests, suite, test, updateTask };
@@ -243,15 +243,7 @@ interface TestAnnotation {
243
243
  location?: TestAnnotationLocation;
244
244
  attachment?: TestAttachment;
245
245
  }
246
- /**
247
- * @deprecated Use `Test` instead. `type: 'custom'` is not used since 2.2
248
- */
249
- type Custom<ExtraContext = object> = Test<ExtraContext>;
250
246
  type Task = Test | Suite | File;
251
- /**
252
- * @deprecated Vitest doesn't provide `done()` anymore
253
- */
254
- type DoneCallback = (error?: any) => void;
255
247
  type TestFunction<ExtraContext = object> = (context: TestContext & ExtraContext) => Awaitable<any> | void;
256
248
  // jest's ExtractEachCallbackArgs
257
249
  type ExtractEachCallbackArgs<T extends ReadonlyArray<any>> = {
@@ -374,7 +366,6 @@ type TestAPI<ExtraContext = object> = ChainableTestAPI<ExtraContext> & ExtendedA
374
366
  extend: <T extends Record<string, any> = object>(fixtures: Fixtures<T, ExtraContext>) => TestAPI<{ [K in keyof T | keyof ExtraContext] : K extends keyof T ? T[K] : K extends keyof ExtraContext ? ExtraContext[K] : never }>
375
367
  scoped: (fixtures: Fixtures<Partial<ExtraContext>>) => void
376
368
  };
377
-
378
369
  interface FixtureOptions {
379
370
  /**
380
371
  * Whether to automatically set up current fixture, even though it's not being used in tests.
@@ -539,13 +530,6 @@ interface TestContext {
539
530
  (message: string, attachment?: TestAttachment): Promise<TestAnnotation>
540
531
  };
541
532
  }
542
- /**
543
- * Context that's always available in the test function.
544
- * @deprecated use `TestContext` instead
545
- */
546
- interface TaskContext extends TestContext {}
547
- /** @deprecated use `TestContext` instead */
548
- type ExtendedContext = TaskContext & TestContext;
549
533
  type OnTestFailedHandler = (context: TestContext) => Awaitable<void>;
550
534
  type OnTestFinishedHandler = (context: TestContext) => Awaitable<void>;
551
535
  interface TaskHook<HookListener> {
@@ -555,4 +539,4 @@ type SequenceHooks = "stack" | "list" | "parallel";
555
539
  type SequenceSetupFiles = "list" | "parallel";
556
540
 
557
541
  export { createChainable as c };
558
- export type { AfterAllListener as A, BeforeAllListener as B, ChainableFunction as C, DoneCallback as D, ExtendedContext as E, File as F, TaskMeta as G, HookCleanupCallback as H, ImportDuration as I, TaskPopulated as J, TaskResult as K, TaskResultPack as L, TaskState as M, TestAnnotation as N, OnTestFailedHandler as O, TestAnnotationLocation as P, TestAttachment as Q, RunMode as R, Suite as S, Task as T, TestContext as U, TestFunction as V, TestOptions as W, Use as X, Test as a, AfterEachListener as b, BeforeEachListener as d, TaskHook as e, OnTestFinishedHandler as f, Custom as g, SuiteHooks as h, TaskUpdateEvent as i, TestAPI as j, SuiteAPI as k, SuiteCollector as l, Fixture as m, FixtureFn as n, FixtureOptions as o, Fixtures as p, HookListener as q, InferFixturesTypes as r, RuntimeContext as s, SequenceHooks as t, SequenceSetupFiles as u, SuiteFactory as v, TaskBase as w, TaskContext as x, TaskCustomOptions as y, TaskEventPack as z };
542
+ export type { AfterAllListener as A, BeforeAllListener as B, ChainableFunction as C, TaskResult as D, TaskResultPack as E, File as F, TaskState as G, HookCleanupCallback as H, ImportDuration as I, TestAnnotation as J, TestAnnotationLocation as K, TestAttachment as L, TestContext as M, TestFunction as N, OnTestFailedHandler as O, TestOptions as P, RunMode as R, Suite as S, Task as T, Use as U, Test as a, AfterEachListener as b, BeforeEachListener as d, TaskHook as e, OnTestFinishedHandler as f, SuiteHooks as g, TaskUpdateEvent as h, TestAPI as i, SuiteAPI as j, SuiteCollector as k, Fixture as l, FixtureFn as m, FixtureOptions as n, Fixtures as o, HookListener as p, InferFixturesTypes as q, RuntimeContext as r, SequenceHooks as s, SequenceSetupFiles as t, SuiteFactory as u, TaskBase as v, TaskCustomOptions as w, TaskEventPack as x, TaskMeta as y, TaskPopulated as z };
package/dist/types.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { DiffOptions } from '@vitest/utils/diff';
2
- import { F as File, a as Test, S as Suite, L as TaskResultPack, z as TaskEventPack, N as TestAnnotation, U as TestContext, I as ImportDuration, t as SequenceHooks, u as SequenceSetupFiles } from './tasks.d-ZIXcbWf9.js';
3
- export { A as AfterAllListener, b as AfterEachListener, B as BeforeAllListener, d as BeforeEachListener, g as Custom, j as CustomAPI, D as DoneCallback, E as ExtendedContext, m as Fixture, n as FixtureFn, o as FixtureOptions, p as Fixtures, H as HookCleanupCallback, q as HookListener, r as InferFixturesTypes, O as OnTestFailedHandler, f as OnTestFinishedHandler, R as RunMode, s as RuntimeContext, k as SuiteAPI, l as SuiteCollector, v as SuiteFactory, h as SuiteHooks, T as Task, w as TaskBase, x as TaskContext, y as TaskCustomOptions, e as TaskHook, G as TaskMeta, J as TaskPopulated, K as TaskResult, M as TaskState, i as TaskUpdateEvent, j as TestAPI, P as TestAnnotationLocation, Q as TestAttachment, V as TestFunction, W as TestOptions, X as Use } from './tasks.d-ZIXcbWf9.js';
2
+ import { F as File, a as Test, S as Suite, E as TaskResultPack, x as TaskEventPack, J as TestAnnotation, M as TestContext, I as ImportDuration, s as SequenceHooks, t as SequenceSetupFiles } from './tasks.d-BPS2nWLO.js';
3
+ export { A as AfterAllListener, b as AfterEachListener, B as BeforeAllListener, d as BeforeEachListener, l as Fixture, m as FixtureFn, n as FixtureOptions, o as Fixtures, H as HookCleanupCallback, p as HookListener, q as InferFixturesTypes, O as OnTestFailedHandler, f as OnTestFinishedHandler, R as RunMode, r as RuntimeContext, j as SuiteAPI, k as SuiteCollector, u as SuiteFactory, g as SuiteHooks, T as Task, v as TaskBase, w as TaskCustomOptions, e as TaskHook, y as TaskMeta, z as TaskPopulated, D as TaskResult, G as TaskState, h as TaskUpdateEvent, i as TestAPI, K as TestAnnotationLocation, L as TestAttachment, N as TestFunction, P as TestOptions, U as Use } from './tasks.d-BPS2nWLO.js';
4
4
  import '@vitest/utils';
5
5
 
6
6
  /**
package/dist/utils.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { S as Suite, F as File, T as Task, a as Test } from './tasks.d-ZIXcbWf9.js';
2
- export { C as ChainableFunction, c as createChainable } from './tasks.d-ZIXcbWf9.js';
1
+ import { S as Suite, F as File, T as Task, a as Test } from './tasks.d-BPS2nWLO.js';
2
+ export { C as ChainableFunction, c as createChainable } from './tasks.d-BPS2nWLO.js';
3
3
  import { Arrayable } from '@vitest/utils';
4
4
 
5
5
  /**
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@vitest/runner",
3
3
  "type": "module",
4
- "version": "4.0.0-beta.1",
4
+ "version": "4.0.0-beta.2",
5
5
  "description": "Vitest test runner",
6
6
  "license": "MIT",
7
7
  "funding": "https://opencollective.com/vitest",
@@ -40,7 +40,7 @@
40
40
  "dependencies": {
41
41
  "pathe": "^2.0.3",
42
42
  "strip-literal": "^3.0.0",
43
- "@vitest/utils": "4.0.0-beta.1"
43
+ "@vitest/utils": "4.0.0-beta.2"
44
44
  },
45
45
  "scripts": {
46
46
  "build": "rimraf dist && rollup -c",