UNPKG

under-the-sun

Version:

A nothing-new-under-the-sun testing framework.

19 lines (18 loc) 694 B
export declare type TestDefinition = { description: string; /** Execute the test logic. DOES NOT THROW. */ run: () => PromiseLike<TestResult>; }; export declare type TestResult = { runtimeMs: number; /** If the test failed, error will not be null. */ error: Error | null; }; /** Register a test to run. */ export declare function test(description: string, exercise: () => void | PromiseLike<void>): void; /** * Create shorthand function for defining tests in a group. * * This is really just a wrapper around {@link test} that applies a common prefix string. */ export declare function defineTestGroup(groupDescriptionPrefix: string): typeof test;