]> source.dussan.org Git - jquery.git/commitdiff
Build: Run tests on Travis only on browsers defined in the config
authorMichał Gołębiowski-Owczarek <m.goleb@gmail.com>
Tue, 22 Oct 2019 18:49:37 +0000 (20:49 +0200)
committerGitHub <noreply@github.com>
Tue, 22 Oct 2019 18:49:37 +0000 (20:49 +0200)
The environmental variable BROWSERS was being created but it wasn't read in the
list of browsers to pass to Karma.

Closes gh-4532

Gruntfile.js

index 7f21bf61364301ffdcbc62acf8a5a1f0f795a348..831ca4b8865566242e44579bec5f7987df30576a 100644 (file)
@@ -13,7 +13,9 @@ module.exports = function( grunt ) {
        }
 
        var fs = require( "fs" ),
-               gzip = require( "gzip-js" );
+               gzip = require( "gzip-js" ),
+               isTravis = process.env.TRAVIS,
+               travisBrowsers = process.env.BROWSERS && process.env.BROWSERS.split( "," );
 
        if ( !grunt.option( "filename" ) ) {
                grunt.option( "filename", "jquery.js" );
@@ -190,7 +192,7 @@ module.exports = function( grunt ) {
                                singleRun: true
                        },
                        main: {
-                               browsers: [ "ChromeHeadless", "FirefoxHeadless" ]
+                               browsers: isTravis && travisBrowsers || [ "ChromeHeadless", "FirefoxHeadless" ]
                        },
 
                        jsdom: {