forked from chaijs/chai
-
Notifications
You must be signed in to change notification settings - Fork 0
/
karma.sauce.js
41 lines (34 loc) · 1.17 KB
/
karma.sauce.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
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);
config.customLaunchers = browserConfig;
config.reporters.push('saucelabs');
config.transports = [ 'xhr-polling' ];
config.sauceLabs = {
username: auth.SAUCE_USERNAME
, accessKey: auth.SAUCE_ACCESS_KEY
, startConnect: true
, tags: tags
, testName: 'ChaiJS'
, tunnelIdentifier: tunnel
};
};