@vitest/runner 3.1.0-beta.1 → 3.1.0
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-tasks.js +245 -243
- package/dist/index.d.ts +2 -2
- package/dist/index.js +1435 -1314
- package/dist/{tasks.d-D-sw4YOL.d.ts → tasks.d-hsdzc98-.d.ts} +6 -2
- package/dist/types.d.ts +8 -3
- package/dist/utils.d.ts +2 -2
- package/package.json +2 -2
@@ -333,6 +333,7 @@ interface ExtendedAPI<ExtraContext> {
|
|
333
333
|
}
|
334
334
|
type TestAPI<ExtraContext = object> = ChainableTestAPI<ExtraContext> & ExtendedAPI<ExtraContext> & {
|
335
335
|
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 }>
|
336
|
+
scoped: (fixtures: Fixtures<Partial<ExtraContext>>) => void
|
336
337
|
};
|
337
338
|
|
338
339
|
interface FixtureOptions {
|
@@ -433,6 +434,8 @@ interface SuiteCollector<ExtraContext = object> {
|
|
433
434
|
type: "collector";
|
434
435
|
test: TestAPI<ExtraContext>;
|
435
436
|
tasks: (Suite | Test<ExtraContext> | SuiteCollector<ExtraContext>)[];
|
437
|
+
scoped: (fixtures: Fixtures<any, ExtraContext>) => void;
|
438
|
+
fixtures: () => FixtureItem[] | undefined;
|
436
439
|
suite?: Suite;
|
437
440
|
task: (name: string, options?: TaskCustomOptions) => Test<ExtraContext>;
|
438
441
|
collect: (file: File) => Promise<Suite>;
|
@@ -451,7 +454,7 @@ interface TestContext {
|
|
451
454
|
/**
|
452
455
|
* Metadata of the current test
|
453
456
|
*/
|
454
|
-
task: Readonly<
|
457
|
+
task: Readonly<Test<TestContext>>;
|
455
458
|
/**
|
456
459
|
* Extract hooks on test failed
|
457
460
|
*/
|
@@ -484,4 +487,5 @@ interface TaskHook<HookListener> {
|
|
484
487
|
type SequenceHooks = "stack" | "list" | "parallel";
|
485
488
|
type SequenceSetupFiles = "list" | "parallel";
|
486
489
|
|
487
|
-
export {
|
490
|
+
export { createChainable as c };
|
491
|
+
export type { AfterAllListener as A, BeforeAllListener as B, ChainableFunction as C, DoneCallback as D, ExtendedContext as E, File as F, TaskPopulated as G, HookCleanupCallback as H, InferFixturesTypes as I, TaskResult as J, TaskResultPack as K, TaskState 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, 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, RuntimeContext as r, SequenceHooks as s, SequenceSetupFiles as t, SuiteFactory as u, TaskBase as v, TaskContext as w, TaskCustomOptions as x, TaskEventPack as y, TaskMeta 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, T as Task, a as Test, S as Suite, K as TaskResultPack, y as TaskEventPack, M as TestContext, s as SequenceHooks, t as SequenceSetupFiles } from './tasks.d-
|
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, I as InferFixturesTypes, O as OnTestFailedHandler, f as OnTestFinishedHandler, R as RunMode, r as RuntimeContext, k as SuiteAPI, l as SuiteCollector, u as SuiteFactory, h as SuiteHooks, v as TaskBase, w as TaskContext, x as TaskCustomOptions, e as TaskHook, z as TaskMeta, G as TaskPopulated, J as TaskResult, L as TaskState, i as TaskUpdateEvent, j as TestAPI, N as TestFunction, P as TestOptions, U as Use } from './tasks.d-
|
2
|
+
import { F as File, T as Task, a as Test, S as Suite, K as TaskResultPack, y as TaskEventPack, M as TestContext, s as SequenceHooks, t as SequenceSetupFiles } from './tasks.d-hsdzc98-.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, I as InferFixturesTypes, O as OnTestFailedHandler, f as OnTestFinishedHandler, R as RunMode, r as RuntimeContext, k as SuiteAPI, l as SuiteCollector, u as SuiteFactory, h as SuiteHooks, v as TaskBase, w as TaskContext, x as TaskCustomOptions, e as TaskHook, z as TaskMeta, G as TaskPopulated, J as TaskResult, L as TaskState, i as TaskUpdateEvent, j as TestAPI, N as TestFunction, P as TestOptions, U as Use } from './tasks.d-hsdzc98-.js';
|
4
4
|
import '@vitest/utils';
|
5
5
|
|
6
6
|
/**
|
@@ -140,6 +140,11 @@ interface VitestRunner {
|
|
140
140
|
* The name of the current pool. Can affect how stack trace is inferred on the server side.
|
141
141
|
*/
|
142
142
|
pool?: string;
|
143
|
+
/** @private */
|
144
|
+
_currentTaskStartTime?: number;
|
145
|
+
/** @private */
|
146
|
+
_currentTaskTimeout?: number;
|
143
147
|
}
|
144
148
|
|
145
|
-
export {
|
149
|
+
export { File, SequenceHooks, SequenceSetupFiles, Suite, Task, TaskEventPack, TaskResultPack, Test, TestContext };
|
150
|
+
export type { CancelReason, FileSpecification, VitestRunner, VitestRunnerConfig, VitestRunnerConstructor, VitestRunnerImportSource };
|
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-hsdzc98-.js';
|
2
|
+
export { C as ChainableFunction, c as createChainable } from './tasks.d-hsdzc98-.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": "3.1.0
|
4
|
+
"version": "3.1.0",
|
5
5
|
"description": "Vitest test runner",
|
6
6
|
"license": "MIT",
|
7
7
|
"funding": "https://opencollective.com/vitest",
|
@@ -39,7 +39,7 @@
|
|
39
39
|
],
|
40
40
|
"dependencies": {
|
41
41
|
"pathe": "^2.0.3",
|
42
|
-
"@vitest/utils": "3.1.0
|
42
|
+
"@vitest/utils": "3.1.0"
|
43
43
|
},
|
44
44
|
"scripts": {
|
45
45
|
"build": "rimraf dist && rollup -c",
|