From: Oleg Gaidarenko Date: Tue, 18 Feb 2014 17:50:42 +0000 (+0400) Subject: Tests: Improve jsonp tests X-Git-Tag: 1.11.1-rc1~15 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=1c04178939b2fcbb8ff1273d3045d2fa80998c80;p=jquery.git Tests: Improve jsonp tests Since global variable for callback always would be equal to undefined value it better to check for boolean instead --- diff --git a/test/data/testrunner.js b/test/data/testrunner.js index 1bebb1363..b97f3453b 100644 --- a/test/data/testrunner.js +++ b/test/data/testrunner.js @@ -196,7 +196,7 @@ window.Globals = (function() { return { register: function( name ) { globals[ name ] = true; - supportjQuery.globalEval( "var " + name + " = undefined;" ); + supportjQuery.globalEval( "var " + name + " = true;" ); }, cleanup: function() { var name, diff --git a/test/unit/ajax.js b/test/unit/ajax.js index 2f4bc04e5..3a2ac11c4 100644 --- a/test/unit/ajax.js +++ b/test/unit/ajax.js @@ -728,7 +728,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", @@ -742,7 +742,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)" ); }); } }, {