code: function configureSauceLabs (config) {
    let username = process.env.SAUCE_USERNAME;
    let accessKey = process.env.SAUCE_ACCESS_KEY;
  
    if (!username || !accessKey) {
      throw new Error(`SAUCE_USERNAME and/or SAUCE_ACCESS_KEY is not set`);
    }
  
    var project = require("./package.json");
  
    config.sauceLabs = {
      build: `${project.name} v${project.version} Build #${process.env.TRAVIS_JOB_NUMBER}`,
      testName: `${project.name} v${project.version}`,
      tags: [project.name],
    };
  
    config.customLaunchers = {
      IE_11: {
        base: "SauceLabs",
        platform: "Windows 7",
        browserName: "internet explorer"
      },
      Edge: {
        base: "SauceLabs",
        platform: "Windows 10",
        browserName: "microsoftedge"
      },
    };
  
    config.reporters.push("saucelabs");
    config.browsers = Object.keys(config.customLaunchers);
    // config.concurrency = 1;
    config.captureTimeout = 60000;
    config.browserDisconnectTolerance = 5,
    config.browserDisconnectTimeout = 60000;
    config.browserNoActivityTimeout = 60000;
  
    // Exclude these tests when running on SauceLabs.
    // For some reason, these tests seem to make SauceLabs unstable,
    // and it frequently loses connection to the CI server, which causes the build to fail
    config.exclude = [
      "test/specs/invalid/*",
      "test/specs/unknown/*",
      "test/specs/validate-schema/*",
      "test/specs/real-world/*",
    ];
  }
docs: Configures Sauce Labs emulated browsers/devices.
  https://github.com/karma-runner/karma-sauce-launcher