<commit_before>
/**
 * 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(this, runner);

  var self = this
    , stats = this.stats
    , total = runner.total
    , n = 1;

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

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

  runner.on('pass', function(test){
    console.log('ok %d %s', n, test.fullTitle());
  });

  runner.on('fail', function(test){
    console.log('not ok %d %s', n, test.fullTitle());
  });

  runner.on('end', function(){
    process.exit(stats.failures);
  });
}<commit_msg>Added stack trace to TAP errors. Closes #52<commit_after>
/**
 * 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(this, runner);

  var self = this
    , stats = this.stats
    , total = runner.total
    , n = 1;

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

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

  runner.on('pass', function(test){
    console.log('ok %d %s', n, test.fullTitle());
  });

  runner.on('fail', function(test, err){
    console.log('not ok %d %s', n, test.fullTitle());
    console.log(err.stack.replace(/^/gm, '  '));
  });

  runner.on('end', function(){
    process.exit(stats.failures);
  });
}
{'fraction_non_alphanumeric': 0.21203271028037382, 'fraction_numerical': 0.0035046728971962616, 'mean_word_length': 2.9020501138952164, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '470670', 'n_tokens_mistral': 630, 'n_tokens_neox': 608, 'n_words': 139}