<commit_before>/* eslint-disable no-var, prefer-template */
var path = require('path');
var karma = require('karma');
var karmaConfig = require('karma/lib/config');

var config = karmaConfig.parseConfig(path.join(__dirname, '/../../karma.conf.js'), {
  browsers: [],
  oneShot: true,
  reporters: ['spec', 'junit'],
  junitReporter: {
    outputDir: '/test_artifacts',
  },
});

var server = new karma.Server(config);

server.on('run_complete', (browsers, results) => {
  var error = results.error || results.failed > 0;

  server.emitAsync('exit')
  .then(() => {
    process.exit(error ? 1 : 0);
  });
});

server.start();<commit_msg>Make karma fail if plugins can't be loaded<commit_after>/* eslint-disable no-var, prefer-template */
var path = require('path');
var karma = require('karma');
var karmaConfig = require('karma/lib/config');

var config = karmaConfig.parseConfig(path.join(__dirname, '/../../karma.conf.js'), {
  browsers: [],
  oneShot: true,
  reporters: ['spec', 'junit'],
  junitReporter: {
    outputDir: '/test_artifacts',
  },
});

var server = new karma.Server(config);

server.on('run_complete', (browsers, results) => {
  var error = results.error || results.failed > 0;

  server.emitAsync('exit')
  .then(() => {
    process.exit(error ? 1 : 0);
  });
});

server.on('load_error', () => {
  process.exit(1);
});

server.start();
{'fraction_non_alphanumeric': 0.2033898305084746, 'fraction_numerical': 0.005158437730287398, 'mean_word_length': 4.124528301886793, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 10, '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': '4580945', 'n_tokens_mistral': 474, 'n_tokens_neox': 466, 'n_words': 96}