22
33/*
44 * Browser Configuration for the different jobs in the CI.
5- * Target can be either: BS (Browserstack) | SL (Saucelabs) | null (To not run at all )
5+ * Target can be either: BS (Browserstack) | SL (Saucelabs) | TC (Travis CI) | null (To not run)
66 */
77const browserConfig = {
8- 'Chrome ' : { unitTest : { target : 'BS ' , required : true } } ,
9- 'Firefox' : { unitTest : { target : 'BS' , required : true } } ,
10- 'ChromeBeta' : { unitTest : { target : null , required : false } } ,
11- 'FirefoxBeta' : { unitTest : { target : null , required : false } } ,
12- 'ChromeDev' : { unitTest : { target : null , required : true } } ,
13- 'FirefoxDev' : { unitTest : { target : null , required : true } } ,
14- 'IE9' : { unitTest : { target : null , required : false } } ,
15- 'IE10' : { unitTest : { target : null , required : true } } ,
16- 'IE11' : { unitTest : { target : 'SL' , required : true } } ,
17- 'Edge' : { unitTest : { target : 'SL' , required : true } } ,
18- 'Android4.1' : { unitTest : { target : null , required : false } } ,
19- 'Android4.2' : { unitTest : { target : null , required : false } } ,
20- 'Android4.3' : { unitTest : { target : null , required : false } } ,
21- 'Android4.4' : { unitTest : { target : null , required : false } } ,
22- 'Android5' : { unitTest : { target : null , required : false } } ,
23- 'Safari7' : { unitTest : { target : null , required : false } } ,
24- 'Safari8' : { unitTest : { target : null , required : false } } ,
25- 'Safari9' : { unitTest : { target : 'SL' , required : true } } ,
26- 'Safari10' : { unitTest : { target : 'BS' , required : true } } ,
27- 'iOS7' : { unitTest : { target : null , required : false } } ,
28- 'iOS8' : { unitTest : { target : null , required : false } } ,
29- 'iOS9' : { unitTest : { target : 'BS' , required : true } } ,
30- 'WindowsPhone' : { unitTest : { target : null , required : false } }
8+ 'ChromeHeadless_CI ' : { unitTest : { target : 'TC ' , required : true } } ,
9+ 'Firefox' : { unitTest : { target : 'BS' , required : true } } ,
10+ 'ChromeBeta' : { unitTest : { target : null , required : false } } ,
11+ 'FirefoxBeta' : { unitTest : { target : null , required : false } } ,
12+ 'ChromeDev' : { unitTest : { target : null , required : true } } ,
13+ 'FirefoxDev' : { unitTest : { target : null , required : true } } ,
14+ 'IE9' : { unitTest : { target : null , required : false } } ,
15+ 'IE10' : { unitTest : { target : null , required : true } } ,
16+ 'IE11' : { unitTest : { target : 'SL' , required : true } } ,
17+ 'Edge' : { unitTest : { target : 'SL' , required : true } } ,
18+ 'Android4.1' : { unitTest : { target : null , required : false } } ,
19+ 'Android4.2' : { unitTest : { target : null , required : false } } ,
20+ 'Android4.3' : { unitTest : { target : null , required : false } } ,
21+ 'Android4.4' : { unitTest : { target : null , required : false } } ,
22+ 'Android5' : { unitTest : { target : null , required : false } } ,
23+ 'Safari7' : { unitTest : { target : null , required : false } } ,
24+ 'Safari8' : { unitTest : { target : null , required : false } } ,
25+ 'Safari9' : { unitTest : { target : 'SL' , required : true } } ,
26+ 'Safari10' : { unitTest : { target : 'BS' , required : true } } ,
27+ 'iOS7' : { unitTest : { target : null , required : false } } ,
28+ 'iOS8' : { unitTest : { target : null , required : false } } ,
29+ 'iOS9' : { unitTest : { target : 'BS' , required : true } } ,
30+ 'WindowsPhone' : { unitTest : { target : null , required : false } }
3131} ;
3232
3333/** Exports all available remote browsers. */
@@ -43,14 +43,26 @@ exports.platformMap = {
4343 required : buildConfiguration ( 'unitTest' , 'BS' , true ) ,
4444 optional : buildConfiguration ( 'unitTest' , 'BS' , false )
4545 } ,
46+ 'travis' : {
47+ required : buildConfiguration ( 'unitTest' , 'TC' , true ) ,
48+ optional : buildConfiguration ( 'unitTest' , 'TC' , false )
49+ }
4650} ;
4751
4852/** Build a list of configuration (custom launcher names). */
4953function buildConfiguration ( type , target , required ) {
50- return Object . keys ( browserConfig )
51- . map ( item => [ item , browserConfig [ item ] [ type ] ] )
52- . filter ( ( [ , conf ] ) => conf . required === required && conf . target === target )
53- . map ( ( [ item ] ) => `${ target } _${ item . toUpperCase ( ) } ` ) ;
54+ const targetBrowsers = Object . keys ( browserConfig )
55+ . map ( browserName => [ browserName , browserConfig [ browserName ] [ type ] ] )
56+ . filter ( ( [ , config ] ) => config . required === required && config . target === target )
57+ . map ( ( [ browserName ] ) => browserName ) ;
58+
59+ // For browsers that run on Travis CI the browser name shouldn't be prefixed with the shortcut
60+ // of Travis. The different Karma launchers only work with the plain browser name (e.g Firefox)
61+ if ( target === 'TC' ) {
62+ return targetBrowsers ;
63+ }
64+
65+ return targetBrowsers . map ( browserName => `${ target } _${ browserName . toUpperCase ( ) } ` ) ;
5466}
5567
5668/** Decode the token for Travis to use. */
0 commit comments