Added a fix for .noConflict(true) not reverting properly. Also added unit tests for noConflict.
This commit is contained in:
parent
5736e8d90d
commit
1ac9d6fbee
3 changed files with 26 additions and 4 deletions
|
@ -38,6 +38,27 @@ test("$()", function() {
|
|||
equals( div.length, 4, "Correct number of elements generated for div hr code b" );
|
||||
});
|
||||
|
||||
test("noConflict", function() {
|
||||
expect(6);
|
||||
|
||||
var old = jQuery;
|
||||
var newjQuery = jQuery.noConflict();
|
||||
|
||||
ok( newjQuery == old, "noConflict returned the jQuery object" );
|
||||
ok( jQuery == old, "Make sure jQuery wasn't touched." );
|
||||
ok( $ == "$", "Make sure $ was reverted." );
|
||||
|
||||
jQuery = $ = old;
|
||||
|
||||
newjQuery = jQuery.noConflict(true);
|
||||
|
||||
ok( newjQuery == old, "noConflict returned the jQuery object" );
|
||||
ok( jQuery == "jQuery", "Make sure jQuery was reverted." );
|
||||
ok( $ == "$", "Make sure $ was reverted." );
|
||||
|
||||
jQuery = $ = old;
|
||||
});
|
||||
|
||||
test("isFunction", function() {
|
||||
expect(21);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue