MochaMultiReporter
About
Since MochaReporter
can only take a single delegate class in its constructor, this class provides a way to have more than one reporter delegates.
API
constructor()
cs.js.MochaMultiReporter.new(reporter : cs.js.MochaReporter; delegates : Collection)
Creates a new MochaMultiReporter
instance. delegates must be a collection of objects with the following properties:
Property | Type | Description |
---|---|---|
.class (required) | MochaReporterDelegate | The reporter delegate class to instantiate |
.options (optional) | Object | Options to pass to the delegate constructor |
An instance of each delegate class is instantiated with .options
:
As usual, it is up to each delegate class to register event handlers for the events it cares about.
When
MochaReporter.reset()
is called, each delegate’s.reporterDidReset()
function is called if it is defined.When the runner generates the report, each delegate’s
.report()
function (which must be defined) is called. The reports are generated sequentially by each delegate — not in parallel — in the order they are specified in delegates.