Add execution time elapsed to JsApiReporter
Since this information is desired in ConsoleReporter, HtmlReporter, and now JsApiReporter, the executionTime is passed through in jasmineDone from Env instead of making each reporter compute it. Fixes #30, [Finishes #45659879]
This commit is contained in:
@@ -3,8 +3,6 @@ getJasmineRequireObj().ConsoleReporter = function() {
|
||||
var print = options.print,
|
||||
showColors = options.showColors || false,
|
||||
onComplete = options.onComplete || function() {},
|
||||
now = options.now || function() { return new Date().getTime();},
|
||||
startTime = 0,
|
||||
specCount,
|
||||
failureCount,
|
||||
failedSpecs = [],
|
||||
@@ -17,7 +15,6 @@ getJasmineRequireObj().ConsoleReporter = function() {
|
||||
};
|
||||
|
||||
this.jasmineStarted = function() {
|
||||
startTime = now();
|
||||
specCount = 0;
|
||||
failureCount = 0;
|
||||
pendingCount = 0;
|
||||
@@ -25,9 +22,7 @@ getJasmineRequireObj().ConsoleReporter = function() {
|
||||
printNewline();
|
||||
};
|
||||
|
||||
this.jasmineDone = function() {
|
||||
var elapsed = now() - startTime;
|
||||
|
||||
this.jasmineDone = function(options) {
|
||||
printNewline();
|
||||
for (var i = 0; i < failedSpecs.length; i++) {
|
||||
specFailureDetails(failedSpecs[i]);
|
||||
@@ -44,7 +39,7 @@ getJasmineRequireObj().ConsoleReporter = function() {
|
||||
print(specCounts);
|
||||
|
||||
printNewline();
|
||||
var seconds = elapsed / 1000;
|
||||
var seconds = options.executionTime / 1000;
|
||||
print("Finished in " + seconds + " " + plural("second", seconds));
|
||||
|
||||
printNewline();
|
||||
|
||||
Reference in New Issue
Block a user