Skip to content

Commit 1a2feb1

Browse files
committed
Build: Test against multiple jQuery versions in TestSwarm
1 parent 35893b7 commit 1a2feb1

File tree

2 files changed

+41
-5
lines changed

2 files changed

+41
-5
lines changed

Gruntfile.js

Lines changed: 40 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,34 @@ require( "load-grunt-tasks" )( grunt );
3737
grunt.initConfig( {
3838
pkg: grunt.file.readJSON( "package.json" ),
3939

40+
tests: {
41+
jquery: [
42+
"git",
43+
"git.min"
44+
],
45+
"jquery-3": [
46+
"3.x-git",
47+
"3.x-git.min",
48+
"3.5.1",
49+
"3.4.1",
50+
"3.3.1",
51+
"3.2.1",
52+
"3.1.1",
53+
"3.0.0",
54+
"2.2.4",
55+
"2.1.4",
56+
"2.0.3",
57+
"1.12.4",
58+
"1.11.3",
59+
"1.10.2",
60+
"1.9.1",
61+
"1.8.3",
62+
"1.7.2",
63+
"1.6.4",
64+
"1.5.2"
65+
]
66+
},
67+
4068
bowercopy: {
4169
all: {
4270
options: {
@@ -178,8 +206,9 @@ grunt.registerTask( "max", function() {
178206

179207
grunt.registerTask( "testswarm", function( commit, configFile, projectName, browserSets,
180208
timeout ) {
181-
var config,
209+
var config, tests,
182210
testswarm = require( "testswarm" ),
211+
runs = {},
183212
done = this.async();
184213

185214
projectName = projectName || "jquerycolor";
@@ -192,6 +221,15 @@ grunt.registerTask( "testswarm", function( commit, configFile, projectName, brow
192221
}
193222
timeout = timeout || 1000 * 60 * 15;
194223

224+
tests = grunt.config( "tests" )[
225+
Array.isArray( browserSets ) ? browserSets[ 0 ] : browserSets ||
226+
"jquery" ];
227+
228+
tests.forEach( function( jQueryVersion ) {
229+
runs[ jQueryVersion ] = config.testUrl + commit +
230+
"/test/index.html?jquery=" + jQueryVersion;
231+
} );
232+
195233
testswarm.createClient( {
196234
url: config.swarmUrl
197235
} )
@@ -203,9 +241,7 @@ grunt.registerTask( "testswarm", function( commit, configFile, projectName, brow
203241
.addjob(
204242
{
205243
name: "Commit <a href='https://github.com/jquery/jquery-color/commit/" + commit + "'>" + commit.substr( 0, 10 ) + "</a>",
206-
runs: {
207-
"jQuery color": config.testUrl + commit + "/test/index.html"
208-
},
244+
runs: runs,
209245
runMax: config.runMax,
210246
browserSets: browserSets,
211247
timeout: timeout

test/jquery.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ for ( ; i < length; i++ ) {
1515
}
1616
}
1717

18-
if ( version === "git" || version === "3.x-git" ) {
18+
if ( /(?:3.x-)?git(\.min)?/.test( version ) ) {
1919
url = "https://code.jquery.com/jquery-" + version + ".js";
2020
} else {
2121
url = "../external/jquery-" + ( version || "3.5.1" ) + "/jquery.js";

0 commit comments

Comments
 (0)