const webpack = require('webpack');

module.exports = config => {
  config.set({
    browsers: ['Chrome'],
    frameworks: ['jasmine'],
    reporters: ['spec', 'kjhtml'],
    files: ['tests.webpack.js'],
    preprocessors: {
      'tests.webpack.js': ['webpack', 'sourcemap']
    },
    webpack: {
      mode: 'development',
      devtool: 'inline-source-map',
      module: {
        rules: [
          { test: /\.jsx?$/, exclude: /node_modules/, loader: 'babel-loader' },
          { test: /\.tsx?$/, exclude: /node_modules/, loader: 'awesome-typescript-loader' }
        ]
      },
      resolve: {
        extensions: ['.ts', '.tsx', '.js', '.jsx']
      },
      plugins: [
        new webpack.DefinePlugin({
          'process.env.NODE_ENV': JSON.stringify('test')
        })
      ]
    },

    webpackServer: {
      noInfo: true
    }
  });

  if (process.env.TRAVIS) {
    const customLaunchers = {
      sl_iphone: {
        base: 'SauceLabs',
        browserName: 'iphone',
        platform: 'OS X 10.10',
        version: '8.2',
        deviceName: 'iPhone Simulator'
      },
      sl_ipad: {
        base: 'SauceLabs',
        browserName: 'iphone',
        platform: 'OS X 10.10',
        version: '8.2',
        deviceName: 'iPad Simulator'
      },
      sl_android: {
        base: 'SauceLabs',
        browserName: 'android',
        platform: 'Linux',
        version: '5.1',
        deviceName: 'Android Emulator'
      },
      sl_mac_safari: {
        base: 'SauceLabs',
        browserName: 'safari',
        platform: 'OS X 10.10',
        version: '8.0'
      },
      sl_mac_firefox: {
        base: 'SauceLabs',
        browserName: 'firefox',
        platform: 'OS X 10.10',
        version: '36.0'
      },
      sl_mac_chrome: {
        base: 'SauceLabs',
        browserName: 'chrome',
        platform: 'OS X 10.10',
        versiono: '41.0'
      },
      sl_windows7_ie11: {
        base: 'SauceLabs',
        browserName: 'internet explorer',
        platform: 'Windows 7',
        version: '11.0'
      },
      sl_windows7_ie10: {
        base: 'SauceLabs',
        browserName: 'internet explorer',
        platform: 'Windows 7',
        version: '10.0'
      },
      sl_windows7_ie9: {
        base: 'SauceLabs',
        browserName: 'internet explorer',
        platform: 'Windows 7',
        version: '9.0'
      },
      sl_linux_firefox: {
        base: 'SauceLabs',
        browserName: 'firefox',
        platform: 'Linux',
        version: '37.0'
      },
      sl_linux_chrome: {
        base: 'SauceLabs',
        browserName: 'chrome',
        platform: 'Linux',
        version: '41.0'
      }
    };

    config.saceLabs = {
      testName: 'Cookies Unit Tests'
    };
    config.singleRun = true;
    config.customLaunchers = customLaunchers;
    config.browsers = Object.keys(customLaunchers);
    config.reporters = ['spec', 'saucelabs'];
  }
};

@@ -912,17 +912,19 @@
     
-sl_iphone
+'SL_Chrome'
 : %7B%0A
@@ -976,225 +976,14 @@
 e: '
-iphone',%0A        platform: 'OS X 10.10',%0A        version: '8.2',%0A        deviceName: 'iPhone Simulator'%0A      %7D,%0A      sl_ipad: %7B%0A        base: 'SauceLabs',%0A        browserName: 'iphone',%0A        platform: 'OS X 10.10
+chrome
 ',%0A 
@@ -1003,403 +1003,68 @@
 n: '
+4
 8.
-2',%0A        deviceName: 'iPad Simulator'%0A      %7D,%0A      sl_android: %7B%0A        base: 'SauceLabs',%0A        browserName: 'android',%0A        platform: 'Linux',%0A        version: '5.1',%0A        deviceName: 'Android Emulator'%0A      %7D,%0A      sl_mac_safari: %7B%0A        base: 'SauceLabs',%0A        browserName: 'safari',%0A        platform: 'OS X 10.10',%0A        version: '8.0'%0A      %7D,%0A      sl_mac_f
+0',%0A        platform: 'Linux'%0A      %7D,%0A      'SL_F
 irefox
+'
 : %7B%0A
@@ -1126,40 +1126,8 @@
 x',%0A
-        platform: 'OS X 10.10',%0A
     
@@ -1144,263 +1144,82 @@
 n: '
-36.0'%0A      %7D,%0A      sl_mac_chrome: %7B%0A        base: 'SauceLabs',%0A        browserName: 'chrome',%0A        platform: 'OS X 10.10',%0A        versiono: '41.0'%0A      %7D,%0A      sl_windows7_ie11: %7B%0A        base: 'SauceLabs',%0A        browserName: 'i
+50.0',%0A        platform: 'Windows 10'%0A      %7D,%0A      'SL_I
 nternet
- e
+E
 xplorer'
 ,%0A  
@@ -1218,96 +1218,8 @@
 rer'
-,%0A        platform: 'Windows 7',%0A        version: '11.0'%0A      %7D,%0A      sl_windows7_ie10
 : %7B%0A
@@ -1291,39 +1291,8 @@
 r',%0A
-        platform: 'Windows 7',%0A
     
@@ -1310,345 +1310,70 @@
 : '1
-0.0'%0A      %7D,%0A      sl_windows7_ie9: %7B%0A        base: 'SauceLabs',%0A        browserName: 'internet explorer',%0A        platform: 'Windows 7',%0A        version: '9.0'%0A      %7D,%0A      sl_linux_firefox: %7B%0A        base: 'SauceLabs',%0A        browserName: 'firefox',%0A        platform: 'Linux',%0A        version: '37.0'%0A      %7D,%0A      sl_linux_chrome
+1.0',%0A        platform: 'Windows 7'%0A      %7D,%0A      'SL_Safari'
 : %7B%0A
@@ -1413,38 +1413,38 @@
   browserName: '
-chrome
+safari
 ',%0A        platf
@@ -1449,21 +1449,26 @@
 tform: '
-Linux
+OS X 10.11
 ',%0A     
@@ -1484,10 +1484,10 @@
 n: '
-4
 1
+0
 .0'%0A

Update saucelabs env to test