<commit_before>module.exports = function(config) {
  var cfg = {};
  require('./karma.conf')({set: function (x){cfg = x;}});
  cfg.client = {
    captureConsole: false
  };
  cfg.port = 19145;
  cfg.browserStack = {
      username: process.env.BROWSER_STACK_USERNAME,
      accessKey: process.env.BROWSER_STACK_ACCESS_KEY
  };
  
  var isPullRequest = process.env.TRAVIS_PULL_REQUEST !== 'false';
  
  if (!isPullRequest && !cfg.browserStack.username)
    throw new Error("You must provider username/key in the env variables BROWSER_STACK_USERNAME and BROWSER_STACK_ACCESS_KEY");

  cfg.customLaunchers = {
    bs_firefox: {
      base: 'BrowserStack',
      browser: 'firefox',
      browser_version: '46.0',
      os: 'Windows',
      os_version: '10'
    },
  };

  cfg.browsers = isPullRequest ? ['Firefox'] : [
    'bs_firefox'
  ];

  cfg.plugins = [
      'karma-qunit',
      'karma-mocha-reporter',
      'karma-browserstack-launcher',
      'karma-firefox-launcher'
  ];

  config.set(cfg);
};<commit_msg>Never fail if missing browserstack credentials<commit_after>module.exports = function(config) {
  var cfg = {};
  require('./karma.conf')({set: function (x){cfg = x;}});
  cfg.client = {
    captureConsole: false
  };
  cfg.port = 19145;
  
  var useBrowserStack = process.env.TRAVIS_PULL_REQUEST === 'false' && process.env.BROWSER_STACK_USERNAME;

  if (useBrowserStack) {  
    cfg.browserStack = {
        username: process.env.BROWSER_STACK_USERNAME,
        accessKey: process.env.BROWSER_STACK_ACCESS_KEY
    };
  }

  cfg.customLaunchers = {
    bs_firefox: {
      base: 'BrowserStack',
      browser: 'firefox',
      browser_version: '46.0',
      os: 'Windows',
      os_version: '10'
    },
  };

  cfg.browsers = !useBrowserStack ? ['Firefox'] : [
    'bs_firefox'
  ];

  cfg.plugins = [
      'karma-qunit',
      'karma-mocha-reporter',
      'karma-browserstack-launcher',
      'karma-firefox-launcher'
  ];

  config.set(cfg);
};
{'fraction_non_alphanumeric': 0.14620478858889455, 'fraction_numerical': 0.010188487009679063, 'mean_word_length': 3.0245901639344264, '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': '2728779', 'n_tokens_mistral': 736, 'n_tokens_neox': 700, 'n_words': 112}