<commit_before>import gulp from 'gulp';
import karma from 'karma';
import babelify from 'babelify';
import config from '../config';

gulp.task('karma', () => {
  karma.server.start({
    basePath: process.cwd(),
    frameworks: [
      'mocha',
      'browserify',
      'chai',
      'sinon'
    ],
    runnerPort: config.test.port,
    singleRun: true,
    browsers: ['PhantomJS'],
    files: [
      'node_modules/babel-core/polyfill.js',
      'node_modules/jquery/dist/jquery.js',
      'node_modules/underscore/underscore.js',
      'node_modules/backbone/backbone.js',
      'node_modules/backbone-route-filter/backbone-route-filter.js',
      'node_modules/backbone.stickit/backbone.stickit.js',
      'node_modules/backbone-validation/dist/backbone-validation.js',
      'node_modules/backbone.marionette/lib/backbone.marionette.js',
      'node_modules/bootstrap/dist/js/bootstrap.js',
      'vendor/**/*.js',
      'specs/**/*_spec.js'
    ],
    reporters: ['dots'],
    colors: true,
    preprocessors: {
      'node_modules/babel-core/polyfill.js': ['browserify'],
      'specs/**/*.js': ['browserify']
    },
    plugins: [
      'karma-mocha',
      'karma-chai',
      'karma-sinon',
      'karma-browserify',
      'karma-chrome-launcher',
      'karma-phantomjs-launcher'
    ],
    browserify: {
      cache: {},
      packageCache: {},
      fullPaths: true,
      debug: config.isDevelopment,
      paths: [`./${config.appDir}`],
      transform: [
        'browserify-shim'
      ],
      prebundle: (bundle) => {
        bundle.transform(babelify.configure({ sourceMapRelative: `./${config.appDir}` }));
      }
    },
    client: {
      mocha: { ui: 'bdd' }
    }
  });
});<commit_msg>Karma setup according to new version<commit_after>import gulp from 'gulp';
import karma from 'karma';
import babelify from 'babelify';
import config from '../config';

gulp.task('karma', () => {
  let karmaServer = new karma.Server({
    basePath: process.cwd(),
    frameworks: [
      'mocha',
      'browserify',
      'chai',
      'sinon'
    ],
    runnerPort: config.test.port,
    singleRun: true,
    browsers: ['PhantomJS'],
    files: [
      'node_modules/babel-core/polyfill.js',
      'node_modules/jquery/dist/jquery.js',
      'node_modules/underscore/underscore.js',
      'node_modules/backbone/backbone.js',
      'node_modules/backbone-route-filter/backbone-route-filter.js',
      'node_modules/backbone.stickit/backbone.stickit.js',
      'node_modules/backbone-validation/dist/backbone-validation.js',
      'node_modules/backbone.marionette/lib/backbone.marionette.js',
      'node_modules/bootstrap/dist/js/bootstrap.js',
      'vendor/**/*.js',
      'specs/**/*_spec.js'
    ],
    reporters: ['dots'],
    colors: true,
    preprocessors: {
      'node_modules/babel-core/polyfill.js': ['browserify'],
      'specs/**/*.js': ['browserify']
    },
    plugins: [
      'karma-mocha',
      'karma-chai',
      'karma-sinon',
      'karma-browserify',
      'karma-chrome-launcher',
      'karma-phantomjs-launcher'
    ],
    browserify: {
      cache: {},
      packageCache: {},
      fullPaths: true,
      debug: config.isDevelopment,
      paths: [`./${config.appDir}`],
      transform: [
        'browserify-shim'
      ],
      configure: (bundle) => {
        bundle.on('prebundle', () => {
          bundle.transform(babelify.configure({
            stage: 1,
            sourceMapRelative: `./${config.appDir}`
          }));
        })
      }
    },
    client: {
      mocha: { ui: 'bdd' }
    }
  });

  return karmaServer.start();
});
{'fraction_non_alphanumeric': 0.1705685618729097, 'fraction_numerical': 0.0002787068004459309, 'mean_word_length': 2.474346563407551, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 8, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4968272', 'n_tokens_mistral': 1247, 'n_tokens_neox': 1223, 'n_words': 171}