aboutsummaryrefslogtreecommitdiffstats
path: root/test/data/testrunner.js
diff options
context:
space:
mode:
authorTimo Tijhof <krinklemail@gmail.com>2012-04-20 10:55:07 -0400
committerRick Waldron waldron.rick@gmail.com <waldron.rick@gmail.com>2012-04-20 10:55:07 -0400
commitdf2a22ee6149595b212ef7dca73535a853969f7b (patch)
treebe6c8a578414e93b748c0ec8ad3d37be41d1694b /test/data/testrunner.js
parent8ebb2f4793d2c464888b5f0dba97fb5c9d0c9541 (diff)
downloadjquery-df2a22ee6149595b212ef7dca73535a853969f7b.tar.gz
jquery-df2a22ee6149595b212ef7dca73535a853969f7b.zip
Enforce 20s timeout for all unit tests.
Diffstat (limited to 'test/data/testrunner.js')
-rw-r--r--test/data/testrunner.js24
1 files changed, 20 insertions, 4 deletions
diff --git a/test/data/testrunner.js b/test/data/testrunner.js
index bdfbcac9a..3afb1a650 100644
--- a/test/data/testrunner.js
+++ b/test/data/testrunner.js
@@ -1,7 +1,13 @@
-jQuery.noConflict(); // Allow the test to run with other libs or jQuery's.
+/**
+ * Allow the test suite to run with other libs or jQuery's.
+ */
+jQuery.noConflict();
-// jQuery-specific QUnit.reset
+/**
+ * QUnit hooks
+ */
(function() {
+ // jQuery-specific QUnit.reset
var reset = QUnit.reset,
ajaxSettings = jQuery.ajaxSettings;
@@ -12,10 +18,20 @@ jQuery.noConflict(); // Allow the test to run with other libs or jQuery's.
};
})();
-// load testswarm agent
+/**
+ * QUnit configuration
+ */
+// Max time for stop() and asyncTest() until it aborts test
+// and start()'s the next test.
+QUnit.config.testTimeout = 20 * 1000; // 20 seconds
+
+/**
+ * Load the TestSwarm listener if swarmURL is in the address.
+ */
(function() {
var url = window.location.search;
- url = decodeURIComponent( url.slice( url.indexOf("swarmURL=") + 9 ) );
+ url = decodeURIComponent( url.slice( url.indexOf("swarmURL=") + "swarmURL=".length ) );
+
if ( !url || url.indexOf("http") !== 0 ) {
return;
}