var path = require('path');

module.exports = function(config) {
  config.set({

    frameworks: ['jasmine'],

    files: [
      'tests/**/*.js',
      'dist/**/*.js',
    ],

    reporters: ['progress'],

    port: 9876,

    colors: true,

    logLevel: config.LOG_INFO,

    autoWatch: false,

    browsers: ['Chrome', 'Firefox', 'Safari'],

    singleRun: true,

    sauceLabs: {
      testName: 'heartbeat.js',
      startConnect: true,
      options: {
        'selenium-version': '2.41.0'
      }
    },

    customLaunchers: {
      'SL_Chrome': {
        base: 'SauceLabs',
        browserName: 'chrome',
        version: '39'
      },
      'SL_Firefox': {
        base: 'SauceLabs',
        browserName: 'firefox',
        version: '31'
      },
      'SL_Safari': {
        base: 'SauceLabs',
        browserName: 'safari',
        platform: 'OS X 10.10',
        version: '8'
      },
      'SL_IE_9': {
        base: 'SauceLabs',
        browserName: 'internet explorer',
        platform: 'Windows 2008',
        version: '9'
      },
      'SL_IE_10': {
        base: 'SauceLabs',
        browserName: 'internet explorer',
        platform: 'Windows 2012',
        version: '10'
      },
      'SL_IE_11': {
        base: 'SauceLabs',
        browserName: 'internet explorer',
        platform: 'Windows 8.1',
        version: '11'
      },
      'SL_iOS': {
        base: "SauceLabs",
        browserName: "iphone",
        platform: "OS X 10.10",
        version: "8.1"
      }
    }
  });

  if (process.env.TRAVIS) {
    var buildLabel = 'TRAVIS #' + process.env.TRAVIS_BUILD_NUMBER + ' (' + process.env.TRAVIS_BUILD_ID + ')';
    config.browserNoActivityTimeout = 120000;
    config.sauceLabs.build = buildLabel;
    config.sauceLabs.startConnect = false;
    config.sauceLabs.tunnelIdentifier = process.env.TRAVIS_JOB_NUMBER;
    config.sauceLabs.recordScreenshots = true;

    if (process.env.BROWSER_PROVIDER === 'saucelabs' || !process.env.BROWSER_PROVIDER) {
      //don't kill browsers in the cloud
      config.captureTimeout = 0;
    }
  }


}

@@ -196,16 +196,29 @@
 rogress'
+, 'saucelabs'
 %5D,%0A%0A    
@@ -1654,16 +1654,45 @@
  + ')';%0A
+    console.log(buildLabel);%0A
     conf
@@ -1935,100 +1935,8 @@
 ue;%0A
-%0A    if (process.env.BROWSER_PROVIDER === 'saucelabs' %7C%7C !process.env.BROWSER_PROVIDER) %7B%0A  
     
@@ -1974,18 +1974,16 @@
 oud%0A    
-  
 config.c
@@ -2001,22 +2001,69 @@
 ut = 0;%0A    
-%7D
+config.browsers = Object.keys(customLaunchers);%0A
 %0A  %7D%0A%0A%0A%7D%0A

Add saucelabs reporter