license import { Suite } from './suite.js' ; import { Spec } from './spec.js' ; import { Test , TestResult } from './test.js' ; /**
 * These are the events that represent the different stages of the reporting
 * lifecycle.
 */ export enum ReporterEvent { suiteStart = 'SuiteStart' , suiteEnd = 'SuiteEnd' , specStart = 'SpecStart' , specEnd = 'SpecEnd' , testStart = 'TestStart' , testEnd = 'TestEnd' , unexpectedError = 'UnexpectedError' } ; /**
 * A reporter is an object that implements some callbacks associated with
 * reporting lifecycle stages of interest. The default reporter has none
 * of these callbacks implemented.
 */ export abstract class Reporter { /**
     * If set to true, the reporter will not dispatch lifecycle event details
     * to its associated callbacks. This is useful for disabling reporting for
     * some stretch of time (for example, when a test is isolated).
     */ disabled : boolean = false ; /**
     * Dispatches an event's details to the appropriate lifecycle callback.
     */ report ( eventName , ... args ) { const methodName = `on${ eventName }` as keyof this ; if ( this . disabled || this [ methodName ] == null ) { return false ; } ( this [ methodName ] as any ) ( ... args ) ; return true ; } /**
     * Invoked just before a suite begins iterating over specs and invoking tests.
     */ onSuiteStart ? ( suite ) ; /**
     * Invoked after a suite has finished iterating over specs and invoking all
     * tests.
     */ onSuiteEnd ? ( suite ) ; /**
     * Invoked before each spec in the suite, before ivoking tests.
     */ onSpecStart ? ( spec , suite ) ; /**
     * Invoked for each spec in the suite, after all tests have been invoked.
     */ onSpecEnd ? ( spec , suite ) ; /**
     * Invoked for each test, before its implementation is invoked.
     */ onTestStart ? ( test , suite ) ; /**
     * Invoked for each test, after its implementation has been invoked. Receives
     * the result of the test.
     */ onTestEnd ? ( result , test , suite ) ; /**
     * Invoked when there is an out-of-band error, such as an internal exception
     * of the test runner or one of its related mixins.
     */ onUnexpectedError ? ( message , error , suite ) ; } ;