import Macroable from '@poppinss/macroable'; import { type Suite } from './suite/main.ts'; import { type Emitter } from './emitter.ts'; import { type ReporterContract, type RunnerSummary } from './types.ts'; import { SummaryBuilder } from './summary_builder.ts'; /** * The Runner class exposes the API to register test suites and execute * them sequentially. * * @example * const runner = new Runner(emitter) * const suite = new Suite('unit', emitter) * * runner.add(suite) * runner.registerReporter(reporters.list) * * await runner.exec() */ export declare class Runner> extends Macroable { #private; /** * Summary builder is used to create the tests summary reported by * multiple reporters. Each report contains a key-value pair */ summaryBuilder: SummaryBuilder; /** * A collection of suites */ suites: Suite[]; /** * Registered tests reporter */ reporters: Set; constructor(emitter: Emitter); /** * Know if one or more suites have failed */ get failed(): boolean; /** * Add a suite to the runner */ add(suite: Suite): this; /** * Tap into each suite and configure it */ onSuite(callback: (suite: Suite) => void): this; /** * Enable/disable the bail mode. In bail mode, all * upcoming suites/groups/tests will be skipped * when the current test fails */ bail(toggle?: boolean): this; /** * Register a tests reporter */ registerReporter(reporter: ReporterContract): this; /** * Get tests summary */ getSummary(): RunnerSummary; /** * Start the test runner process. The method emits * "runner:start" event */ start(): Promise; /** * Execute runner suites */ exec(): Promise; /** * End the runner process. Emits "runner:end" event */ end(): Promise; }