aboutsummaryrefslogtreecommitdiffstats
path: root/tests/lib/bootstrap.js
diff options
context:
space:
mode:
authorMichał Gołębiowski-Owczarek <m.goleb@gmail.com>2024-05-13 18:11:57 +0200
committerGitHub <noreply@github.com>2024-05-13 18:11:57 +0200
commitac8b1e4eee8682e6825730c4823036a90031edad (patch)
tree6a4207cebc3138de51e6ec776e6d36117fd0a665 /tests/lib/bootstrap.js
parent969d182963347830a78b291198f6f183fb65d8e6 (diff)
downloadjquery-ui-ac8b1e4eee8682e6825730c4823036a90031edad.tar.gz
jquery-ui-ac8b1e4eee8682e6825730c4823036a90031edad.zip
Core: Make back compat disabled by default
Closes gh-2250
Diffstat (limited to 'tests/lib/bootstrap.js')
-rw-r--r--tests/lib/bootstrap.js20
1 files changed, 11 insertions, 9 deletions
diff --git a/tests/lib/bootstrap.js b/tests/lib/bootstrap.js
index fd9b1eb65..e0df9ebf5 100644
--- a/tests/lib/bootstrap.js
+++ b/tests/lib/bootstrap.js
@@ -25,9 +25,9 @@ requirejs.config( {
}
} );
-// Create a module that disables back compat for UI modules
-define( "jquery-no-back-compat", [ "jquery" ], function( $ ) {
- $.uiBackCompat = false;
+// Create a module that enables back compat for UI modules
+define( "jquery-back-compat", [ "jquery" ], function( $ ) {
+ $.uiBackCompat = true;
return $;
} );
@@ -53,10 +53,12 @@ function requireModules( dependencies, callback, modules ) {
}
// Load a set of test file along with the required test infrastructure
-function requireTests( dependencies, noBackCompat ) {
- var preDependencies = [
+function requireTests( dependencies, options ) {
+
+ var backCompat = !!( options && options.backCompat ),
+ preDependencies = [
"lib/qunit",
- noBackCompat ? "jquery-no-back-compat" : "jquery",
+ backCompat ? "jquery-back-compat" : "jquery",
"jquery-simulate"
];
@@ -136,7 +138,7 @@ function migrateUrl() {
// - data-widget: A widget to load test modules for
// - Automatically loads common, core, events, methods, and options
// - data-deprecated: Loads the deprecated test modules for a widget
-// - data-no-back-compat: Set $.uiBackCompat to false
+// - data-back-compat: Set $.uiBackCompat to `true`
( function() {
// Find the script element
@@ -154,7 +156,7 @@ function migrateUrl() {
}
var widget = script.getAttribute( "data-widget" );
var deprecated = !!script.getAttribute( "data-deprecated" );
- var noBackCompat = !!script.getAttribute( "data-no-back-compat" );
+ var backCompat = !!script.getAttribute( "data-back-compat" );
if ( widget ) {
modules = modules.concat( [
@@ -177,7 +179,7 @@ function migrateUrl() {
modules.unshift( "ui/jquery-patch" );
}
- requireTests( modules, noBackCompat );
+ requireTests( modules, { backCompat: backCompat } );
} )();
} )();