lib/reporters/dot.js
function Dot(runner, options) {
  Base.call(this, runner, options);

  var self = this;
  var width = (Base.window.width * 0.75) | 0;
  var n = -1;

  runner.on(EVENT_RUN_BEGIN, function() {
    process.stdout.write('\n');
  });

  runner.on(EVENT_TEST_PENDING, function() {
    if (++n % width === 0) {
      process.stdout.write('\n  ');
    }
    process.stdout.write(Base.color('pending', Base.symbols.comma));
  });

  runner.on(EVENT_TEST_PASS, function(test) {
    if (++n % width === 0) {
      process.stdout.write('\n  ');
    }
    if (test.speed === 'slow') {
      process.stdout.write(Base.color('bright yellow', Base.symbols.dot));
    } else {
      process.stdout.write(Base.color(test.speed, Base.symbols.dot));
    }
  });

  runner.on(EVENT_TEST_FAIL, function() {
    if (++n % width === 0) {
      process.stdout.write('\n  ');
    }
    process.stdout.write(Base.color('fail', Base.symbols.bang));
  });

  runner.once(EVENT_RUN_END, function() {
    console.log();
    self.epilogue();
  });
}
function Dot(runner, options) {
  Base.call(this, runner, options);

  var self = this;
  var width = (Base.window.width * 0.75) | 0;
  var n = -1;

  runner.on(EVENT_RUN_BEGIN, function() {
    process.stdout.write('\n');
  });

  runner.on(EVENT_TEST_PENDING, function() {
    if (++n % width === 0) {
      process.stdout.write('\n  ');
    }
    process.stdout.write(Base.color('pending', Base.symbols.comma));
  });

  runner.on(EVENT_TEST_PASS, function(test) {
    if (++n % width === 0) {
      process.stdout.write('\n  ');
    }
    if (test.speed === 'slow') {
      process.stdout.write(Base.color('bright yellow', Base.symbols.dot));
    } else {
      process.stdout.write(Base.color(test.speed, Base.symbols.dot));
    }
  });

  runner.on(EVENT_TEST_FAIL, function() {
    if (++n % width === 0) {
      process.stdout.write('\n  ');
    }
    process.stdout.write(Base.color('fail', Base.symbols.bang));
  });

  runner.once(EVENT_RUN_END, function() {
    console.log();
    self.epilogue();
  });
}
function Dot ( runner , options ) { Base . call ( this , runner , options ) ; var self = this ; var width = ( Base . window . width * 0.75 ) | 0 ; var n = - 1 ; runner . on ( EVENT_RUN_BEGIN , function ( ) { process . stdout . write ( '\n' ) ; } ) ; runner . on ( EVENT_TEST_PENDING , function ( ) { if ( ++ n % width === 0 ) { process . stdout . write ( '\n  ' ) ; } process . stdout . write ( Base . color ( 'pending' , Base . symbols . comma ) ) ; } ) ; runner . on ( EVENT_TEST_PASS , function ( test ) { if ( ++ n % width === 0 ) { process . stdout . write ( '\n  ' ) ; } if ( test . speed === 'slow' ) { process . stdout . write ( Base . color ( 'bright yellow' , Base . symbols . dot ) ) ; } else { process . stdout . write ( Base . color ( test . speed , Base . symbols . dot ) ) ; } } ) ; runner . on ( EVENT_TEST_FAIL , function ( ) { if ( ++ n % width === 0 ) { process . stdout . write ( '\n  ' ) ; } process . stdout . write ( Base . color ( 'fail' , Base . symbols . bang ) ) ; } ) ; runner . once ( EVENT_RUN_END , function ( ) { console . log ( ) ; self . epilogue ( ) ; } ) ; }
Constructs a new `Dot` reporter instance.

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