]> source.dussan.org Git - jquery.git/commitdiff
Tests: Improve jsonp tests
authorOleg Gaidarenko <markelog@gmail.com>
Tue, 18 Feb 2014 17:50:42 +0000 (21:50 +0400)
committerOleg Gaidarenko <markelog@gmail.com>
Tue, 15 Apr 2014 13:45:59 +0000 (17:45 +0400)
Since global variable for callback always would be equal to undefined value
it better to check for boolean instead

test/unit/ajax.js

index c099e12b1c8b5e6116498893a9c9a6c315f9d4d8..fcdfcb0f5f362e452a7d1cc7b9be8b63839b273b 100644 (file)
@@ -733,7 +733,7 @@ module( "ajax", {
                                jsonpCallback: "functionToCleanUp",
                                success: function( data ) {
                                        ok( data["data"], "JSON results returned (GET, custom callback name to be cleaned up)" );
-                                       strictEqual( window["functionToCleanUp"], undefined, "Callback was removed (GET, custom callback name to be cleaned up)" );
+                                       strictEqual( window["functionToCleanUp"], true, "Callback was removed (GET, custom callback name to be cleaned up)" );
                                        var xhr;
                                        jQuery.ajax({
                                                url: "data/jsonp.php",
@@ -747,7 +747,7 @@ module( "ajax", {
                                        });
                                        xhr.fail(function() {
                                                ok( true, "Ajax error JSON (GET, custom callback name to be cleaned up)" );
-                                               strictEqual( window["functionToCleanUp"], undefined, "Callback was removed after early abort (GET, custom callback name to be cleaned up)" );
+                                               strictEqual( window["functionToCleanUp"], true, "Callback was removed after early abort (GET, custom callback name to be cleaned up)" );
                                        });
                                }
                        }, {