diff --git a/ext/jasmine-webkit-specrunner/specrunner.cpp b/ext/jasmine-webkit-specrunner/specrunner.cpp index 9f0ea4b..621c4cf 100644 --- a/ext/jasmine-webkit-specrunner/specrunner.cpp +++ b/ext/jasmine-webkit-specrunner/specrunner.cpp @@ -234,8 +234,9 @@ void HeadlessSpecRunner::finishSuite(const QString &duration, const QString &tot std::cout << "PASS: "; } - std::cout << qPrintable(total) << " tests, " << qPrintable(failed) << " failures, " << qPrintable(duration) << " secs." << std::endl; + std::cout << qPrintable(total) << " tests, " << qPrintable(failed) << " failures, " << qPrintable(duration) << " secs."; clear(); + std::cout << std::endl; isFinished = true; } diff --git a/jasmine/jasmine.headless-reporter.coffee b/jasmine/jasmine.headless-reporter.coffee index f03b71c..0b31d03 100644 --- a/jasmine/jasmine.headless-reporter.coffee +++ b/jasmine/jasmine.headless-reporter.coffee @@ -22,9 +22,10 @@ class jasmine.HeadlessReporter do (result) => result.print() - JHW.finishSuite(@totalDuration, @length, @failedCount) + JHW.finishSuite(@totalDuration / 1000.0, @length, @failedCount) reportRunnerStarting: (runner) -> reportSpecResults: (spec) -> + @totalDuration += (new Date() - spec.startTime) if spec.results().passed() JHW.specPassed() else @@ -37,9 +38,6 @@ class jasmine.HeadlessReporter failureResult.results.push(result.message) @results.push(failureResult) reportSpecStarting: (spec) -> - # something here + spec.startTime = new Date() reportSuiteResults: (suite) -> - suite.startTime ?= new Date() - @totalDuration += (new Date() - suite.startTime) / 1000.0; - @length += suite.specs().length diff --git a/jasmine/jasmine.headless-reporter.js b/jasmine/jasmine.headless-reporter.js index 60bf70d..f803f6d 100644 --- a/jasmine/jasmine.headless-reporter.js +++ b/jasmine/jasmine.headless-reporter.js @@ -41,11 +41,12 @@ result = _ref[_i]; _fn(result); } - return JHW.finishSuite(this.totalDuration, this.length, this.failedCount); + return JHW.finishSuite(this.totalDuration / 1000.0, this.length, this.failedCount); }; HeadlessReporter.prototype.reportRunnerStarting = function(runner) {}; HeadlessReporter.prototype.reportSpecResults = function(spec) { var failureResult, result, _fn, _i, _len, _ref; + this.totalDuration += new Date() - spec.startTime; if (spec.results().passed()) { return JHW.specPassed(); } else { @@ -65,15 +66,10 @@ return this.results.push(failureResult); } }; - HeadlessReporter.prototype.reportSpecStarting = function(spec) {}; + HeadlessReporter.prototype.reportSpecStarting = function(spec) { + return spec.startTime = new Date(); + }; HeadlessReporter.prototype.reportSuiteResults = function(suite) { - var _ref; - if ((_ref = suite.startTime) != null) { - _ref; - } else { - suite.startTime = new Date(); - }; - this.totalDuration += (new Date() - suite.startTime) / 1000.0; return this.length += suite.specs().length; }; return HeadlessReporter;