@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.
package/dist/chunk-hooks.js
CHANGED
@@ -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,
|
2
|
-
export {
|
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
|
126
|
-
declare function getFn<Task = Test
|
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,
|
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,
|
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,
|
3
|
-
export { A as AfterAllListener, b as AfterEachListener, B as BeforeAllListener, d as BeforeEachListener,
|
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-
|
2
|
-
export { C as ChainableFunction, c as createChainable } from './tasks.d-
|
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.
|
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.
|
43
|
+
"@vitest/utils": "4.0.0-beta.2"
|
44
44
|
},
|
45
45
|
"scripts": {
|
46
46
|
"build": "rimraf dist && rollup -c",
|