@vitest/runner 0.34.6 → 0.34.7
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/index.d.ts
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
import { VitestRunner } from './types.js';
|
2
2
|
export { CancelReason, VitestRunnerConfig, VitestRunnerConstructor, VitestRunnerImportSource } from './types.js';
|
3
|
-
import { T as Task, F as File, d as SuiteAPI, e as TestAPI, f as SuiteCollector, g as SuiteHooks, O as OnTestFailedHandler, a as Test } from './tasks-
|
4
|
-
export { D as DoneCallback, o as
|
3
|
+
import { T as Task, F as File, d as SuiteAPI, e as TestAPI, f as SuiteCollector, g as SuiteHooks, O as OnTestFailedHandler, a as Test } from './tasks-d7d578d8.js';
|
4
|
+
export { D as DoneCallback, o as Fixture, p as Fixtures, q as HookCleanupCallback, H as HookListener, I as InferFixturesTypes, R as RunMode, s as RuntimeContext, u as SequenceHooks, v as SequenceSetupFiles, S as Suite, r as SuiteFactory, i as TaskBase, b as TaskCustom, j as TaskMeta, k as TaskResult, l as TaskResultPack, h as TaskState, t as TestContext, m as TestFunction, n as TestOptions } from './tasks-d7d578d8.js';
|
5
5
|
import { Awaitable } from '@vitest/utils';
|
6
6
|
|
7
7
|
declare function updateTask(task: Task, runner: VitestRunner): void;
|
@@ -133,11 +133,16 @@ type TestAPI<ExtraContext = {}> = ChainableTestAPI<ExtraContext> & {
|
|
133
133
|
[K in keyof T | keyof ExtraContext]: K extends keyof T ? T[K] : K extends keyof ExtraContext ? ExtraContext[K] : never;
|
134
134
|
}>;
|
135
135
|
};
|
136
|
+
type FixtureType<T> = T extends (context: any, use: (fixture: infer F) => any) => any ? F : T;
|
137
|
+
type Fixture<T, K extends keyof T, OnlyFunction, ExtraContext = {}, V = FixtureType<T[K]>, FN = (context: {
|
138
|
+
[P in keyof T | keyof ExtraContext as P extends K ? P extends keyof ExtraContext ? P : never : P]: K extends P ? K extends keyof ExtraContext ? ExtraContext[K] : V : P extends keyof T ? T[P] : never;
|
139
|
+
} & TestContext, use: (fixture: V) => Promise<void>) => Promise<void>> = OnlyFunction extends true ? FN : (FN | V);
|
136
140
|
type Fixtures<T extends Record<string, any>, ExtraContext = {}> = {
|
137
|
-
[K in keyof T]: T
|
138
|
-
|
139
|
-
|
141
|
+
[K in keyof T]: Fixture<T, K, false, ExtraContext>;
|
142
|
+
} | {
|
143
|
+
[K in keyof T]: Fixture<T, K, true, ExtraContext>;
|
140
144
|
};
|
145
|
+
type InferFixturesTypes<T> = T extends TestAPI<infer C> ? C : T;
|
141
146
|
type ChainableSuiteAPI<ExtraContext = {}> = ChainableFunction<'concurrent' | 'sequential' | 'only' | 'skip' | 'todo' | 'shuffle', [
|
142
147
|
name: string | Function,
|
143
148
|
factory?: SuiteFactory<ExtraContext>,
|
@@ -200,4 +205,4 @@ type OnTestFailedHandler = (result: TaskResult) => Awaitable<void>;
|
|
200
205
|
type SequenceHooks = 'stack' | 'list' | 'parallel';
|
201
206
|
type SequenceSetupFiles = 'list' | 'parallel';
|
202
207
|
|
203
|
-
export { ChainableFunction as C, DoneCallback as D, File as F, HookListener as H, OnTestFailedHandler as O, RunMode as R, Suite as S, Task as T, Test as a, TaskCustom as b, createChainable as c, SuiteAPI as d, TestAPI as e, SuiteCollector as f, SuiteHooks as g, TaskState as h, TaskBase as i, TaskMeta as j, TaskResult as k, TaskResultPack as l, TestFunction as m, TestOptions as n,
|
208
|
+
export { ChainableFunction as C, DoneCallback as D, File as F, HookListener as H, InferFixturesTypes as I, OnTestFailedHandler as O, RunMode as R, Suite as S, Task as T, Test as a, TaskCustom as b, createChainable as c, SuiteAPI as d, TestAPI as e, SuiteCollector as f, SuiteHooks as g, TaskState as h, TaskBase as i, TaskMeta as j, TaskResult as k, TaskResultPack as l, TestFunction as m, TestOptions as n, Fixture as o, Fixtures as p, HookCleanupCallback as q, SuiteFactory as r, RuntimeContext as s, TestContext as t, SequenceHooks as u, SequenceSetupFiles as v };
|
package/dist/types.d.ts
CHANGED
@@ -1,5 +1,5 @@
|
|
1
|
-
import {
|
2
|
-
export { D as DoneCallback, o as
|
1
|
+
import { u as SequenceHooks, v as SequenceSetupFiles, F as File, a as Test, S as Suite, l as TaskResultPack, t as TestContext } from './tasks-d7d578d8.js';
|
2
|
+
export { D as DoneCallback, o as Fixture, p as Fixtures, q as HookCleanupCallback, H as HookListener, I as InferFixturesTypes, O as OnTestFailedHandler, R as RunMode, s as RuntimeContext, d as SuiteAPI, f as SuiteCollector, r as SuiteFactory, g as SuiteHooks, T as Task, i as TaskBase, b as TaskCustom, j as TaskMeta, k as TaskResult, h as TaskState, e as TestAPI, m as TestFunction, n as TestOptions } from './tasks-d7d578d8.js';
|
3
3
|
import '@vitest/utils';
|
4
4
|
|
5
5
|
/**
|
package/dist/utils.d.ts
CHANGED
@@ -1,5 +1,5 @@
|
|
1
|
-
import { S as Suite, T as Task, a as Test, b as TaskCustom } from './tasks-
|
2
|
-
export { C as ChainableFunction, c as createChainable } from './tasks-
|
1
|
+
import { S as Suite, T as Task, a as Test, b as TaskCustom } from './tasks-d7d578d8.js';
|
2
|
+
export { C as ChainableFunction, c as createChainable } from './tasks-d7d578d8.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": "0.34.
|
4
|
+
"version": "0.34.7",
|
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
|
"p-limit": "^4.0.0",
|
42
42
|
"pathe": "^1.1.1",
|
43
|
-
"@vitest/utils": "0.34.
|
43
|
+
"@vitest/utils": "0.34.7"
|
44
44
|
},
|
45
45
|
"scripts": {
|
46
46
|
"build": "rimraf dist && rollup -c",
|