Home page Forum Wiki Mail Jabber Devel NIX-FILES

AltLUG Git

Git-repositories of Altai Linux User Group

In autorun mode, moduleDone is called without matching moduleStart. Fix issue #184
authorNiall Smart <niall@pobox.com>
Tue, 20 Dec 2011 07:13:27 +0000 (23:13 -0800)
committerJörn Zaefferer <joern.zaefferer@gmail.com>
Wed, 15 Feb 2012 14:15:35 +0000 (15:15 +0100)
qunit/qunit.js
test/logs.js

index 387ea79..842c932 100644 (file)
@@ -65,6 +65,10 @@ Test.prototype = {
                        runLoggingCallbacks( 'moduleStart', QUnit, {
                                name: this.module
                        } );
                        runLoggingCallbacks( 'moduleStart', QUnit, {
                                name: this.module
                        } );
+               } else if (config.autorun) {
+                       runLoggingCallbacks( 'moduleStart', QUnit, {
+                               name: this.module
+                       } );
                }
 
                config.current = this;
                }
 
                config.current = this;
index fbbb20b..06c44a0 100644 (file)
@@ -151,3 +151,30 @@ test("test2", 8, function() {
 
        equal(log, 39);
 });
 
        equal(log, 39);
 });
+
+var testAutorun = true;
+
+QUnit.done(function() {
+
+       if (!testAutorun) {
+               return;
+       }
+
+       testAutorun = false;
+
+       module("autorun");
+
+       test("reset", function() {});
+
+       moduleStart = moduleDone = 0;
+
+       test("first", function(){
+               equal(moduleStart, 1, "test started");
+               equal(moduleDone, 0, "test in progress");
+       });
+
+       test("second", function(){
+               equal(moduleStart, 2, "test started");
+               equal(moduleDone, 1, "test in progress");
+       });
+});

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