Вход Регистрация
Файл: error-kitty/node_modules/mocha/lib/reporters/spec.js
Строк: 92
<?php
/**
 * Module dependencies.
 */

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

/**
 * Expose `Spec`.
 */

exports module.exports Spec;

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

function Spec(runner) {
  
Base.call(thisrunner);

  var 
self this
    
stats this.stats
    
indents 0
    
0;

  function 
indent() {
    return Array(
indents).join('  ')
  }

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

  
runner.on('suite', function(suite){
    ++
indents;
    
console.log(color('suite''%s%s'), indent(), suite.title);
  });

  
runner.on('suite end', function(suite){
    --
indents;
    if (
== indentsconsole.log();
  });

  
runner.on('pending', function(test){
    var 
fmt indent() + color('pending''  - %s');
    
console.log(fmttest.title);
  });

  
runner.on('pass', function(test){
    if (
'fast' == test.speed) {
      var 
fmt indent()
        + 
color('checkmark''  ' Base.symbols.ok)
        + 
color('pass'' %s ');
      
cursor.CR();
      
console.log(fmttest.title);
    } else {
      var 
fmt indent()
        + 
color('checkmark''  ' Base.symbols.ok)
        + 
color('pass'' %s ')
        + 
color(test.speed'(%dms)');
      
cursor.CR();
      
console.log(fmttest.titletest.duration);
    }
  });

  
runner.on('fail', function(testerr){
    
cursor.CR();
    
console.log(indent() + color('fail''  %d) %s'), ++ntest.title);
  });

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

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

Spec.prototype.__proto__ Base.prototype;
?>
Онлайн: 1
Реклама