The reporter that turns a run into a value: it records what happened instead of printing it.
-
browserLogs: BrowserLog[]
The most recent page console calls and uncaught errors, capped at MAX_BROWSER_LOGS.
-
browserLogsDropped: number
How many page-log entries the cap dropped.
-
notices: Notice[]
Every diagnostic, in emission order.
-
onBrowserLog(): void_context: ReporterContext,log: BrowserLog
Records one page console call or uncaught error.
-
onNotice(): void_context: ReporterContext,notice: Notice
Records one diagnostic.
-
onTestEnd(): void_context: ReporterContext,details: TestDetails
Records one finished test.
-
reset(): void
Drops everything from a previous run. Watch sessions reuse one collector across reruns, so this is what keeps rerun N's result from containing rerun N-1's tests.
-
tests: TestResult[]
Every finished test, in arrival order.
The APIReporter watching this run — the reporter every result is built from.
Projects one QUnit testEnd payload into a TestResult. QUnit's fullName is
[...modules, testName]; the joined display form matches what filter matches against —
modules separated by >, the test name after a : .
A channel carrying one run's events, together with the Reporter that fills it.
| { kind: "test"; test: TestResult; }
| { kind: "notice"; notice: Notice; }
| { kind: "browserLog"; log: BrowserLog; }
| { kind: "runEnd"; result: RunResult; }
One thing that happened during a run, as it happened.
The buffer a feed keeps for a consumer that has stopped reading.
How many page-log entries a result retains. Tests and notices are bounded by the suite; page output is bounded by nothing a test runner controls, so this is the one channel that needs a ceiling. Generous enough that a real run never reaches it.
Usage
import * as mod from "lib/api/reporter.ts";