/** * A function defining a new test case or a test suite, e.g. `it` or `describe`. */ export declare type TestDefinition = (name: string, ...args: ARGS) => RETVAL; /** * Helper function for skipping tests when a certain condition is met. * * @example * ```ts * skipIf( * !features.freeFormProperties, * describe, * 'free-form properties (strict: false)', * () => { * // the tests * } * ); * ``` * * @param skip - Should the test case/suite be skipped? * @param verb - The function to invoke to define the test case or the test * suite, e.g. `it` or `describe`. * @param name - The test name (the first argument of `verb` function). * @param args - Additional arguments (framework specific), typically a function * implementing the test. */ export declare function skipIf(skip: boolean, verb: TestDefinition & { skip: TestDefinition; }, name: string, ...args: ARGS): RETVAL; /** * Helper function for skipping tests on Travis CI. * * @example * * ```ts * skipOnTravis(it, 'does something when some condition', async () => { * // the test * }); * ``` * * @param verb - The function to invoke to define the test case or the test * suite, e.g. `it` or `describe`. * @param name - The test name (the first argument of `verb` function). * @param args - Additional arguments (framework specific), typically a function * implementing the test. */ export declare function skipOnTravis(verb: TestDefinition & { skip: TestDefinition; }, name: string, ...args: ARGS): RETVAL; /*** LEGACY API FOR BACKWARDS COMPATIBILITY ***/ export interface TestFn { (this: TestContext): PromiseLike; (this: TestContext, done: Function): void; } export interface TestContext { skip(): this; timeout(ms: number | string): this; retries(n: number): this; slow(ms: number): this; [index: string]: any; } /** * Helper function for skipping tests on Travis env - legacy variant * supporting `it` only. * * @param expectation - The test name (the first argument of `it` function). * @param callback - The test function (the second argument of `it` function). * * @deprecated Use `skipOnTravis(it, name, fn)` instead. */ export declare function itSkippedOnTravis(expectation: string, callback?: TestFn): void;