<commit_before>var os = require('os');
var path = require('path');
var fs = require('fs');
var builder = require('xmlbuilder');


var JUnitReporter = function(baseReporterDecorator, config, emitter, logger, helper, formatError) {
  var outputFile = config.outputFile;
  var pkgName = config.suite;
  var log = logger.create('reporter.junit');

  var xml;
  var suites;
  var pendingFileWritings = 0;
  var fileWritingFinished = function() {};
  var allMessages = [];

  baseReporterDecorator(this);

  this.adapters = [function(msg) {
    allMessages.push(msg);
  }];

  this.onRunStart = function(browsers) {
    suites = Object.create(null);
    xml = builder.create('testsuites');
  };

  this.onBrowserStart = function(browser) {
    var timestamp = (new Date()).toISOString().substr(0, 19);
    var suite = suites[browser.id] = xml.ele('testsuite', {
      name: browser.name, 'package': pkgName, timestamp: timestamp, id: 0, hostname: os.hostname()
    });
    suite.ele('properties').ele('property', {name: 'browser.fullName', value: browser.fullName});
  };

  this.onBrowserComplete = function(browser) {<commit_msg>feat: add a default config<commit_after>var os = require('os');
var path = require('path');
var fs = require('fs');
var builder = require('xmlbuilder');

var DEFAULT_JUNIT_REPORTER_CONFIG = {
  outputFile: 'test-results.xml',
  suite: ''
};

var JUnitReporter = function(baseReporterDecorator, config, emitter, logger, helper, formatError) {
  config = config || DEFAULT_JUNIT_REPORTER_CONFIG;

  var outputFile = config.outputFile;
  var pkgName = config.suite;
  var log = logger.create('reporter.junit');

  var xml;
  var suites;
  var pendingFileWritings = 0;
  var fileWritingFinished = function() {};
  var allMessages = [];

  baseReporterDecorator(this);

  this.adapters = [function(msg) {
    allMessages.push(msg);
  }];

  this.onRunStart = function(browsers) {
    suites = Object.create(null);
    xml = builder.create('testsuites');
  };

  this.onBrowserStart = function(browser) {
    var timestamp = (new Date()).toISOString().substr(0, 19);
    var suite = suites[browser.id] = xml.ele('testsuite', {
      name: browser.name, 'package': pkgName, timestamp: timestamp, id: 0, hostname: os.hostname()
    });
    suite.ele('properties').ele('property', {name: 'browser.fullName', value: browser.fullName});
  };

  this.onBrowserComplete = function(browser) {
{'fraction_non_alphanumeric': 0.1523096129837703, 'fraction_numerical': 0.004161464835622139, 'mean_word_length': 4.488584474885845, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 9}, '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': '5020088', 'n_tokens_mistral': 789, 'n_tokens_neox': 754, 'n_words': 170}