aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorTimmy Willison <timmywillisn@gmail.com>2014-12-09 15:39:24 -0500
committerTimmy Willison <timmywillisn@gmail.com>2014-12-09 15:39:24 -0500
commit6051609df35ef5e478c79c76534c03e4b46100bf (patch)
tree65da2705750c520dbdea933aacce39887d482c2a /test
parent58c24608210c9a9a264a38746628ebc26823f59b (diff)
downloadjquery-6051609df35ef5e478c79c76534c03e4b46100bf.tar.gz
jquery-6051609df35ef5e478c79c76534c03e4b46100bf.zip
Build: fix tests in AMD mode
Diffstat (limited to 'test')
-rw-r--r--test/data/testinit.js4
-rw-r--r--test/unit/core.js29
2 files changed, 19 insertions, 14 deletions
diff --git a/test/data/testinit.js b/test/data/testinit.js
index cb7ddf3ca..9b3caba93 100644
--- a/test/data/testinit.js
+++ b/test/data/testinit.js
@@ -301,7 +301,9 @@ this.loadTests = function() {
/**
* Run in noConflict mode
*/
- jQuery.noConflict();
+ if (jQuery.noConflict) {
+ jQuery.noConflict();
+ }
// Load the TestSwarm listener if swarmURL is in the address.
if ( loadSwarm ) {
diff --git a/test/unit/core.js b/test/unit/core.js
index 783a7462e..ce3c3184d 100644
--- a/test/unit/core.js
+++ b/test/unit/core.js
@@ -234,24 +234,27 @@ test( "globalEval execution after script injection (#7862)", 1, function() {
ok( window.strictEvalTest - now < 500, "Code executed synchronously" );
});
-test("noConflict", function() {
- expect(7);
+// This is not run in AMD mode
+if (jQuery.noConflict) {
+ test("noConflict", function() {
+ expect(7);
- var $$ = jQuery;
+ var $$ = jQuery;
- strictEqual( jQuery, jQuery.noConflict(), "noConflict returned the jQuery object" );
- strictEqual( window["jQuery"], $$, "Make sure jQuery wasn't touched." );
- strictEqual( window["$"], original$, "Make sure $ was reverted." );
+ strictEqual( jQuery, jQuery.noConflict(), "noConflict returned the jQuery object" );
+ strictEqual( window["jQuery"], $$, "Make sure jQuery wasn't touched." );
+ strictEqual( window["$"], original$, "Make sure $ was reverted." );
- jQuery = $ = $$;
+ jQuery = $ = $$;
- strictEqual( jQuery.noConflict(true), $$, "noConflict returned the jQuery object" );
- strictEqual( window["jQuery"], originaljQuery, "Make sure jQuery was reverted." );
- strictEqual( window["$"], original$, "Make sure $ was reverted." );
- ok( $$().pushStack([]), "Make sure that jQuery still works." );
+ strictEqual( jQuery.noConflict(true), $$, "noConflict returned the jQuery object" );
+ strictEqual( window["jQuery"], originaljQuery, "Make sure jQuery was reverted." );
+ strictEqual( window["$"], original$, "Make sure $ was reverted." );
+ ok( $$().pushStack([]), "Make sure that jQuery still works." );
- window["jQuery"] = jQuery = $$;
-});
+ window["jQuery"] = jQuery = $$;
+ });
+}
test("trim", function() {
expect(13);