]> source.dussan.org Git - jquery-ui.git/commitdiff
Tests: Load jQuery Migrate before UI test files
authorMichał Gołębiowski-Owczarek <m.goleb@gmail.com>
Sat, 16 May 2020 06:30:11 +0000 (08:30 +0200)
committerGitHub <noreply@github.com>
Sat, 16 May 2020 06:30:11 +0000 (08:30 +0200)
This is necessary to catch all possible warnings that the test files
may trigger.

Closes gh-1918

tests/lib/bootstrap.js

index bae1afada5d242b18cdaf0c2e7fdb01a6721b2b3..d0c489dc06a4754e1693b240d27243ea3bab9add 100644 (file)
@@ -60,21 +60,24 @@ function requireModules( dependencies, callback, modules ) {
 
 // Load a set of test file along with the required test infrastructure
 function requireTests( dependencies, noBackCompat ) {
-       dependencies = [
+       var preDependencies = [
                "lib/qunit",
                noBackCompat ? "jquery-no-back-compat" : "jquery",
                "jquery-simulate"
-       ].concat( dependencies );
+       ];
+
+       // Load migrate before test files
+       if ( parseUrl().migrate ) {
+               preDependencies.push( "jquery-migrate" );
+       }
+
+       dependencies = preDependencies.concat( dependencies );
 
        // Load the TestSwarm injector, if necessary
        if ( parseUrl().swarmURL ) {
                dependencies.push( "testswarm" );
        }
 
-       if ( parseUrl().migrate ) {
-               dependencies.push( "jquery-migrate" );
-       }
-
        requireModules( dependencies, function( QUnit ) {
                QUnit.start();
        } );