Reporter
This class establishes the Reporter protocol: an object that implements runStart
, runEnd
and testResult
.
An object with this signature may be passed as the first argument to the TestQueue
constructor. See Customization for more information.
The default implementation writes TAP-formatted output to the provided stream.
All callback
functions are passed to the this.stream.write
function.
If an error is thrown or emitted during a write operation, it is caught and passed to the callback
.
Methods
new Reporter(tap, stream)
Creates a new Reporter
object and sets the this.tap
and this.stream
properties.
Examples
runStart(info, callback)
Write a TAP plan to this.stream
.
-
info
RunStartInfo -
callback
function —called when write finishes
-
error
Error —write error (or falsy value if none occurred)
-
See
Examples
runEnd(info, callback)
Write a footer with final result counts as a TAP diagnostic message to this.stream
.
-
info
RunEndInfo -
callback
function —called when write finishes
-
error
Error —write error (or falsy value if none occurred)
-
See
Examples
testResult(info, callback)
Write a TAP result to this.stream
.
-
info
TestResultInfo -
callback
function —called when write finishes
-
error
Error —write error (or falsy value if none occurred)
-