Sha256: 9b11153637eccde5614e378a5c0fef6b8774c4aeeab2899f0dd50c12637a3254

Contents?: true

Size: 1.16 KB

Versions: 31

Compression:

Stored size: 1.16 KB

Contents

/**
 * Module dependencies.
 */

var Base = require('./base')
  , color = Base.color;

/**
 * Expose `Dot`.
 */

exports = module.exports = Dot;

/**
 * Initialize a new `Dot` matrix test reporter.
 *
 * @param {Runner} runner
 * @api public
 */

function Dot(runner) {
  Base.call(this, runner);

  var self = this
    , stats = this.stats
    , width = Base.window.width * .75 | 0
    , n = 0;

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

  runner.on('pending', function(test){
    process.stdout.write(color('pending', Base.symbols.dot));
  });

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

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

  runner.on('end', function(){
    console.log();
    self.epilogue();
  });
}

/**
 * Inherit from `Base.prototype`.
 */

Dot.prototype.__proto__ = Base.prototype;

Version data entries

31 entries across 31 versions & 1 rubygems

Version Path
stylus-source-0.42.2 vendor/node_modules/mocha/lib/reporters/dot.js
stylus-source-0.42.1 vendor/node_modules/mocha/lib/reporters/dot.js
stylus-source-0.42.0 vendor/node_modules/mocha/lib/reporters/dot.js
stylus-source-0.41.3 vendor/node_modules/mocha/lib/reporters/dot.js
stylus-source-0.41.2 vendor/node_modules/mocha/lib/reporters/dot.js
stylus-source-0.41.1 vendor/node_modules/mocha/lib/reporters/dot.js
stylus-source-0.41.0 vendor/node_modules/mocha/lib/reporters/dot.js
stylus-source-0.40.3 vendor/node_modules/mocha/lib/reporters/dot.js
stylus-source-0.40.2 vendor/node_modules/mocha/lib/reporters/dot.js
stylus-source-0.40.1 vendor/node_modules/mocha/lib/reporters/dot.js
stylus-source-0.40.0 vendor/node_modules/mocha/lib/reporters/dot.js
stylus-source-0.39.4 vendor/node_modules/mocha/lib/reporters/dot.js
stylus-source-0.39.3 vendor/node_modules/mocha/lib/reporters/dot.js
stylus-source-0.39.2 vendor/node_modules/mocha/lib/reporters/dot.js
stylus-source-0.39.1 vendor/node_modules/mocha/lib/reporters/dot.js
stylus-source-0.39.0 vendor/node_modules/mocha/lib/reporters/dot.js
stylus-source-0.38.0 vendor/node_modules/mocha/lib/reporters/dot.js
stylus-source-0.37.0 vendor/node_modules/mocha/lib/reporters/dot.js
stylus-source-0.36.1 vendor/node_modules/mocha/lib/reporters/dot.js
stylus-source-0.36.0 vendor/node_modules/mocha/lib/reporters/dot.js