Skip to content

Commit 73f57c1

Browse files
committed
Tests: Move QUnit.jQuerySelectors{,Pos} definitions up
Previously, they were loaded after test files which meant top level usage was not evaluated correctly.
1 parent a13f2ac commit 73f57c1

File tree

1 file changed

+12
-11
lines changed

1 file changed

+12
-11
lines changed

test/data/testinit.js

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -410,6 +410,18 @@ this.loadTests = function() {
410410

411411
// Get testSubproject from testrunner first
412412
require( [ parentUrl + "test/data/testrunner.js" ], function() {
413+
414+
// Says whether jQuery positional selector extensions are supported.
415+
// A full selector engine is required to support them as they need to
416+
// be evaluated left-to-right. Remove that property when support for
417+
// positional selectors is dropped.
418+
QUnit.jQuerySelectorsPos = includesModule( "selector-full" );
419+
420+
// Says whether jQuery selector extensions are supported. Change that
421+
// to `false` if your custom jQuery versions relies more on native qSA.
422+
// This doesn't include support for positional selectors (see above).
423+
QUnit.jQuerySelectors = includesModule( "selector-full" );
424+
413425
var i = 0,
414426
tests = [
415427
// A special module with basic tests, meant for
@@ -469,17 +481,6 @@ this.loadTests = function() {
469481
*/
470482
jQuery.noConflict();
471483

472-
// Says whether jQuery positional selector extensions are supported.
473-
// A full selector engine is required to support them as they need to
474-
// be evaluated left-to-right. Remove that property when support for
475-
// positional selectors is dropped.
476-
QUnit.jQuerySelectorsPos = includesModule( "selector-full" );
477-
478-
// Says whether jQuery selector extensions are supported. Change that
479-
// to `false` if your custom jQuery versions relies more on native qSA.
480-
// This doesn't include support for positional selectors (see above).
481-
QUnit.jQuerySelectors = includesModule( "selector-full" );
482-
483484
// Load the TestSwarm listener if swarmURL is in the address.
484485
if ( QUnit.isSwarm ) {
485486
require( [ "https://swarm.jquery.org/js/inject.js?" + ( new Date() ).getTime() ],

0 commit comments

Comments
 (0)