Sha256: 7e6e78a44466957cc023e3031d92787774ed7009ae95780b01d6b7f735f5b7c3

Contents?: true

Size: 1.11 KB

Versions: 9

Compression:

Stored size: 1.11 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', '.'));
  });

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

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

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

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

Dot.prototype.__proto__ = Base.prototype;

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
stylus-source-0.28.2 vendor/node_modules/mocha/lib/reporters/dot.js
stylus-source-0.28.1 vendor/node_modules/mocha/lib/reporters/dot.js
stylus-source-0.28.0 vendor/node_modules/mocha/lib/reporters/dot.js
stylus-source-0.27.2 vendor/node_modules/mocha/lib/reporters/dot.js
stylus-source-0.27.1 vendor/node_modules/mocha/lib/reporters/dot.js
stylus-source-0.27.0 vendor/node_modules/mocha/lib/reporters/dot.js
stylus-source-0.26.1 vendor/node_modules/mocha/lib/reporters/dot.js
stylus-source-0.26.0 vendor/node_modules/mocha/lib/reporters/dot.js
stylus-source-0.25.0 vendor/node_modules/mocha/lib/reporters/dot.js