Add time reporting.

This commit is contained in:
Christian Williams & Kim Eric Mittler 2009-09-02 15:32:57 -07:00
parent 8ba804e299
commit bed9e118b6

View File

@ -47,6 +47,8 @@ jasmine.TrivialReporter.prototype.reportRunnerStarting = function(runner) {
}
parentDiv.appendChild(suiteDiv);
}
this.startedAt = new Date();
};
jasmine.TrivialReporter.prototype.reportRunnerResults = function(runner) {
@ -54,6 +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");
message += " in " + ((new Date().getTime() - this.startedAt.getTime()) / 1000) + "s";
this.runnerMessageSpan.replaceChild(this.document.createTextNode(message), this.runnerMessageSpan.firstChild);
};