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

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

/**
 * Expose `TAP`.
 */

exports module.exports TAP;

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

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

  var 
self this
    
stats this.stats
    
1
    
passes 0
    
failures 0;

  
runner.on('start', function(){
    var 
total runner.grepTotal(runner.suite);
    
console.log('%d..%d'1total);
  });

  
runner.on('test end', function(){
    ++
n;
  });

  
runner.on('pending', function(test){
    
console.log('ok %d %s # SKIP -'ntitle(test));
  });

  
runner.on('pass', function(test){
    
passes++;
    
console.log('ok %d %s'ntitle(test));
  });

  
runner.on('fail', function(testerr){
    
failures++;
    
console.log('not ok %d %s'ntitle(test));
    if (
err.stackconsole.log(err.stack.replace(/^/gm'  '));
  });

  
runner.on('end', function(){
    
console.log('# tests ' + (passes failures));
    
console.log('# pass ' passes);
    
console.log('# fail ' failures);
  });
}

/**
 * Return a TAP-safe title of `test`
 *
 * @param {Object} test
 * @return {String}
 * @api private
 */

function title(test) {
  return 
test.fullTitle().replace(/#/g, '');
}
?>
Онлайн: 1
Реклама