<commit_before>import mergeKarma from '../util/merge-karma'
import path from 'path'

export default (saguiConfig = {}, webpackConfig) => {
  return mergeKarma(
    buildStandardKarmaConfig(saguiConfig, webpackConfig),
    saguiConfig.additionalKarmaConfig
  )
}

const buildStandardKarmaConfig = (saguiConfig, webpackConfig) => {
  const { projectPath, watch, coverage, additionalKarmaConfig = {} } = saguiConfig

  return {
    // Webpack itself supports an array of configurations
    // and although harmless to have them all running the tests
    // it is not required and only produces double execution
    webpack: Array.isArray(webpackConfig) ? webpackConfig[0] : webpackConfig,

    basePath: projectPath,

    browsers: ['PhantomJS'],

    reporters: [
      'mocha',
      ...(coverage ? ['coverage'] : [])
    ],

    frameworks: ['jasmine', 'detectBrowsers'],

    detectBrowsers: {
      enabled: additionalKarmaConfig.browsers && additionalKarmaConfig.browsers > 0,
      usePhantomJS: true,

      postDetection: function (availableBrowser) {
        if (availableBrowser.indexOf('Chrome') > -1) {<commit_msg>Fallback to PhanthomJS if CHROME_BIN is not set 🔙<commit_after>import mergeKarma from '../util/merge-karma'
import path from 'path'

export default (saguiConfig = {}, webpackConfig) => {
  return mergeKarma(
    buildStandardKarmaConfig(saguiConfig, webpackConfig),
    saguiConfig.additionalKarmaConfig
  )
}

const buildStandardKarmaConfig = (saguiConfig, webpackConfig) => {
  const { projectPath, watch, coverage, additionalKarmaConfig = {} } = saguiConfig

  return {
    // Webpack itself supports an array of configurations
    // and although harmless to have them all running the tests
    // it is not required and only produces double execution
    webpack: Array.isArray(webpackConfig) ? webpackConfig[0] : webpackConfig,

    basePath: projectPath,

    browsers: ['PhantomJS'],

    reporters: [
      'mocha',
      ...(coverage ? ['coverage'] : [])
    ],

    frameworks: ['jasmine', 'detectBrowsers'],

    detectBrowsers: {
      enabled: additionalKarmaConfig.browsers && additionalKarmaConfig.browsers > 0,
      usePhantomJS: true,

      postDetection: function (availableBrowser) {
        if (availableBrowser.indexOf('Chrome') > -1 && process.env['CHROME_BIN']) {
{'fraction_non_alphanumeric': 0.10981409424989191, 'fraction_numerical': 0.0025940337224383916, 'mean_word_length': 3.800829875518672, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 11, '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': '3923758', 'n_tokens_mistral': 719, 'n_tokens_neox': 676, 'n_words': 173}