What a reporter is given on every hook: where to write, what the run has counted so far, and the few resolved paths a message needs.
Deliberately not the run's Config. A reporter is third-party code, and handing it the whole
config would hand it the mutable state of the run it is reporting on — plus a type it cannot
name, since Config is internal. Everything here is read-only from a reporter's side.
counts and sourceMapDecoder are live: counts is the same object the runner mutates, and
the decoder arrives partway through a run, so both read through rather than being snapshots.
// Defined, not invoked: a reporter that prints a running tally. const tally = { onTestEnd({ console, counts }: ReporterContext) { console.log(`# ${counts.passed}/${counts.total}\n`); }, }; tally.onTestEnd.length; // 1 — the context is the only thing a simple reporter needs
console: Console
Where this reporter's text goes. silentConsole when the run was asked to print nothing.
Absolute path of the directory holding package.json, for rendering paths relative to it.
--junit's value: true for the default path, a string for an explicit one.
Maps a bundle stack frame back to source, once the run has built one.