Constructor
new ParallelBuffered(runner)
Calls ParallelBuffered#createListeners
Parameters:
Name | Type | Description |
---|---|---|
runner |
Runner |
Members
events :Array:.<BufferedEvent:>
Retained list of events emitted from the Runner instance.
Type:
listeners :Map:.<string:, EventListener:>
Map of Runner
event names to listeners (for later teardown)
Type:
Methods
createListener(eventName) → {EventListener}
Returns a new listener which saves event data in memory to
ParallelBuffered#events. Listeners are indexed by eventName
and stored
in ParallelBuffered#listeners. This is a defensive measure, so that we
don't a) leak memory or b) remove other listeners that may not be
associated with this reporter.
Subclasses could override this behavior.
Parameters:
Name | Type | Description |
---|---|---|
eventName |
string | Name of event to create listener for |
Returns:
- Type
- EventListener
createListeners(runner) → {ParallelBuffered}
Creates event listeners (using ParallelBuffered#createListener) for each
reporter-relevant event emitted by a Runner. This array is drained when
ParallelBuffered#done is called by Runner#run.
Subclasses could override this behavior.
Parameters:
Name | Type | Description |
---|---|---|
runner |
Runner | Runner instance |
Returns:
- Type
- ParallelBuffered
done(failures, callback)
Calls the Mocha#run callback (callback
) with the test failure
count and the array of BufferedEvent objects. Resets the array.
This is called directly by Runner#run
and should not be called by any other consumer.
Subclasses could override this.
Parameters:
Name | Type | Description |
---|---|---|
failures |
number | Number of failed tests |
callback |
function | The callback passed to Mocha#run. |