var webpackCfg = require('./webpack.config');

// Set node environment to testing
process.env.NODE_ENV = 'test';

module.exports = function(config) {
  config.set({
    basePath: '',
    browsers: [ 'PhantomJS' ],
    files: [
      'test/loadtests.js'
    ],
    port: 8000,
    captureTimeout: 60000,
    frameworks: [ 'mocha', 'chai' ],
    client: {
      mocha: {}
    },
    singleRun: true,
    reporters: [ 'mocha', 'coverage' ],
    preprocessors: {
      'test/loadtests.js': [ 'webpack', 'sourcemap' ]
    },
    webpack: webpackCfg,
    webpackServer: {
      noInfo: true
    },
    coverageReporter: {
      dir: 'coverage/',
      reporters: [
        { type: 'html' },
        { type: 'text' },
        { type: 'lcov' }
      ]
    }
  });
};

@@ -38,16 +38,43 @@
 onfig');
+%0Avar isCI = process.env.CI;
 %0A%0A// Set
@@ -174,21 +174,25 @@
 ) %7B%0A
- 
+%0A  var
  config
-.set(
+s = 
 %7B%0A  
@@ -228,17 +228,14 @@
  %5B '
-PhantomJS
+Chrome
 ' %5D,
@@ -774,14 +774,170 @@
    %7D%0A  %7D
+;%0A  if (isCI) %7B%0A    configs.browsers = %5B'PhantomJS'%5D;%0A    configs.files.push('./node_modules/phantomjs-polyfill/bind-polyfill.js');%0A  %7D%0A  config.set(configs
 );%0A%7D;%0A

update ci config