test runner: when errors are thrown in a test, the message is successfully show on...
[jquery.git] / test / data / testrunner.js
index c1114a5..d4fdcf5 100644 (file)
@@ -81,6 +81,7 @@ function runTest() {
        _config.blocking = false;
        var time = new Date();
        _config.fixture = document.getElementById('main').innerHTML;
+       _config.ajaxSettings = $.ajaxSettings;
        synchronize(function() {
                time = new Date() - time;
                $("<div>").html(['<p class="result">Tests completed in ',
@@ -109,7 +110,7 @@ function test(name, callback, nowait) {
                                console.error(e);
                                console.warn(callback.toString());
                        }
-                       _config.Test.push( [ false, "Died on test #" + (_config.Test.length+1) + ": " + e ] );
+                       _config.Test.push( [ false, "Died on test #" + (_config.Test.length+1) + ": " + e.message ] );
                }
        });
        synchronize(function() {
@@ -184,6 +185,8 @@ function expect(asserts) {
  */
 function reset() {
        $("#main").html( _config.fixture );
+       $.event.global = {};
+       $.ajaxSettings = $.extend({}, _config.ajaxSettings);
 }
 
 /**