@@ -41,10 +41,10 @@ function requireModules( dependencies, callback, modules ) {
41
41
}
42
42
43
43
// Load a set of test file along with the required test infrastructure
44
- function requireTests ( dependencies , callback ) {
44
+ function requireTests ( dependencies , noBackCompat ) {
45
45
dependencies = [
46
46
"../../lib/qunit" ,
47
- "jquery" ,
47
+ noBackCompat ? "jquery-no-back-compat" : "jquery" ,
48
48
"jquery-simulate" ,
49
49
"qunit-assert-classes" ,
50
50
"../../lib/qunit-assert-domequal"
@@ -101,6 +101,7 @@ function swarmInject() {
101
101
// - data-widget: A widget to load test modules for
102
102
// - Automatically loads common, core, events, methods, and options
103
103
// - data-deprecated: Loads the deprecated test modules for a widget
104
+ // - data-no-back-compat: Set $.uiBackCompat to false
104
105
( function ( ) {
105
106
106
107
// Find the script element
@@ -117,7 +118,9 @@ function swarmInject() {
117
118
modules = [ ] ;
118
119
}
119
120
var widget = script . getAttribute ( "data-widget" ) ;
120
- var deprecated = script . getAttribute ( "data-deprecated" ) ;
121
+ var deprecated = ! ! script . getAttribute ( "data-deprecated" ) ;
122
+ var noBackCompat = ! ! script . getAttribute ( "data-no-back-compat" ) ;
123
+
121
124
if ( widget ) {
122
125
modules = modules . concat ( [
123
126
widget + ( deprecated ? "_common_deprecated" : "_common" ) ,
@@ -136,12 +139,19 @@ function swarmInject() {
136
139
script . src = "../../../external/requirejs/require.js" ;
137
140
script . onload = function ( ) {
138
141
142
+ // Create a module that disables back compat for UI modules
143
+ define ( "jquery-no-back-compat" , [ "jquery" ] , function ( $ ) {
144
+ $ . uiBackCompat = false ;
145
+
146
+ return $ ;
147
+ } ) ;
148
+
139
149
// Create a dummy bridge if we're not actually testing in PhantomJS
140
150
if ( ! / P h a n t o m J S / . test ( navigator . userAgent ) ) {
141
151
define ( "phantom-bridge" , function ( ) { } ) ;
142
152
}
143
153
144
- requireTests ( modules ) ;
154
+ requireTests ( modules , noBackCompat ) ;
145
155
} ;
146
156
document . documentElement . appendChild ( script ) ;
147
157
} ) ( ) ;
0 commit comments