Skip to content

Commit

Permalink
Modify "Running..." to display test name. Fixes qunitjs#220
Browse files Browse the repository at this point in the history
  • Loading branch information
rwaldron authored and jzaefferer committed Mar 27, 2012
1 parent 6ec4cc2 commit d6908bb
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 0 deletions.
3 changes: 3 additions & 0 deletions addons/themes/nv.css
Expand Up @@ -193,6 +193,9 @@
padding: 0.5em 0.5em 0.5em 2.5em; padding: 0.5em 0.5em 0.5em 2.5em;
color: #333; color: #333;
} }
#qunit-testresult .module-name {
font-weight: bold;
}


/** Fixture */ /** Fixture */


Expand Down
3 changes: 3 additions & 0 deletions qunit/qunit.css
Expand Up @@ -220,6 +220,9 @@


border-bottom: 1px solid white; border-bottom: 1px solid white;
} }
#qunit-testresult .module-name {
font-weight: bold;
}


/** Fixture */ /** Fixture */


Expand Down
7 changes: 7 additions & 0 deletions qunit/qunit.js
Expand Up @@ -100,6 +100,13 @@ Test.prototype = {
}, },
run: function() { run: function() {
config.current = this; config.current = this;

var running = id("qunit-testresult");

if ( running ) {
running.innerHTML = "Running: <br/>" + this.name;
}

if ( this.async ) { if ( this.async ) {
QUnit.stop(); QUnit.stop();
} }
Expand Down
9 changes: 9 additions & 0 deletions test/test.js
Expand Up @@ -329,6 +329,15 @@ test("basics", function() {
equal( document.getElementById("qunit-fixture").innerHTML, "test markup", "automatically reset" ); equal( document.getElementById("qunit-fixture").innerHTML, "test markup", "automatically reset" );
}); });


test("running test name displayed", function() {
expect(2);

var displaying = document.getElementById("qunit-testresult");

ok( /running test name displayed/.test(displaying.innerHTML), "Expect test name to be found in displayed text" );
ok( /fixture/.test(displaying.innerHTML), "Expect module name to be found in displayed text" );
});

} }


module("custom assertions"); module("custom assertions");
Expand Down

0 comments on commit d6908bb

Please sign in to comment.