UNPKG

@arizeai/phoenix-client

Version:
31 lines 1.91 kB
import { type SuiteState } from "./state"; import { type KVMap, type SuiteConfig, type TestFn, type TestParams } from "./types"; /** * The minimum slice of a test runner (vitest or jest) the runner needs in * order to declare suites, tests, and lifecycle hooks. */ export interface RunnerHooks { describe: (name: string, fn: () => void) => void; describeOnly?: (name: string, fn: () => void) => void; describeSkip?: (name: string, fn: () => void) => void; test: (name: string, fn: (...args: unknown[]) => unknown | Promise<unknown>, timeout?: number) => void; testOnly?: (name: string, fn: (...args: unknown[]) => unknown | Promise<unknown>, timeout?: number) => void; testSkip?: (name: string, fn: (...args: unknown[]) => unknown | Promise<unknown>, timeout?: number) => void; beforeAll: (fn: () => unknown | Promise<unknown>) => void; afterAll: (fn: () => unknown | Promise<unknown>) => void; } /** Variants exposed by `test` (and `.skip`/`.only`). */ type TestVariant = "default" | "only" | "skip"; /** Drive a `describe(name, fn, config?)` invocation. */ export declare function declareDescribe(hooks: RunnerHooks, name: string, fn: () => void, config?: SuiteConfig, variant?: TestVariant): void; /** Drive a `test(name, params, fn)` invocation. */ export declare function declareTest<Input extends KVMap, Expected extends KVMap>(hooks: RunnerHooks, name: string, params: TestParams<Input, Expected>, fn: TestFn<Input, Expected>, variant?: TestVariant, timeout?: number): void; /** Suite registry exposed for reporters and the public summary helper. */ export declare function getAllSuites(): readonly SuiteState[]; /** * Reset the suite registry. Reporters call this at the start of every test * run so module-cached state from previous watch invocations is released. */ export declare function clearAllSuites(): void; export {}; //# sourceMappingURL=runner.d.ts.map