Skip to content

Commit e5eedd8

Browse files
committed
Add the proper browsers to the list, when using the MODE environment
variable.
1 parent 378713d commit e5eedd8

File tree

2 files changed

+20
-9
lines changed

2 files changed

+20
-9
lines changed

test/browser-providers.conf.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -285,8 +285,8 @@ var sauceAliases = {
285285
'SAFARI': ['SL_SAFARI7', 'SL_SAFARI8', 'SL_SAFARI9'],
286286
'BETA': ['SL_CHROMEBETA', 'SL_FIREFOXBETA'],
287287
'DEV': ['SL_CHROMEDEV', 'SL_FIREFOXDEV'],
288-
'CI_REQUIRED': buildConfiguration('unitTest', 'SL', true),
289-
'CI_OPTIONAL': buildConfiguration('unitTest', 'SL', false)
288+
'REQUIRED': buildConfiguration('unitTest', 'SL', true),
289+
'OPTIONAL': buildConfiguration('unitTest', 'SL', false)
290290
};
291291

292292
var browserstackAliases = {
@@ -300,8 +300,8 @@ var browserstackAliases = {
300300
'IE': ['BS_IE9', 'BS_IE10', 'BS_IE11'],
301301
'IOS': ['BS_IOS7', 'BS_IOS8', 'BS_IOS9'],
302302
'SAFARI': ['BS_SAFARI7', 'BS_SAFARI8', 'BS_SAFARI9'],
303-
'CI_REQUIRED': buildConfiguration('unitTest', 'BS', true),
304-
'CI_OPTIONAL': buildConfiguration('unitTest', 'BS', false)
303+
'REQUIRED': buildConfiguration('unitTest', 'BS', true),
304+
'OPTIONAL': buildConfiguration('unitTest', 'BS', false)
305305
};
306306

307307
module.exports = {
@@ -311,7 +311,7 @@ module.exports = {
311311
};
312312

313313
function decode(str) {
314-
return str.split('').reverse().join('');
314+
return (str || '').split('').reverse().join('');
315315
}
316316

317317
if (process.env.TRAVIS) {

test/karma.conf.js

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -72,26 +72,37 @@ module.exports = function(config) {
7272
pollingTimeout: 10000
7373
},
7474

75-
browsers: ['Firefox'],
75+
browsers: ['Chrome'],
7676

7777
singleRun: false
7878
});
7979

8080
if (process.env.TRAVIS) {
8181
var buildId = `TRAVIS #${process.env.TRAVIS_BUILD_NUMBER} (${process.env.TRAVIS_BUILD_ID})`;
82-
if (process.env.MODE.startsWith('saucelabs')) {
82+
83+
var modeSplit = process.env.MODE.split('_');
84+
var platform = modeSplit[0];
85+
var alias = modeSplit[1] || 'all';
86+
87+
if (platform == 'saucelabs') {
8388
config.sauceLabs.build = buildId;
8489
config.sauceLabs.tunnelIdentifier = process.env.TRAVIS_JOB_NUMBER;
8590

8691
// TODO(mlaval): remove once SauceLabs supports websockets.
8792
// This speeds up the capturing a bit, as browsers don't even try to use websocket.
8893
console.log('>>>> setting socket.io transport to polling <<<<');
8994
config.transports = ['polling'];
90-
}
9195

92-
if (process.env.MODE.startsWith('browserstack')) {
96+
config.browsers = browserProvidersConf.sauceAliases[alias.toUpperCase()];
97+
}
98+
else if (platform == 'browserstack') {
9399
config.browserStack.build = buildId;
94100
config.browserStack.tunnelIdentifier = process.env.TRAVIS_JOB_NUMBER;
101+
102+
config.browsers = browserProvidersConf.sauceAliases[alias.uppercase()];
103+
}
104+
else {
105+
throw new Error(`Platform "${platform}" unknown, but Travis specified. Exiting.`);
95106
}
96107
}
97108
};

0 commit comments

Comments
 (0)