aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOleg Gaidarenko <markelog@gmail.com>2014-02-18 21:50:42 +0400
committerOleg Gaidarenko <markelog@gmail.com>2014-04-15 17:46:25 +0400
commit1c04178939b2fcbb8ff1273d3045d2fa80998c80 (patch)
treee8a4df65cc7f5e1ee1c5da8d8b18627f316b17cd
parent9cdaa75b8650e6077540915b9a78392c9c7b5d68 (diff)
downloadjquery-1c04178939b2fcbb8ff1273d3045d2fa80998c80.tar.gz
jquery-1c04178939b2fcbb8ff1273d3045d2fa80998c80.zip
Tests: Improve jsonp tests
Since global variable for callback always would be equal to undefined value it better to check for boolean instead
-rw-r--r--test/data/testrunner.js2
-rw-r--r--test/unit/ajax.js4
2 files changed, 3 insertions, 3 deletions
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)" );
});
}
}, {