module.exports = function (config) {
  config.set({
    files: [
      'test/**/*.spec.js',
      { pattern: 'test/exceptions/data/*.js', included: false, watched: false }
    ],
    frameworks: ['browserify', 'jasmine'],
    preprocessors: {
      'test/**/*.spec.js': ['browserify']
    },
    plugins: [
      'karma-failed-reporter',
    // 'karma-chrome-launcher',
      'karma-phantomjs2-launcher',
      'karma-firefox-launcher',
      'karma-jasmine',
      'karma-spec-reporter',
      'karma-browserify'
    ],
    browsers: ['PhantomJS2'], // Chrome, Firefox, PhantomJS2
    reporters: ['spec', 'failed'],
    browserify: {
      debug: true
    }
  })
};

module.exports = function (config) {
  var cfg = {
    files: [
      'test/**/*.spec.js',
      { pattern: 'test/exceptions/data/*.js', included: false, watched: false }
    ],
    frameworks: ['browserify', 'jasmine'],
    preprocessors: {
      'test/**/*.spec.js': ['browserify']
    },
    plugins: [
      'karma-failed-reporter',
      'karma-jasmine',
      'karma-spec-reporter',
      'karma-browserify'
    ],
    browsers: [], // Chrome, Firefox, PhantomJS2
    reporters: ['spec', 'failed'],
    browserify: {
      debug: true
    }
  }

  if (process.env.TRAVIS) {
    // 'karma-chrome-launcher',
    cfg.plugins.push('karma-firefox-launcher')
    cfg.browsers.push('Firefox')
  } else {
    cfg.plugins.push('karma-phantomjs2-launcher')
    cfg.browsers.push('PhantomJS2')
  }

  config.set(cfg)
}

fix karma.conf.js to run firefox only on travis