Home page Forum Wiki Mail Jabber Devel NIX-FILES

AltLUG Git

Git-repositories of Altai Linux User Group

Apply the same exception handling for test and teardown try/catch as for setup
authorJörn Zaefferer <joern.zaefferer@gmail.com>
Thu, 27 Sep 2012 09:17:00 +0000 (11:17 +0200)
committerJörn Zaefferer <joern.zaefferer@gmail.com>
Thu, 27 Sep 2012 09:17:00 +0000 (11:17 +0200)
qunit/qunit.js

index fe16a83..c2555ae 100644 (file)
@@ -135,7 +135,7 @@ Test.prototype = {
                try {
                        this.callback.call( this.testEnvironment, QUnit.assert );
                } catch( e ) {
-                       QUnit.pushFailure( "Died on test #" + (this.assertions.length + 1) + " " + this.stack + ": " + e.message, extractStacktrace( e, 0 ) );
+                       QUnit.pushFailure( "Died on test #" + (this.assertions.length + 1) + " " + this.stack + ": " + ( e.message || e ), extractStacktrace( e, 0 ) );
                        // else next test will carry the responsibility
                        saveGlobal();
 
@@ -154,7 +154,7 @@ Test.prototype = {
                        try {
                                this.testEnvironment.teardown.call( this.testEnvironment );
                        } catch( e ) {
-                               QUnit.pushFailure( "Teardown failed on " + this.testName + ": " + e.message, extractStacktrace( e, 1 ) );
+                               QUnit.pushFailure( "Teardown failed on " + this.testName + ": " + ( e.message || e ), extractStacktrace( e, 1 ) );
                        }
                }
                checkPollution();

Hosting is provided AltSPAHow to use Git
Please direct any questions on jabber alex.wolf@jabber.ru

Valid HTML 4.0 Transitional Valid CSS!

Designer Alexander Wolf