22
33const path = require ( 'path' )
44
5+ const customLaunchers = {
6+ sl_chrome : {
7+ base : 'SauceLabs' ,
8+ browserName : 'chrome' ,
9+ platform : 'Windows 10' ,
10+ version : '51.0'
11+ } ,
12+ sl_firefox : {
13+ base : 'SauceLabs' ,
14+ browserName : 'firefox' ,
15+ platform : 'Windows 10' ,
16+ version : '47.0'
17+ } ,
18+ sl_edge : {
19+ base : 'SauceLabs' ,
20+ browserName : 'MicrosoftEdge' ,
21+ platform : 'Windows 10' ,
22+ version : '13.10586'
23+ } ,
24+ sl_safari : {
25+ base : 'SauceLabs' ,
26+ browserName : 'safari' ,
27+ platform : 'OS X 10.11' ,
28+ version : '9.0' ,
29+ } ,
30+ }
31+
32+ const isTravis = process . env . TRAVIS === 'true'
33+ const isFirstJob = / \. 1 $ / . test ( process . env . TRAVIS_JOB_NUMBER )
34+
35+ const browsers = [ 'PhantomJS2' ]
36+ if ( isTravis && isFirstJob ) {
37+ Array . prototype . push . apply ( browsers , Object . keys ( customLaunchers ) )
38+ }
39+
540module . exports = function ( config ) {
41+
642 config . set ( {
743 basePath : '' ,
844 files : [
@@ -14,13 +50,14 @@ module.exports = function(config) {
1450 } ,
1551
1652 frameworks : [ 'mocha' , 'chai' ] ,
17- reporters : [ 'mocha' ] ,
53+ reporters : [ 'mocha' , 'saucelabs' ] ,
1854
1955 port : 9876 ,
2056 colors : true ,
2157 logLevel : config . LOG_INFO ,
2258 autoWatch : true ,
23- browsers : [ 'PhantomJS2' ] ,
59+ browsers : browsers ,
60+ customLaunchers : customLaunchers ,
2461 singleRun : true ,
2562
2663 webpack : {
0 commit comments