/** * Portable BDD testing utilities (describe, it, beforeEach, afterEach). * * In Deno: @std/testing/bdd with file, suite, and test environment overlays * In Node.js: Uses node:test * In Bun: Uses bun:test * * Deno test runs whose dependencies mutate environment variables before they * import this module must use `--preload=veryfront/testing/bdd`. * * @module */ import "../../_dnt.polyfills.js"; import "./init.js"; /** Test function that can be sync or async */ type TestFn = () => void | Promise; /** Test options for Deno sanitizers (ignored in Node/Bun) */ export interface TestOptions { sanitizeResources?: boolean; sanitizeOps?: boolean; sanitizeExit?: boolean; skip?: boolean; only?: boolean; ignore?: boolean; timeout?: number; } /** Context passed to hooks and tests (BDD-specific) */ export interface BddTestContext { name: string; origin?: string; parent?: BddTestContext; step?: (name: string, fn: TestFn) => Promise; } /** Hook function */ type HookFn = (ctx?: BddTestContext) => void | Promise; /** Group related BDD tests. */ export declare function describe(nameOrOptions: string | (TestOptions & { name: string; }), optionsOrFn?: TestOptions | (() => void), fn?: () => void): void; export declare namespace describe { var skip: (nameOrOptions: string | (TestOptions & { name: string; }), optionsOrFn?: TestOptions | (() => void), fn?: () => void) => void; var ignore: (nameOrOptions: string | (TestOptions & { name: string; }), optionsOrFn?: TestOptions | (() => void), fn?: () => void) => void; var only: (nameOrOptions: string | (TestOptions & { name: string; }), optionsOrFn?: TestOptions | (() => void), fn?: () => void) => void; } /** Define a BDD test case. */ export declare function it(nameOrOptions: string | (TestOptions & { name: string; }), optionsOrFn?: TestOptions | TestFn, fn?: TestFn): void; export declare namespace it { var skip: (nameOrOptions: string | (TestOptions & { name: string; }), optionsOrFn?: TestOptions | TestFn, fn?: TestFn) => void; var ignore: (nameOrOptions: string | (TestOptions & { name: string; }), optionsOrFn?: TestOptions | TestFn, fn?: TestFn) => void; var only: (nameOrOptions: string | (TestOptions & { name: string; }), optionsOrFn?: TestOptions | TestFn, fn?: TestFn) => void; } /** Register a hook before each BDD test. */ export declare function beforeEach(fn: HookFn): void; /** Register a hook after each BDD test. */ export declare function afterEach(fn: HookFn): void; /** Register a hook before all BDD tests in a group. */ export declare function beforeAll(fn: HookFn): void; /** Register a hook after all BDD tests in a group. */ export declare function afterAll(fn: HookFn): void; /** Shared test value. */ export declare const test: typeof it; /** Initialize the BDD test adapter. */ export declare function initBdd(): Promise; export {}; //# sourceMappingURL=bdd.d.ts.map