<commit_before>/*
* In local config, only run tests using phantom js. No code coverage reports applied
*/
var webpack = require('webpack');
var webpackConfig = require('./webpack.js');
var RewirePlugin = require("rewire-webpack");
var path = require('path');
var argv = require('minimist')(process.argv.slice(2));
var RELEASE = !!argv.release;
var DEBUG = !!argv.debug;
var BROWSERS = argv.browsers;


module.exports = function (config) {

  function getPostLoaders(){
    var postLoaders = [];
    if(RELEASE === true){
      return  [ {
        test: /\.(js|jsx)$/,
        exclude: /node_modules/,
        loader: 'istanbul-instrumenter'
      } ]
    }
    return postLoaders;
  };

  function getReporters(){
    if(RELEASE === true){
      return  ['junit', 'progress', 'coverage']
    }else{
      return ['junit', 'progress']
    }
  };

  function getBrowsers(){
    var browsers = ['PhantomJS'];
    if(BROWSERS) {
      return BROWSERS.split(',');
    }
    if(RELEASE){
      browsers = ['Chrome','Firefox','IE']
    }else if(DEBUG){
      browsers = ['Chrome'];
    }
    return browsers;
  };

  function getFiles() {
    var files;
    if(RELEASE === true ||  DEBUG === true) {
      files = [
     'node_modules/es5-shim/es5-shim.js',
     'node_modules/es5-shim/es5-sham.js',
     'test/FullTests.jsx'
     ]
    } else {
    files = [
     'node_modules/es5-shim/es5-shim.js',
     'node_modules/es5-shim/es5-sham.js',
     'test/unitTests.jsx'
     ]
    }
    return files;
  }

  function getPreprocessors() {
    var preprocessors;
    if(RELEASE === true ||  DEBUG === true) {
      preprocessors = {
        'test/FullTests.jsx': ['webpack']
      }
    } else {
      preprocessors = {'test/unitTests.jsx': ['webpack']}
    }
    return preprocessors;
  }

  config.set({

    basePath: path.join(__dirname, '../'),

    files: getFiles(),

    preprocessors: getPreprocessors(),

    webpack: {
      module: {
        loaders: webpackConfig.module.loaders,
        postLoaders : getPostLoaders()
      },
      resolve: {
        extensions: ['', '.webpack.js', '.web.js', '.js', '.jsx']
      },
      plugins: [
      new RewirePlugin()
      ]
    },

    webpackServer: {
      stats: {
        colors: true
      }
    },

    webpackMiddleware: {
      // webpack-dev-middleware configuration
      // i. e.
      noInfo: true
    },

    browserNoActivityTimeout: 1000000,

    // coverage reporter generates the coverage
    reporters: ['junit', 'progress', 'coverage'],


    coverageReporter: {
      // specify a common output directory
      dir: 'test/coverage',
      reporters: [
      // reporters not supporting the `file` property
      { type: 'html', subdir: 'report-html' },
      { type: 'lcov', subdir: 'report-lcov' }
      ]
    },

    // the default configuration
    junitReporter: {
      outputFile: 'test/coverage/test-results.xml',
      outputDir: 'test/coverage',
      suite: ''
    },

    autoWatch: false,

    frameworks: ['jasmine'],

    browsers: getBrowsers(),

    plugins: [
    'karma-chrome-launcher',
    'karma-firefox-launcher',
    'karma-phantomjs-launcher-nonet',
    'karma-ie-launcher',
    'karma-jasmine',
    'karma-webpack',
    'karma-junit-reporter',
    'karma-coverage'
    ],

    customLaunchers: {
      IE9: {
        base: 'IE',
        'x-ua-compatible': 'IE=EmulateIE9'
      },
      IE8: {
        base: 'IE',
        'x-ua-compatible': 'IE=EmulateIE8'
      }
    },

    phantomjsLauncher: {
      // configure PhantomJS executable for each platform
      cmd: {
        win32: path.join(__dirname, '../test/browser/phantomjs.exe')
      }
    }
  });
};<commit_msg>Add phantomjs paths for linux and osx<commit_after>/*
* In local config, only run tests using phantom js. No code coverage reports applied
*/
var webpack = require('webpack');
var webpackConfig = require('./webpack.js');
var RewirePlugin = require("rewire-webpack");
var path = require('path');
var argv = require('minimist')(process.argv.slice(2));
var RELEASE = !!argv.release;
var DEBUG = !!argv.debug;
var BROWSERS = argv.browsers;


