import 'jest'; import type { LitRuntimeOptions, LitWestTestFn } from './testWrapper'; interface Each { (cases: ReadonlyArray): (name: string, fn: (...args: T) => any, timeout?: number) => void; >(cases: ReadonlyArray): (name: string, fn: (...args: ExtractEachCallbackArgs) => any, timeout?: number) => void; (cases: ReadonlyArray): (name: string, fn: (...args: T[]) => any, timeout?: number) => void; (cases: ReadonlyArray>): (name: string, fn: (...args: any[]) => any, timeout?: number) => void; (strings: TemplateStringsArray, ...placeholders: any[]): (name: string, fn: (arg: any) => any, timeout?: number) => void; } /** * Creates a test closure */ export interface LitIt { /** * Creates a test closure. * * @param description The name of your test * @param testFn The function for your test */ (description: string, testFn: LitWestTestFn): void; /** * Only runs this test in the current file. */ only: LitIt; /** * Skips running this test in the current file. */ skip: LitIt; /** * Sketch out which tests to write in the future. */ todo: LitIt; /** * Experimental and should be avoided. */ concurrent: LitIt; /** * Use if you keep duplicating the same test with different data. `.each` allows you to write the * test once and pass data in. * * `.each` is available with two APIs: * * #### 1 `test.each(table)(name, fn)` * * - `table`: Array of Arrays with the arguments that are passed into the test fn for each row. * - `name`: String the title of the test block. * - `fn`: Function the test to be ran, this is the function that will receive the parameters in each row as function arguments. * * * #### 2 `test.each table(name, fn)` * * - `table`: Tagged Template Literal * - `name`: String the title of the test, use `$variable` to inject test data into the test title from the tagged template expressions. * - `fn`: Function the test to be ran, this is the function that will receive the test data object.. * * @example * * // API 1 * test.each([[1, 1, 2], [1, 2, 3], [2, 1, 3]])( * '.add(%i, %i)', * (a, b, expected) => { * expect(a + b).toBe(expected); * }, * ); * * // API 2 * test.each` * a | b | expected * ${1} | ${1} | ${2} * ${1} | ${2} | ${3} * ${2} | ${1} | ${3} * `('returns $expected when $a is added $b', ({a, b, expected}) => { * expect(a + b).toBe(expected); * }); * */ each: Each; } export declare function createIt(opts?: LitRuntimeOptions, method?: jest.It): LitIt; declare const it: LitIt; declare const options: (opts: LitRuntimeOptions) => { it: LitIt; }; export { it, options };