import { TestContext, Context, Observable } from 'ava'; export interface ContextualDiffContext { /** * Name of the current running case. */ caseName: string; /** * Path of the case folder */ casePath: string; } export interface ContextualBaselineDiffContext extends ContextualDiffContext { /** * Path of the case's baseline folder */ baselinePath: string; /** * Path of the case's result folder */ resultPath: string; /** * Check if the baseline folder and the result folder matches. * If not, error will be thrown. */ match(): Promise; } export interface ContextualBaselineEachDiffContext extends ContextualBaselineDiffContext, ContextualDiffContext { } /** * The fixture text context (the callback function). */ export declare type FixtureContextualTest = (t: TestContext & Context, d: ContextualDiffContext) => PromiseLike | Iterator | Observable | void; export declare type FixtureContextualBaselineTest = (t: TestContext & Context, d: ContextualBaselineDiffContext) => PromiseLike | Iterator | Observable | void; export declare type FixtureContextualEachTest = (t: TestContext & Context, d: ContextualDiffContext) => PromiseLike | Iterator | Observable | void; export declare type FixtureContextualBaselineEachTest = (t: TestContext & Context, d: ContextualBaselineEachDiffContext) => PromiseLike | Iterator | Observable | void; /** * Runs a fixture test. * @param title Title of the test (for display and filtering). * @param caseName Name of the test case, matching the folder under `path`. * @param run The test function. * In this function, `cwd` is the fixture case folder. */ export declare function fixtureTest(title: string, caseName: string, run: FixtureContextualTest): void; /** * Runs a fixture test. * @param caseName Name of the test case, matching the folder under `path`. * @param run The test function. */ export declare function fixtureTest(caseName: string, run: FixtureContextualTest): void; export declare namespace fixtureTest { function todo(title: string): void; function failing(title: string, caseName: string, run: (t: TestContext & Context, d: ContextualDiffContext) => any): void; function failing(caseName: string, run: (t: TestContext & Context, d: ContextualDiffContext) => any): void; function only(title: string, caseName: string, run: (t: TestContext & Context, d: ContextualDiffContext) => any): void; function only(caseName: string, run: (t: TestContext & Context, d: ContextualDiffContext) => any): void; function skip(title: string, caseName: string, run: (t: TestContext & Context, d: ContextualDiffContext) => any): void; function skip(caseName: string, run: (t: TestContext & Context, d: ContextualDiffContext) => any): void; function each(filter: string | RegExp, run: (t: TestContext & Context, d: ContextualDiffContext) => any): void; function each(run: (t: TestContext & Context, d: ContextualDiffContext) => any): void; } export declare namespace fixtureTest.failing { function only(title: string, caseName: string, run: (t: TestContext & Context, d: ContextualDiffContext) => any): void; function only(caseName: string, run: (t: TestContext & Context, d: ContextualDiffContext) => any): void; function skip(title: string, caseName: string, run: (t: TestContext & Context, d: ContextualDiffContext) => any): void; function skip(caseName: string, run: (t: TestContext & Context, d: ContextualDiffContext) => any): void; } export declare namespace fixtureTest.only { function failing(title: string, caseName: string, run: (t: TestContext & Context, d: ContextualDiffContext) => any): void; function failing(caseName: string, run: (t: TestContext & Context, d: ContextualDiffContext) => any): void; function each(filter: string | RegExp, run: (t: TestContext & Context, d: ContextualDiffContext) => any): void; function each(run: (t: TestContext & Context, d: ContextualDiffContext) => any): void; } export declare namespace fixtureTest.only.each { function failing(filter: string | RegExp, run: (t: TestContext & Context, d: ContextualBaselineEachDiffContext) => any): void; function failing(run: (t: TestContext & Context, d: ContextualBaselineEachDiffContext) => any): void; } export declare namespace fixtureTest.skip { function failing(title: string, caseName: string, run: (t: TestContext & Context, d: ContextualDiffContext) => any): void; function failing(caseName: string, run: (t: TestContext & Context, d: ContextualDiffContext) => any): void; function each(filter: string | RegExp, run: (t: TestContext & Context, d: ContextualDiffContext) => any): void; function each(run: (t: TestContext & Context, d: ContextualDiffContext) => any): void; } export declare namespace fixtureTest.skip.each { function failing(filter: string | RegExp, run: (t: TestContext & Context, d: ContextualBaselineEachDiffContext) => any): void; function failing(run: (t: TestContext & Context, d: ContextualBaselineEachDiffContext) => any): void; } export declare namespace fixtureTest.each { function failing(filter: string | RegExp, run: (t: TestContext & Context, d: ContextualDiffContext) => any): void; function failing(run: (t: TestContext & Context, d: ContextualDiffContext) => any): void; } /** * Runs a fixture test. * @param title Title of the test (for display and filtering). * @param caseName Name of the test case, matching the folder under `path`. * @param run The test function. * In this function, `cwd` is the fixture case folder. */ export declare function baselineTest(title: string, caseName: string, run: FixtureContextualBaselineTest): void; /** * Runs a fixture test. * @param caseName Name of the test case, matching the folder under `path`. * @param run The test function. */ export declare function baselineTest(caseName: string, run: FixtureContextualBaselineTest): void; export declare namespace baselineTest { function todo(title: string): void; function failing(title: string, caseName: string, run: (t: TestContext & Context, d: ContextualBaselineDiffContext) => any): void; function failing(caseName: string, run: (t: TestContext & Context, d: ContextualBaselineDiffContext) => any): void; function only(title: string, caseName: string, run: (t: TestContext & Context, d: ContextualBaselineDiffContext) => any): void; function only(caseName: string, run: (t: TestContext & Context, d: ContextualBaselineDiffContext) => any): void; function skip(title: string, caseName: string, run: (t: TestContext & Context, d: ContextualBaselineDiffContext) => any): void; function skip(caseName: string, run: (t: TestContext & Context, d: ContextualBaselineDiffContext) => any): void; function each(filter: string | RegExp, run: (t: TestContext & Context, d: ContextualBaselineEachDiffContext) => any): void; function each(run: (t: TestContext & Context, d: ContextualBaselineEachDiffContext) => any): void; } export declare namespace baselineTest.failing { function only(title: string, caseName: string, run: (t: TestContext & Context, d: ContextualBaselineDiffContext) => any): void; function only(caseName: string, run: (t: TestContext & Context, d: ContextualBaselineDiffContext) => any): void; function skip(title: string, caseName: string, run: (t: TestContext & Context, d: ContextualBaselineDiffContext) => any): void; function skip(caseName: string, run: (t: TestContext & Context, d: ContextualBaselineDiffContext) => any): void; } export declare namespace baselineTest.only { function failing(title: string, caseName: string, run: (t: TestContext & Context, d: ContextualBaselineDiffContext) => any): void; function failing(caseName: string, run: (t: TestContext & Context, d: ContextualBaselineDiffContext) => any): void; function each(filter: string | RegExp, run: (t: TestContext & Context, d: ContextualBaselineEachDiffContext) => any): void; function each(run: (t: TestContext & Context, d: ContextualBaselineEachDiffContext) => any): void; } export declare namespace baselineTest.only.each { function failing(filter: string | RegExp, run: (t: TestContext & Context, d: ContextualBaselineEachDiffContext) => any): void; function failing(run: (t: TestContext & Context, d: ContextualBaselineEachDiffContext) => any): void; } export declare namespace baselineTest.skip { function failing(title: string, caseName: string, run: (t: TestContext & Context, d: ContextualBaselineDiffContext) => any): void; function failing(caseName: string, run: (t: TestContext & Context, d: ContextualBaselineDiffContext) => any): void; function each(filter: string | RegExp, run: (t: TestContext & Context, d: ContextualBaselineEachDiffContext) => any): void; function each(run: (t: TestContext & Context, d: ContextualBaselineEachDiffContext) => any): void; } export declare namespace baselineTest.skip.each { function failing(filter: string | RegExp, run: (t: TestContext & Context, d: ContextualBaselineEachDiffContext) => any): void; function failing(run: (t: TestContext & Context, d: ContextualBaselineEachDiffContext) => any): void; } export declare namespace baselineTest.each { function failing(filter: string | RegExp, run: (t: TestContext & Context, d: ContextualBaselineEachDiffContext) => any): void; function failing(run: (t: TestContext & Context, d: ContextualBaselineEachDiffContext) => any): void; }