lib/reporters/base.js
function Base(runner, options) {
  var failures = (this.failures = []);

  if (!runner) {
    throw new TypeError('Missing runner argument');
  }
  this.options = options || {};
  this.runner = runner;
  this.stats = runner.stats; // assigned so Reporters keep a closer reference

  runner.on(EVENT_TEST_PASS, function(test) {
    if (test.duration > test.slow()) {
      test.speed = 'slow';
    } else if (test.duration > test.slow() / 2) {
      test.speed = 'medium';
    } else {
      test.speed = 'fast';
    }
  });

  runner.on(EVENT_TEST_FAIL, function(test, err) {
    if (showDiff(err)) {
      stringifyDiffObjs(err);
    }
    test.err = err;
    failures.push(test);
  });
}
function Base(runner, options) {
  var failures = (this.failures = []);

  if (!runner) {
    throw new TypeError('Missing runner argument');
  }
  this.options = options || {};
  this.runner = runner;
  this.stats = runner.stats; // assigned so Reporters keep a closer reference

  runner.on(EVENT_TEST_PASS, function(test) {
    if (test.duration > test.slow()) {
      test.speed = 'slow';
    } else if (test.duration > test.slow() / 2) {
      test.speed = 'medium';
    } else {
      test.speed = 'fast';
    }
  });

  runner.on(EVENT_TEST_FAIL, function(test, err) {
    if (showDiff(err)) {
      stringifyDiffObjs(err);
    }
    test.err = err;
    failures.push(test);
  });
}
function Base ( runner , options ) { var failures = ( this . failures = [ ] ) ; if ( ! runner ) { throw new TypeError ( 'Missing runner argument' ) ; } this . options = options || { } ; this . runner = runner ; this . stats = runner . stats ; // assigned so Reporters keep a closer reference runner . on ( EVENT_TEST_PASS , function ( test ) { if ( test . duration > test . slow ( ) ) { test . speed = 'slow' ; } else if ( test . duration > test . slow ( ) / 2 ) { test . speed = 'medium' ; } else { test . speed = 'fast' ; } } ) ; runner . on ( EVENT_TEST_FAIL , function ( test , err ) { if ( showDiff ( err ) ) { stringifyDiffObjs ( err ) ; } test . err = err ; failures . push ( test ) ; } ) ; }
Constructs a new `Base` reporter instance.

@description
All other reporters generally inherit from this reporter.

@public
@class
@memberof Mocha.reporters
@param {Runner} runner - Instance triggers reporter actions.
@param {Object} [options] - runner options
Constructs a new Base reporter instance .