Home page Forum Wiki Mail Jabber Devel NIX-FILES

AltLUG Git

Git-repositories of Altai Linux User Group

(issue #260) config.current should be reset at the right time.
authorTimo Tijhof <krinklemail@gmail.com>
Tue, 12 Jun 2012 14:40:34 +0000 (16:40 +0200)
committerTimo Tijhof <krinklemail@gmail.com>
Tue, 12 Jun 2012 16:02:57 +0000 (18:02 +0200)
* Issues:
 - fixes #260

* Misc:
 - Added throw to pushFailure, like the other functions that
   add to config.current.assertions[] already do (ok(), push(), ..).

qunit/qunit.js

index 2a03c83..c796e12 100644 (file)
@@ -255,6 +255,8 @@ Test.prototype = {
                        total: this.assertions.length
                });
 
+               config.current = undefined;
+
                QUnit.reset();
        },
 
@@ -768,6 +770,10 @@ extend( QUnit, {
        },
 
        pushFailure: function( message, source ) {
+               if ( !config.current ) {
+                       throw new Error( "pushFailure() assertion outside test context, was " + sourceFromStacktrace(2) );
+               }
+
                var output,
                        details = {
                                result: false,

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