aboutsummaryrefslogtreecommitdiffstats
path: root/test/data/testrunner.js
diff options
context:
space:
mode:
authorjaubourg <j@ubourg.net>2012-11-26 03:31:19 +0100
committerjaubourg <j@ubourg.net>2012-11-26 03:31:19 +0100
commitd31cef38f2aa76ca71ed18aa97d035a84c7e33e6 (patch)
treea0d2624f32810ed3f317c99489bc10de628f5b5e /test/data/testrunner.js
parent53a06660d82d03dfff52a03a91f7d4408b6e6e47 (diff)
downloadjquery-d31cef38f2aa76ca71ed18aa97d035a84c7e33e6.tar.gz
jquery-d31cef38f2aa76ca71ed18aa97d035a84c7e33e6.zip
Total revamping of the ajax unit tests
Diffstat (limited to 'test/data/testrunner.js')
-rw-r--r--test/data/testrunner.js30
1 files changed, 29 insertions, 1 deletions
diff --git a/test/data/testrunner.js b/test/data/testrunner.js
index 6304d5142..6041e4bd4 100644
--- a/test/data/testrunner.js
+++ b/test/data/testrunner.js
@@ -134,6 +134,31 @@ function testSubproject( label, url, risTests ) {
}
}
+// Register globals for cleanup and the cleanup code itself
+// Explanation at http://perfectionkills.com/understanding-delete/#ie_bugs
+var Globals = (function() {
+ var globals = {};
+ return QUnit.config.noglobals ? {
+ register: function( name ) {
+ globals[ name ] = true;
+ jQuery.globalEval( "var " + name );
+ },
+ cleanup: function() {
+ var name,
+ current = globals;
+ globals = {};
+ for ( name in current ) {
+ jQuery.globalEval( "try { " +
+ "delete " + ( jQuery.support.deleteExpando ? "window['" + name + "']" : name ) +
+ "; } catch( x ) {}" );
+ }
+ }
+ } : {
+ register: jQuery.noop,
+ cleanup: jQuery.noop
+ };
+})();
+
/**
* QUnit hooks
*/
@@ -292,10 +317,13 @@ function testSubproject( label, url, risTests ) {
// Reset internal jQuery state
jQuery.event.global = {};
if ( ajaxSettings ) {
- jQuery.ajaxSettings = jQuery.extend( {}, ajaxSettings );
+ jQuery.ajaxSettings = jQuery.extend( true, {}, ajaxSettings );
} else {
delete jQuery.ajaxSettings;
}
+
+ // Cleanup globals
+ Globals.cleanup();
// Let QUnit reset the fixture
reset.apply( this, arguments );