2013-09-18 02:13:12 +00:00
|
|
|
var version = require('./package.json').version;
|
|
|
|
var ts = new Date().getTime();
|
|
|
|
|
|
|
|
module.exports = function(config) {
|
|
|
|
var auth;
|
|
|
|
|
|
|
|
try {
|
|
|
|
auth = require('./test/auth/index');
|
|
|
|
} catch(ex) {
|
|
|
|
auth = {};
|
|
|
|
auth.SAUCE_USERNAME = process.env.SAUCE_USERNAME || null;
|
|
|
|
auth.SAUCE_ACCESS_KEY = process.env.SAUCE_ACCESS_KEY || null;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!auth.SAUCE_USERNAME || !auth.SAUCE_ACCESS_KEY) return;
|
|
|
|
if (process.env.SKIP_SAUCE) return;
|
|
|
|
|
|
|
|
var branch = process.env.TRAVIS_BRANCH || 'local'
|
|
|
|
var browserConfig = require('./sauce.browsers');
|
|
|
|
var browsers = Object.keys(browserConfig);
|
|
|
|
var tags = [ 'chaijs_' + version, auth.SAUCE_USERNAME + '@' + branch ];
|
|
|
|
var tunnel = process.env.TRAVIS_JOB_NUMBER || ts;
|
|
|
|
|
|
|
|
if (process.env.TRAVIS_JOB_NUMBER) {
|
|
|
|
tags.push('travis@' + process.env.TRAVIS_JOB_NUMBER);
|
|
|
|
}
|
|
|
|
|
|
|
|
config.browsers = config.browsers.concat(browsers);
|
2018-12-14 22:02:54 +00:00
|
|
|
Object.assign(config.customLaunchers, browserConfig);
|
2013-09-18 02:13:12 +00:00
|
|
|
config.reporters.push('saucelabs');
|
2016-02-08 23:05:44 +00:00
|
|
|
config.captureTimeout = 300000;
|
2013-09-18 02:13:12 +00:00
|
|
|
|
|
|
|
config.sauceLabs = {
|
|
|
|
username: auth.SAUCE_USERNAME
|
|
|
|
, accessKey: auth.SAUCE_ACCESS_KEY
|
2016-02-08 22:23:20 +00:00
|
|
|
, startConnect: ('TRAVIS' in process.env) === false
|
2013-09-18 02:13:12 +00:00
|
|
|
, tags: tags
|
|
|
|
, testName: 'ChaiJS'
|
|
|
|
, tunnelIdentifier: tunnel
|
|
|
|
};
|
|
|
|
};
|