Calculate total suite run time inside the env and report in jasmineDone
This commit is contained in:
@@ -640,6 +640,9 @@ getJasmineRequireObj().Env = function(j$) {
|
||||
);
|
||||
}
|
||||
|
||||
var jasmineTimer = new j$.Timer();
|
||||
jasmineTimer.start();
|
||||
|
||||
/**
|
||||
* Information passed to the {@link Reporter#jasmineStarted} event.
|
||||
* @typedef JasmineStartedInfo
|
||||
@@ -675,6 +678,7 @@ getJasmineRequireObj().Env = function(j$) {
|
||||
* Information passed to the {@link Reporter#jasmineDone} event.
|
||||
* @typedef JasmineDoneInfo
|
||||
* @property {OverallStatus} overallStatus - The overall result of the suite: 'passed', 'failed', or 'incomplete'.
|
||||
* @property {Int} totalTime - The total time (in ms) that it took to execute the suite
|
||||
* @property {IncompleteReason} incompleteReason - Explanation of why the suite was incomplete.
|
||||
* @property {Order} order - Information about the ordering (random or not) of this execution of the suite.
|
||||
* @property {Expectation[]} failedExpectations - List of expectations that failed in an {@link afterAll} at the global level.
|
||||
@@ -683,6 +687,7 @@ getJasmineRequireObj().Env = function(j$) {
|
||||
reporter.jasmineDone(
|
||||
{
|
||||
overallStatus: overallStatus,
|
||||
totalTime: jasmineTimer.elapsed(),
|
||||
incompleteReason: incompleteReason,
|
||||
order: order,
|
||||
failedExpectations: topSuite.result.failedExpectations,
|
||||
|
||||
@@ -52,7 +52,6 @@ jasmineRequire.HtmlReporter = function(j$) {
|
||||
addToExistingQueryString =
|
||||
options.addToExistingQueryString || defaultQueryString,
|
||||
filterSpecs = options.filterSpecs,
|
||||
timer = options.timer || j$.noopTimer,
|
||||
htmlReporterMain,
|
||||
symbols,
|
||||
deprecationWarnings = [];
|
||||
@@ -86,7 +85,6 @@ jasmineRequire.HtmlReporter = function(j$) {
|
||||
var totalSpecsDefined;
|
||||
this.jasmineStarted = function(options) {
|
||||
totalSpecsDefined = options.totalSpecsDefined || 0;
|
||||
timer.start();
|
||||
};
|
||||
|
||||
var summary = createDom('div', { className: 'jasmine-summary' });
|
||||
@@ -165,7 +163,7 @@ jasmineRequire.HtmlReporter = function(j$) {
|
||||
createDom(
|
||||
'span',
|
||||
{ className: 'jasmine-duration' },
|
||||
'finished in ' + timer.elapsed() / 1000 + 's'
|
||||
'finished in ' + doneResult.totalTime / 1000 + 's'
|
||||
)
|
||||
);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user