import { Test } from './test/main.js'; import { Group } from './group/main.js'; import { Suite } from './suite/main.js'; import { WebRunner } from './web_runner.js'; import { Emitter } from './emitter.js'; import { Refiner } from '../refiner/main.js'; import { TestExecutor } from '../types.js'; export { fixture } from './fixture.js'; export declare let activeRunner: WebRunner | undefined; export declare let activeSuite: Suite | undefined; export declare let activeGroup: Group | undefined; export declare let activeEmitter: Emitter | undefined; export declare let activeRefiner: Refiner | undefined; /** * Retrieves the currently active test runner instance. * Useful for inspecting the runner state, such as checking if any tests have failed. * * @returns The active WebRunner instance, or undefined if no runner is currently active. */ export declare function getActiveRunner(): WebRunner | undefined; /** * Retrieves the currently active event emitter instance. * Useful for listening to or emitting custom framework events programmatically. * * @returns The active Emitter instance, or undefined if no emitter is currently active. */ export declare function getActiveEmitter(): Emitter | undefined; /** * Utility type that removes the first argument from a function's parameter list. */ export type OmitFirstArg = F extends [_: any, ...args: infer R] ? R : never; /** * Set the active test runner, suite, emitter, and refiner instances. * This is called by the Lupa harness during boot and should not be used directly. * @internal */ export declare function setActiveInstances(runner: WebRunner, suite: Suite, emitter: Emitter, refiner: Refiner): void; /** * Set the current file being imported. Called by the harness * before importing each test file. * @internal */ export declare function setActiveFile(file: string | undefined): void; /** * Define a new test. * * The test callback receives a {@link TestContext} which provides * access to assertions, fixtures, and other test utilities. * * @param title - The name of the test. * @param callback - The function containing the test logic. Can be synchronous or asynchronous. * * @example * ```ts * test('math works', ({ assert }) => { * assert.equal(1 + 1, 2) * }) * ``` */ export declare function test(title: string, callback?: TestExecutor): Test; export declare namespace test { var group: (title: string, callback: (group: Group) => void) => void; var macro: , ...args: any[]) => any>(callback: T) => (...args: OmitFirstArg>) => ReturnType; } /** * `html` template tag from `lit-html`. * Used for creating DOM templates to be rendered by {@link fixture}. */ export declare const html: (strings: TemplateStringsArray, ...values: unknown[]) => import("lit-html").TemplateResult<1>; /** * Returns the currently executing Test instance, or `undefined` if called outside of a test execution context. */ export declare function getActiveTest(): Test | undefined; /** * Returns the currently executing Group instance, or `undefined` if called outside of a group setup execution context. */ export declare function getActiveExecutingGroup(): Group | undefined; /** * Returns the currently executing Test instance. Throws an error if called outside of a test execution context. * * @category Execution * @throws {Error} Throws if called outside of an active test execution context */ export declare function getActiveTestOrFail(): Test;