Sha256: 150573993777ea4e37818d32063d6b9ceeee78e6dc54c481a23c29d1db7d5e2d

Contents?: true

Size: 1.19 KB

Versions: 31

Compression:

Stored size: 1.19 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', '  '+Base.symbols.dot)
      + 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

31 entries across 31 versions & 1 rubygems

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