stdout-reporter
v1.0.0
Published
A tests stdout reporter
Downloads
15
Readme
stdout-reporter
A tool to report test results on node's stdout.
Install
npm install --save-dev stdout-reporter
Usage
var Reporter = require( "stdout-reporter" );
var reporter = new Reporter( [ options ] );
/* and then you set your logging methods */
...
Logging Methods
moduleStart
: register a module start- requires a details object as the argument with the following properties:
name
: the module's name
- requires a details object as the argument with the following properties:
testStart
: register a test start- requires a details object as the argument with the following properties:
name
: the test's name
- requires a details object as the argument with the following properties:
assertion
: register an assertion execution- requires a details object as the argument with the following properties:
module
: a string with the module's namename
: a string with the test's nameresult
a Boolean value for the result (true
if passed)message
: a string with the assertion's messagesource
: [optional] a string with the the stacktrace informationactual
: the assertion given value to be compared with the expected objectexpected
: the expected value
- requires a details object as the argument with the following properties:
testDone
: register a test ending- requires a details object as the argument with the following properties:
failed
: a number with the failed assertions in the testruntime
: a number representing the runtime in ms
- requires a details object as the argument with the following properties:
done
: register a run ending- requires a details object as the argument with the following properties:
total
: a number with the total assertionsfailed
: a number with the failed assertionspassed
: a number with the passed assertionsruntime
: a number representing the runtime in ms
- requires a details object as the argument with the following properties:
Options
This module can be instatiated with an options object as its argument.
output
: none (default),"minimal"
or"verbose"
- with no given value, the default output will list the modules and test names, followed by dots representing each passing assertion.
minimal
will omit the modules and tests names on the output.verbose
will print a more detailed output.