1 | declare namespace uvu {
|
2 | type Crumbs = { __suite__: string; __test__: string };
|
3 | type Callback<T> = (context: T & Crumbs) => Promise<void> | void;
|
4 |
|
5 | interface Hook<T> {
|
6 | (hook: Callback<T>): void;
|
7 | each(hook: Callback<T>): void;
|
8 | }
|
9 |
|
10 | interface Test<T> {
|
11 | (name: string, test: Callback<T>): void;
|
12 | only(name: string, test: Callback<T>): void;
|
13 | skip(name?: string, test?: Callback<T>): void;
|
14 | before: Hook<T>;
|
15 | after: Hook<T>
|
16 | run(): void;
|
17 | }
|
18 | }
|
19 |
|
20 | type Context = Record<string, any>;
|
21 |
|
22 | export type Test<T=Context> = uvu.Test<T>;
|
23 | export type Callback<T=Context> = uvu.Callback<T>;
|
24 |
|
25 | export const test: uvu.Test<Context>;
|
26 | export function suite<T=Context>(title?: string, context?: T): uvu.Test<T>;
|
27 | export function exec(bail?: boolean): Promise<void>;
|