@@ -57,20 +57,9 @@ module.exports = function(config) {
57
57
58
58
frameworks : [ 'jasmine' , 'browserify' ] ,
59
59
60
- browsers : [ 'Chrome' ] ,
61
-
62
60
browserNoActivityTimeout : 60 * 1000 , // 60 seconds.
63
61
64
- customLaunchers : {
65
- // Custom launcher for Travis CI. It is required because Travis environment cannot use
66
- // sandbox.
67
- chromeTravis : {
68
- base : 'Chrome' ,
69
- flags : [ '--no-sandbox' ] ,
70
- } ,
71
- } ,
72
-
73
- reporters : [ 'progress' , 'coverage' ] ,
62
+ reporters : [ 'dots' , 'coverage' ] ,
74
63
75
64
coverageReporter : {
76
65
dir : conf . paths . coverage ,
@@ -89,6 +78,7 @@ module.exports = function(config) {
89
78
'karma-ng-html2js-preprocessor' ,
90
79
'karma-sourcemap-loader' ,
91
80
'karma-browserify' ,
81
+ 'karma-sauce-launcher' ,
92
82
] ,
93
83
94
84
// karma-browserify plugin config.
@@ -115,8 +105,34 @@ module.exports = function(config) {
115
105
} ;
116
106
117
107
// Use custom browser configuration when running on Travis CI.
118
- if ( process . env . TRAVIS ) {
119
- configuration . browsers = [ 'chromeTravis' ] ;
108
+ if ( conf . test . useSauceLabs ) {
109
+ configuration . reporters . push ( 'saucelabs' ) ;
110
+
111
+ let testName ;
112
+ if ( process . env . TRAVIS ) {
113
+ testName = `Karma tests ${ process . env . TRAVIS_REPO_SLUG } , build ` +
114
+ `${ process . env . TRAVIS_BUILD_NUMBER } ` ;
115
+ if ( process . env . TRAVIS_PULL_REQUEST !== 'false' ) {
116
+ testName += `, PR: https://github.com/${ process . env . TRAVIS_REPO_SLUG } /pull/` +
117
+ `${ process . env . TRAVIS_PULL_REQUEST } ` ;
118
+ }
119
+ } else {
120
+ testName = 'Local karma tests' ;
121
+ }
122
+
123
+ configuration . sauceLabs = {
124
+ testName : testName ,
125
+ connectOptions : { port : 5757 , logfile : 'sauce_connect.log' } ,
126
+ public : 'public' ,
127
+ } ,
128
+ configuration . customLaunchers = {
129
+ sl_chrome : { base : 'SauceLabs' , browserName : 'chrome' } ,
130
+ sl_firefox : { base : 'SauceLabs' , browserName : 'firefox' } ,
131
+ sl_ie : { base : 'SauceLabs' , browserName : 'internet explorer' } ,
132
+ } ;
133
+ configuration . browsers = Object . keys ( configuration . customLaunchers ) ;
134
+ } else {
135
+ configuration . browsers = [ 'Chrome' ] ;
120
136
}
121
137
122
138
// Convert all JS code written ES6 with modules to ES5 bundles that browsers can digest.
0 commit comments