← index

TestReporterabstract

inherits Object · defined at test.qn:488

Abstract lifecycle interface for test output. TestRunner announces the run/suite/test/assertion boundaries through these hooks; a concrete reporter overrides them to render (AnsiTestReporter is the built-in). Elapsed values are microseconds — format them with humanize:.

Instance methods

endAssertion:

Hook: an assertion was recorded; receives its TestAssertionResult.

test.qn:520

endRun:List elapsed:

Hook: every suite has finished; receives the suites and the run's wall-clock time.

test.qn:505

endSuite:TestSuite elapsed:

Hook: suite finished; receives its wall-clock time.

test.qn:510

endTest:TestResult

Hook: a test finished; receives its TestResult.

test.qn:515

humanize:

Render an elapsed time (microseconds) in the largest unit that keeps it >= 1: sub-millisecond stays µs; >= 1ms shows ms; >= 1s shows s. One truncated decimal for ms/s, via integer math (float division renders at ugly full precision)."

test.qn:494

startAssertion:

Hook: an assertion is about to run; receives the assertion's name.

test.qn:518

startRun:List

Hook: the run is starting; receives every suite about to run.

test.qn:502

startSuite:TestSuite

Hook: suite is about to run (fires for skipped suites too).

test.qn:508

startTest:Test

Hook: test is about to run.

test.qn:513