Sha256: 81d3ba87d6442f6fd53b1bdbe33d490bd15fa7f65c90d657379cd45d5430d4e0

Contents?: true

Size: 1.18 KB

Versions: 10

Compression:

Stored size: 1.18 KB

Contents

/**
 * Module dependencies.
 */

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

/**
 * Expose `List`.
 */

exports = module.exports = List;

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

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

  var self = this
    , stats = this.stats
    , n = 0;

  runner.on('start', function(){
    console.log();
  });

  runner.on('test', function(test){
    process.stdout.write(color('pass', '    ' + test.fullTitle() + ': '));
  });

  runner.on('pending', function(test){
    var fmt = color('checkmark', '  -')
      + color('pending', ' %s');
    console.log(fmt, test.fullTitle());
  });

  runner.on('pass', function(test){
    var fmt = color('checkmark', '  ✓')
      + color('pass', ' %s: ')
      + color(test.speed, '%dms');
    cursor.CR();
    console.log(fmt, test.fullTitle(), test.duration);
  });

  runner.on('fail', function(test, err){
    cursor.CR();
    console.log(color('fail', '  %d) %s'), ++n, test.fullTitle());
  });

  runner.on('end', self.epilogue.bind(self));
}

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

List.prototype.__proto__ = Base.prototype;

Version data entries

10 entries across 10 versions & 1 rubygems

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