Commit f35ba5e6 authored by Mike Sherov's avatar Mike Sherov Committed by Dave Methvin

Fix #10691. Remove all instances of equals() and same(), as these are deprecated in QUnit.

parent 83c72eaa
......@@ -41,7 +41,7 @@ function t(a,b,c) {
s += (s && ",") + '"' + f[i].id + '"';
}
same(f, q.apply(q,c), a + " (" + b + ")");
deepEqual(f, q.apply(q,c), a + " (" + b + ")");
}
var fireNative;
......@@ -102,19 +102,19 @@ function url(value) {
// Because QUnit doesn't have a mechanism for retrieving the number of expected assertions for a test,
// if we unconditionally assert any of these, the test will fail with too many assertions :|
if ( cacheLength !== oldCacheLength ) {
equals( cacheLength, oldCacheLength, "No unit tests leak memory in jQuery.cache" );
equal( cacheLength, oldCacheLength, "No unit tests leak memory in jQuery.cache" );
oldCacheLength = cacheLength;
}
if ( fragmentsLength !== oldFragmentsLength ) {
equals( fragmentsLength, oldFragmentsLength, "No unit tests leak memory in jQuery.fragments" );
equal( fragmentsLength, oldFragmentsLength, "No unit tests leak memory in jQuery.fragments" );
oldFragmentsLength = fragmentsLength;
}
if ( jQuery.timers.length !== oldTimersLength ) {
equals( jQuery.timers.length, oldTimersLength, "No timers are still running" );
equal( jQuery.timers.length, oldTimersLength, "No timers are still running" );
oldTimersLength = jQuery.timers.length;
}
if ( jQuery.active !== oldActive ) {
equals( jQuery.active, 0, "No AJAX requests are still active" );
equal( jQuery.active, 0, "No AJAX requests are still active" );
oldActive = jQuery.active;
}
}
......
......@@ -25,9 +25,3 @@ jQuery.noConflict(); // Allow the test to run with other libs or jQuery's.
document.write("<scr" + "ipt src='http://swarm.jquery.org/js/inject.js?" + (new Date).getTime() + "'></scr" + "ipt>");
})();
// QUnit Aliases
(function() {
window.equals = window.equal;
window.same = window.deepEqual;
})();
This diff is collapsed.
This diff is collapsed.
......@@ -69,7 +69,7 @@ jQuery.each( tests, function( flags, resultString ) {
output = "X";
cblist = jQuery.Callbacks( flags );
cblist.add(function() {
equals( this, window, "Basic binding and firing (context)" );
equal( this, window, "Basic binding and firing (context)" );
output += Array.prototype.join.call( arguments, "" );
});
cblist.fireWith( window, [ "A", "B" ] );
......@@ -79,7 +79,7 @@ jQuery.each( tests, function( flags, resultString ) {
output = "";
cblist = jQuery.Callbacks( flags );
cblist.add(function() {
equals( this, window, "fireWith with no arguments (context is window)" );
equal( this, window, "fireWith with no arguments (context is window)" );
strictEqual( arguments.length, 0, "fireWith with no arguments (no arguments)" );
});
cblist.fireWith();
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -351,18 +351,18 @@ test("jQuery.when - joined", function() {
var promise = jQuery.when( defer1, defer2 ).done(function( a, b ) {
if ( shouldResolve ) {
same( [ a, b ], expected, code + " => resolve" );
deepEqual( [ a, b ], expected, code + " => resolve" );
} else {
ok( false , code + " => resolve" );
}
}).fail(function( a, b ) {
if ( shouldError ) {
same( [ a, b ], expected, code + " => reject" );
deepEqual( [ a, b ], expected, code + " => reject" );
} else {
ok( false , code + " => reject" );
}
}).progress(function progress( a, b ) {
same( [ a, b ], expectedNotify, code + " => progress" );
deepEqual( [ a, b ], expectedNotify, code + " => progress" );
});
} );
} );
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -10,41 +10,41 @@ test("queue() with other types",function() {
defer;
$div.promise("foo").done(function() {
equals( counter, 0, "Deferred for collection with no queue is automatically resolved" );
equal( counter, 0, "Deferred for collection with no queue is automatically resolved" );
});
$div
.queue("foo",function(){
equals( ++counter, 1, "Dequeuing" );
equal( ++counter, 1, "Dequeuing" );
jQuery.dequeue(this,"foo");
})
.queue("foo",function(){
equals( ++counter, 2, "Dequeuing" );
equal( ++counter, 2, "Dequeuing" );
jQuery(this).dequeue("foo");
})
.queue("foo",function(){
equals( ++counter, 3, "Dequeuing" );
equal( ++counter, 3, "Dequeuing" );
})
.queue("foo",function(){
equals( ++counter, 4, "Dequeuing" );
equal( ++counter, 4, "Dequeuing" );
});
defer = $div.promise("foo").done(function() {
equals( counter, 4, "Testing previous call to dequeue in deferred" );
equal( counter, 4, "Testing previous call to dequeue in deferred" );
start();
});
equals( $div.queue("foo").length, 4, "Testing queue length" );
equal( $div.queue("foo").length, 4, "Testing queue length" );
$div.dequeue("foo");
equals( counter, 3, "Testing previous call to dequeue" );
equals( $div.queue("foo").length, 1, "Testing queue length" );
equal( counter, 3, "Testing previous call to dequeue" );
equal( $div.queue("foo").length, 1, "Testing queue length" );
$div.dequeue("foo");
equals( counter, 4, "Testing previous call to dequeue" );
equals( $div.queue("foo").length, 0, "Testing queue length" );
equal( counter, 4, "Testing previous call to dequeue" );
equal( $div.queue("foo").length, 0, "Testing queue length" );
});
test("queue(name) passes in the next item in the queue as a parameter", function() {
......@@ -54,13 +54,13 @@ test("queue(name) passes in the next item in the queue as a parameter", function
var counter = 0;
div.queue("foo", function(next) {
equals(++counter, 1, "Dequeueing");
equal(++counter, 1, "Dequeueing");
next();
}).queue("foo", function(next) {
equals(++counter, 2, "Next was called");
equal(++counter, 2, "Next was called");
next();
}).queue("bar", function() {
equals(++counter, 3, "Other queues are not triggered by next()")
equal(++counter, 3, "Other queues are not triggered by next()")
});
div.dequeue("foo");
......@@ -74,18 +74,18 @@ test("queue() passes in the next item in the queue as a parameter to fx queues",
var counter = 0;
div.queue(function(next) {
equals(++counter, 1, "Dequeueing");
equal(++counter, 1, "Dequeueing");
var self = this;
setTimeout(function() { next() }, 500);
}).queue(function(next) {
equals(++counter, 2, "Next was called");
equal(++counter, 2, "Next was called");
next();
}).queue("bar", function() {
equals(++counter, 3, "Other queues are not triggered by next()")
equal(++counter, 3, "Other queues are not triggered by next()")
});
jQuery.when( div.promise("fx"), div ).done(function() {
equals(counter, 2, "Deferreds resolved");
equal(counter, 2, "Deferreds resolved");
start();
});
});
......@@ -110,7 +110,7 @@ test("callbacks keep their place in the queue", function() {
});
div.promise("fx").done(function() {
equals(counter, 4, "Deferreds resolved");
equal(counter, 4, "Deferreds resolved");
start();
});
});
......@@ -127,7 +127,7 @@ test("delay()", function() {
start();
});
equals( run, 0, "The delay delayed the next function from running." );
equal( run, 0, "The delay delayed the next function from running." );
});
test("delay() can be stopped", function() {
......@@ -191,7 +191,7 @@ test("clearQueue(name) clears the queue", function() {
div.dequeue("foo");
equals(counter, 1, "the queue was cleared");
equal(counter, 1, "the queue was cleared");
});
test("clearQueue() clears the fx queue", function() {
......@@ -208,7 +208,7 @@ test("clearQueue() clears the fx queue", function() {
counter++;
});
equals(counter, 1, "the queue was cleared");
equal(counter, 1, "the queue was cleared");
div.removeData();
});
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment