<commit_before>var strutils = require('../../strutils')

function TapReporter(silent, out){
  this.out = out || process.stdout
  this.silent = silent
  this.stoppedOnError = null
  this.id = 1
  this.total = 0
  this.pass = 0
  this.results = []
}
TapReporter.prototype = {
  report: function(prefix, data){
    this.results.push({
      launcher: prefix,
      result: data
    })
    this.display(prefix, data)
    this.total++
    if (data.passed) this.pass++
  },
  errorDisplay: function(err){
    var inside = Object.keys(err)
      .filter(function(key){
        return key !== 'passed'
      })
      .map(function(key){
        return key + ': "' + err[key] + '"'
      })
    return strutils.indent([
      '---',
      strutils.indent(inside.join('\n')),
      '...'].join('\n'))
  },
  resultDisplay: function(prefix, result){
    var line = (prefix ? (prefix + ' - ') : '') + 
      result.name.trim()
    return (result.passed ? 'ok ' : 'not ok ') +
      (this.id++) + ' ' + line
  },
  summaryDisplay: function(){<commit_msg>Update tap_reporter.js to use the YAMLish soft wraps format inthe TapReporter#errorDisplay.<commit_after>var strutils = require('../../strutils')

function TapReporter(silent, out){
  this.out = out || process.stdout
  this.silent = silent
  this.stoppedOnError = null
  this.id = 1
  this.total = 0
  this.pass = 0
  this.results = []
}
TapReporter.prototype = {
  report: function(prefix, data){
    this.results.push({
      launcher: prefix,
      result: data
    })
    this.display(prefix, data)
    this.total++
    if (data.passed) this.pass++
  },
  errorDisplay: function(err){
    var inside = Object.keys(err)
      .filter(function(key){
        return key !== 'passed'
      })
      .map(function(key){
        return key + ': >\n' + strutils.indent(err[key])
      })
    return strutils.indent([
      '---',
      strutils.indent(inside.join('\n')),
      '...'].join('\n'))
  },
  resultDisplay: function(prefix, result){
    var line = (prefix ? (prefix + ' - ') : '') + 
      result.name.trim()
    return (result.passed ? 'ok ' : 'not ok ') +
      (this.id++) + ' ' + line
  },
  summaryDisplay: function(){
{'fraction_non_alphanumeric': 0.1771744132535665, 'fraction_numerical': 0.0027611596870685687, 'mean_word_length': 2.5121163166397413, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 4, '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': '2217002', 'n_tokens_mistral': 738, 'n_tokens_neox': 718, 'n_words': 148}