lib/reporter/index.js
function Reporter(MochaReporter, coverage, root, reporterOptions) {
  if(typeof MochaReporter === 'string') {
    if(mocha.reporters[MochaReporter]) {
      MochaReporter = mocha.reporters[MochaReporter];
    } else {
      try {
        MochaReporter = require(MochaReporter);
      } catch (e) {
        throw new Error('reporter "' + MochaReporter + '" does not exist');
      }
    }
  }

  // The event emitter used to emit the final events
  var runner = this.runner = new EventEmitter();
  // A store (by data GUID) for the Mocha objects we created.
  // The handler for buffering simultaneous test runs
  this.buffers = new BufferManager(runner);
  // The actual (suite and test) objects we can feed to the Mocha runner
  this._mochaObjects = {};
  // The instantiated Mocha reporter
  this.reporter = new MochaReporter(runner, {reporterOptions: reporterOptions});
  // This is where we store errors so that we can report them all
  // at once at the end
  this.errors = [];
  // Options for reporting code coverage
  this.coverage = coverage;
  // Option for root path
  this.root = root;
}
function Reporter(MochaReporter, coverage, root, reporterOptions) {
  if(typeof MochaReporter === 'string') {
    if(mocha.reporters[MochaReporter]) {
      MochaReporter = mocha.reporters[MochaReporter];
    } else {
      try {
        MochaReporter = require(MochaReporter);
      } catch (e) {
        throw new Error('reporter "' + MochaReporter + '" does not exist');
      }
    }
  }

  // The event emitter used to emit the final events
  var runner = this.runner = new EventEmitter();
  // A store (by data GUID) for the Mocha objects we created.
  // The handler for buffering simultaneous test runs
  this.buffers = new BufferManager(runner);
  // The actual (suite and test) objects we can feed to the Mocha runner
  this._mochaObjects = {};
  // The instantiated Mocha reporter
  this.reporter = new MochaReporter(runner, {reporterOptions: reporterOptions});
  // This is where we store errors so that we can report them all
  // at once at the end
  this.errors = [];
  // Options for reporting code coverage
  this.coverage = coverage;
  // Option for root path
  this.root = root;
}
function Reporter ( MochaReporter , coverage , root , reporterOptions ) { if ( typeof MochaReporter === 'string' ) { if ( mocha . reporters [ MochaReporter ] ) { MochaReporter = mocha . reporters [ MochaReporter ] ; } else { try { MochaReporter = require ( MochaReporter ) ; } catch ( e ) { throw new Error ( 'reporter "' + MochaReporter + '" does not exist' ) ; } } } // The event emitter used to emit the final events var runner = this . runner = new EventEmitter ( ) ; // A store (by data GUID) for the Mocha objects we created. // The handler for buffering simultaneous test runs this . buffers = new BufferManager ( runner ) ; // The actual (suite and test) objects we can feed to the Mocha runner this . _mochaObjects = { } ; // The instantiated Mocha reporter this . reporter = new MochaReporter ( runner , { reporterOptions : reporterOptions } ) ; // This is where we store errors so that we can report them all // at once at the end this . errors = [ ] ; // Options for reporting code coverage this . coverage = coverage ; // Option for root path this . root = root ; }
The reporter listens to service events and reports it to the command line using any of the Mocha reporters.
The reporter listens to service events and reports it to the command line using any of the Mocha reporters .