module.exports = function (config) {

  function getPostLoaders(){
    var postLoaders = [];
    if(RELEASE === true){
      return  [ {
        test: /\.(js|jsx)$/,
        exclude: /node_modules/,
        loader: 'istanbul-instrumenter'
      } ]
    }
    return postLoaders;
  };

  function getReporters(){
    if(RELEASE === true){
      return  ['junit', 'progress', 'coverage']
    }else{
      return ['junit', 'progress']
    }
  };

  function getBrowsers(){
    var browsers = ['PhantomJS'];
    if(BROWSERS) {
      return BROWSERS.split(',');
    }
    if(RELEASE){
      browsers = ['Chrome','Firefox','IE']
    }else if(DEBUG){
      browsers = ['Chrome'];
    }
    return browsers;
  };

  function getFiles() {
    var files;
    if(RELEASE === true ||  DEBUG === true) {
      files = [
     'node_modules/es5-shim/es5-shim.js',
     'node_modules/es5-shim/es5-sham.js',
     'test/FullTests.jsx'
     ]
    } else {
    files = [
     'node_modules/es5-shim/es5-shim.js',
     'node_modules/es5-shim/es5-sham.js',
     'test/unitTests.jsx'
     ]
    }
    return files;
  }

  function getPreprocessors() {
    var preprocessors;
    if(RELEASE === true ||  DEBUG === true) {
      preprocessors = {
        'test/FullTests.jsx': ['webpack']
      }
    } else {
      preprocessors = {'test/unitTests.jsx': ['webpack']}
    }
    return preprocessors;
  }

  function lookupPhantomJS() {
    try {
      return require('phantomjs').path;
    } catch(e){
      return;
    }
  }

  config.set({

    basePath: path.join(__dirname, '../'),

    files: getFiles(),

    preprocessors: getPreprocessors(),

    webpack: {
      module: {
        loaders: webpackConfig.module.loaders,
        postLoaders : getPostLoaders()
      },
      resolve: {
        extensions: ['', '.webpack.js', '.web.js', '.js', '.jsx']
      },
      plugins: [
      new RewirePlugin()
      ]
    },

    webpackServer: {
      stats: {
        colors: true
      }
    },

    webpackMiddleware: {
      // webpack-dev-middleware configuration
      // i. e.
      noInfo: true
    },

    browserNoActivityTimeout: 1000000,

    // coverage reporter generates the coverage
    reporters: ['junit', 'progress', 'coverage'],


    coverageReporter: {
      // specify a common output directory
      dir: 'test/coverage',
      reporters: [
      // reporters not supporting the `file` property
      { type: 'html', subdir: 'report-html' },
      { type: 'lcov', subdir: 'report-lcov' }
      ]
    },

    // the default configuration
    junitReporter: {
      outputFile: 'test/coverage/test-results.xml',
      outputDir: 'test/coverage',
      suite: ''
    },

    autoWatch: false,

    frameworks: ['jasmine'],

    browsers: getBrowsers(),

    plugins: [
    'karma-chrome-launcher',
    'karma-firefox-launcher',
    'karma-phantomjs-launcher-nonet',
    'karma-ie-launcher',
    'karma-jasmine',
    'karma-webpack',
    'karma-junit-reporter',
    'karma-coverage'
    ],

    customLaunchers: {
      IE9: {
        base: 'IE',
        'x-ua-compatible': 'IE=EmulateIE9'
      },
      IE8: {
        base: 'IE',
        'x-ua-compatible': 'IE=EmulateIE8'
      }
    },

    phantomjsLauncher: {
      // configure PhantomJS executable for each platform
      cmd: {
        linux: lookupPhantomJS(),
        darwin: lookupPhantomJS(),
        win32: path.join(__dirname, '../test/browser/phantomjs.exe')
      }
    }
  });
};
{'fraction_non_alphanumeric': 0.15617962644058817, 'fraction_numerical': 0.005828586567757319, 'mean_word_length': 2.247311827956989, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, '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': '2077366', 'n_tokens_mistral': 2605, 'n_tokens_neox': 2481, 'n_words': 487}