import { AtLeastOneOf } from '@codemucker/lang'; declare type TestFunc = () => Promise | void; declare type StepType = 'Given' | 'When' | 'Then' | 'AndGiven' | 'AndWhen' | 'AndThen'; /** * Just a warpper around a describe for now * * @param label * @param featureBody */ export declare function Feature(label: string, featureBody: TestFunc): void; /** * Just wraps a jest test, internally running steps asynchroniusly and notifying the Jest test when * it has completed * * @param label * @param scenarioBodyOrConfig - if a set of config options, then expect the next arg to be the scenario body * @param scenarioBody * */ export declare function Scenario(label: string, scenarioBodyOrConfig: TestFunc | AtLeastOneOf, scenarioBody?: TestFunc): void; export declare function Given(label: string, stepBody: TestFunc): Step; export declare function When(label: string, stepBody: TestFunc): Step; export declare function Then(label: string, stepBody: TestFunc): Step; export declare function And(label: string, stepBody: TestFunc): Step; export declare function addStep(stepType: StepType, stepLabel: string, stepBody: TestFunc): Step; declare type ScenarioConfig = { /** * Print steps and result to console on scenario completion */ logOnComplete: boolean; /** * Capture any console output when running a step */ captureConsole: boolean; /** * If enabled, print debug log statements to the console */ debugEnabled: boolean; /** * If enabled, when a failure occurs run the debugger */ debugOnError: boolean; /** * If the scenario is pending then the steps are not run and it's marked as skipped in Jest */ pending: boolean; }; export interface Step { complete: boolean; error?: any; passed: boolean; failed: boolean; fullLabel: string; desc: string; } export {};