Home page Forum Wiki Mail Jabber Devel NIX-FILES

AltLUG Git

Git-repositories of Altai Linux User Group

Save stack for each test, use that for failed expect() results, points at the line...
authorJörn Zaefferer <joern.zaefferer@gmail.com>
Fri, 4 May 2012 09:55:59 +0000 (11:55 +0200)
committerJörn Zaefferer <joern.zaefferer@gmail.com>
Fri, 4 May 2012 09:55:59 +0000 (11:55 +0200)
qunit/qunit.js

index 20ae9ff..df8652e 100644 (file)
@@ -153,9 +153,9 @@ Test.prototype = {
        finish: function() {
                config.current = this;
                if ( this.expected != null && this.expected != this.assertions.length ) {
-                       QUnit.pushFailure( "Expected " + this.expected + " assertions, but " + this.assertions.length + " were run" );
+                       QUnit.pushFailure( "Expected " + this.expected + " assertions, but " + this.assertions.length + " were run", this.stack );
                } else if ( this.expected == null && !this.assertions.length ) {
-                       QUnit.pushFailure( "Expected at least one assertion, but none were run - call expect(0) to accept zero assertions." );
+                       QUnit.pushFailure( "Expected at least one assertion, but none were run - call expect(0) to accept zero assertions.", this.stack );
                }
 
                var assertion, a, b, i, li, ol,
@@ -329,6 +329,7 @@ QUnit = {
                test = new Test( name, testName, expected, async, callback );
                test.module = config.currentModule;
                test.moduleTestEnvironment = config.currentModuleTestEnviroment;
+               test.stack = sourceFromStacktrace( 2 );
                test.queue();
        },
 

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