Add a "run all" link.

This commit is contained in:
Christian Williams & Kim Eric Mittler 2009-08-17 13:37:33 -07:00
parent 027b28ecb0
commit 1c9607ec33
2 changed files with 5 additions and 2 deletions

View File

@ -30,7 +30,9 @@ jasmine.TrivialReporter.prototype.createDom = function(type, attrs, childrenVarA
jasmine.TrivialReporter.prototype.reportRunnerStarting = function(runner) {
var suites = runner.getAllSuites();
this.runnerDiv = this.createDom('div', { className: 'runner running' }, "Running...");
this.runnerDiv = this.createDom('div', { className: 'runner running' },
this.createDom('a', { className: 'runSpec', href: '?' }, "run all"),
this.runnerMessageSpan = this.createDom('span', {}, "Running..."));
this.document.body.appendChild(this.runnerDiv);
for (var i = 0; i < suites.length; i++) {
@ -54,7 +56,7 @@ jasmine.TrivialReporter.prototype.reportRunnerResults = function(runner) {
var className = (results.failedCount > 0) ? "runner failed" : "runner passed";
this.runnerDiv.setAttribute("class", className);
var message = results.failedCount + " failure" + ((results.failedCount == 1) ? "" : "s");
this.runnerDiv.replaceChild(this.document.createTextNode(message), this.runnerDiv.firstChild);
this.runnerMessageSpan.replaceChild(this.document.createTextNode(message), this.runnerDiv.firstChild);
};
jasmine.TrivialReporter.prototype.reportSuiteResults = function(suite) {

View File

@ -27,6 +27,7 @@ p {
border: 1px outset gray;
margin: 5px;
padding-left: 1em;
padding-right: 1em;
}
.runner.running {