<commit_before>var gutil = require('gulp-util');
var karma = require('karma').server;
var util = require('../util');
var ROOT = require('../const').ROOT;
var args = util.args;
var Server = require('karma').Server;

var karma;    // karma server instance using `new Server()`
var karmaConfig = {
  logLevel: 'warn',
  configFile: ROOT + '/config/karma.conf.js'
};

// Make full build of JS and CSS
exports.dependencies = ['build'];

exports.task = function (done) {
  var errorCount = 0;

  if ( args.browsers )  karmaConfig.browsers = args.browsers.trim().split(',');
  if ( args.reporters ) karmaConfig.reporters = args.reporters.trim().split(',');
  if ( args.config )    karmaConfig.configFile = ROOT + '/' + args.config.trim();


  gutil.log(gutil.colors.blue('Running unit tests on unminified source.'));

  karma = new Server( karmaConfig, captureError(testMinified,clearEnv));
  karma.start();

  function testMinified() {
    gutil.log(gutil.colors.blue('Running unit tests on minified source.'));
    process.env.KARMA_TEST_COMPRESSED = true;

    karma = new Server(karmaConfig, captureError(testMinifiedJquery,clearEnv));
    karma.start();
  }

  function testMinifiedJquery() {
    gutil.log(gutil.colors.blue('Running unit tests on minified source w/ jquery.'));
    process.env.KARMA_TEST_COMPRESSED = true;
    process.env.KARMA_TEST_JQUERY = true;

    karma = new Server(karmaConfig, done);
    karma.start();
  }

  function clearEnv() {
    process.env.KARMA_TEST_COMPRESSED = false;
    process.env.KARMA_TEST_JQUERY = false;
  }

  /**
   * For each version of testings (unminified, minified, minified w/ jQuery)
   * capture the exitCode and update the error count...
   *
   * When all versions are done, report any errors that may manifest
   * [e.g. perhaps in the minified tests]
   *
   * NOTE: All versions must pass before the CI server will announce 'success'
   */
  function captureError(next,abort) {
    return function(exitCode, errorCode) {
      if (exitCode != 0) {
        errorCount++;
        gutil.log(gutil.colors.red("Karma exited with the following exit code: " + exitCode));
        if ( errorCode ) gutil.log(gutil.colors.red("Karma error code: " + errorCode));
      }

      if( errorCount > 0) process.exit(errorCount);
      else                next();
    };
  }

};<commit_msg>chore(karama): deprecated minified and jquery-integratoin testing<commit_after>var gutil = require('gulp-util');
var util = require('../util');
var ROOT = require('../const').ROOT;
var args = util.args;
var Server = require('karma').Server;

var karmaConfig = {
  logLevel: 'warn',
  configFile: ROOT + '/config/karma.conf.js'
};

// Make full build of JS and CSS
exports.dependencies = ['build'];

exports.task = function (done) {
  if ( args.browsers )  karmaConfig.browsers = args.browsers.trim().split(',');
  if ( args.reporters ) karmaConfig.reporters = args.reporters.trim().split(',');
  if ( args.config )    karmaConfig.configFile = ROOT + '/' + args.config.trim();

  gutil.log(gutil.colors.blue('Running unit tests on unminified source.'));

  var karma = new Server(karmaConfig, function(exitCode){
    // Immediately exit the process if Karma reported errors, because due to
    // potential still running tunnel-browsers gulp won't exit properly.
    exitCode === 0 ? done() : process.exit(exitCode);
  });
  karma.start();
};
{'fraction_non_alphanumeric': 0.14294187425860025, 'fraction_numerical': 0.0011862396204033216, 'mean_word_length': 3.601637107776262, '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': '3055660', 'n_tokens_mistral': 1118, 'n_tokens_neox': 1080, 'n_words': 276}