<commit_before>var webpack = require('webpack')
var assign = require('lodash/object/assign')
var webpackConfig = require('./webpack.config')
var browsers = require('./browsers')

module.exports = function (config) {
  config.set({
    customLaunchers: browsers,
    browsers: ['Chrome', 'Firefox', 'Safari'],
    frameworks: ['mocha'],
    files: [
      'node_modules/es5-shim/es5-shim.js',
      'node_modules/es5-shim/es5-sham.js',
      'tests.webpack.js'
    ],
    preprocessors: {
      'tests.webpack.js': [ 'webpack', 'sourcemap' ]
    },
    webpack: assign(webpackConfig, {
      devtool: 'inline-source-map'
    }),
    webpackServer: {
      noInfo: true
    },
    coverageReporter: {
      reporters: [
        { type: 'html', subdir: 'html' },
        { type: 'lcovonly', subdir: '.' }
      ]
    },
    reporters: ['mocha']
  })

  if (process.env.USE_CLOUD) {
    // We support multiple node versions in travis.
    // To reduce load on browserstack, we only run tests in one node version.
    var nodeVersion = parseInt(process.version.substr(1), 10)
    var nodeVersionBrowserStack = parseInt(process.env.NODE_VERSION_BROWSERSTACK, 10)
    if (nodeVersion === nodeVersionBrowserStack) {
      config.browsers = Object.keys(browsers)
    } else {
      config.browsers = ['PhantomJS']
    }

    config.browserDisconnectTimeout = 10000
    config.browserDisconnectTolerance = 3
    config.browserNoActivityTimeout = 30000
    config.captureTimeout = 200000

    if (process.env.TRAVIS) {
      var buildLabel = 'TRAVIS #' + process.env.TRAVIS_BUILD_NUMBER + ' (' + process.env.TRAVIS_BUILD_ID + ')'

      config.browserStack = {
        username: process.env.BROWSER_STACK_USERNAME,
        accessKey: process.env.BROWSER_STACK_ACCESS_KEY,
        pollingTimeout: 10000,
        startTunnel: false,
        project: 'jss',
        build: buildLabel,
        name: process.env.TRAVIS_JOB_NUMBER
      }

      config.singleRun = true
    }
    else {
      config.browserStack = {
        username: process.env.BROWSER_STACK_USERNAME,
        accessKey: process.env.BROWSER_STACK_ACCESS_KEY,
        pollingTimeout: 10000,
        startTunnel: true
      }
    }
  }
}
<commit_msg>a try to fix browserstack<commit_after>var webpack = require('webpack')
var assign = require('lodash/object/assign')
var webpackConfig = require('./webpack.config')
var browsers = require('./browsers')

module.exports = function (config) {
  config.set({
    customLaunchers: browsers,
    browsers: ['Chrome', 'Firefox', 'Safari'],
    frameworks: ['mocha'],
    files: [
      'node_modules/es5-shim/es5-shim.js',
      'node_modules/es5-shim/es5-sham.js',
      'tests.webpack.js'
    ],
    preprocessors: {
      'tests.webpack.js': [ 'webpack', 'sourcemap' ]
    },
    webpack: assign(webpackConfig, {
      devtool: 'inline-source-map'
    }),
    webpackServer: {
      noInfo: true
    },
    coverageReporter: {
      reporters: [
        { type: 'html', subdir: 'html' },
        { type: 'lcovonly', subdir: '.' }
      ]
    },
    reporters: ['mocha']
  })

  if (process.env.USE_CLOUD) {
    // We support multiple node versions in travis.
    // To reduce load on browserstack, we only run tests in one node version.
    var nodeVersion = parseInt(process.version.substr(1), 10)
    var nodeVersionBrowserStack = parseInt(process.env.NODE_VERSION_BROWSERSTACK, 10)
    if (nodeVersion === nodeVersionBrowserStack) {
      config.browsers = Object.keys(browsers)
    } else {
      config.browsers = ['PhantomJS']
    }

    config.browserDisconnectTimeout = 10000
    config.browserDisconnectTolerance = 3
    config.browserNoActivityTimeout = 30000
    config.captureTimeout = 200000

    config.browserStack = {
      username: process.env.BROWSER_STACK_USERNAME,
      accessKey: process.env.BROWSER_STACK_ACCESS_KEY,
      pollingTimeout: 10000
    }

    if (process.env.TRAVIS) {
      assign(config.browserStack, {
        build: 'TRAVIS #' + process.env.TRAVIS_BUILD_NUMBER + ' (' + process.env.TRAVIS_BUILD_ID + ')',
        name: process.env.TRAVIS_JOB_NUMBER
      })
    }
  }
}

{'fraction_non_alphanumeric': 0.1277994157740993, 'fraction_numerical': 0.016309639727361245, 'mean_word_length': 2.8258845437616387, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '3043772', 'n_tokens_mistral': 1420, 'n_tokens_neox': 1347, 'n_words': 246}