Adds suiteResults method to JsApiReporter
- Behaves similarly to to specResults - Since suites were stored in an object instead of an array and the current interface exposes this object, we now must keep track of suites twice in the reporter. We cannot just construct the object lazily, because then the object will not update with new suite results like it does currently (see JsApiReporterSpec:148). [#79533268]
This commit is contained in:
@@ -30,7 +30,8 @@ getJasmineRequireObj().JsApiReporter = function() {
|
||||
return status;
|
||||
};
|
||||
|
||||
var suites = {};
|
||||
var suites = [],
|
||||
suites_hash = {};
|
||||
|
||||
this.suiteStarted = function(result) {
|
||||
storeSuite(result);
|
||||
@@ -40,16 +41,20 @@ getJasmineRequireObj().JsApiReporter = function() {
|
||||
storeSuite(result);
|
||||
};
|
||||
|
||||
this.suiteResults = function(index, length) {
|
||||
return suites.slice(index, index + length);
|
||||
};
|
||||
|
||||
function storeSuite(result) {
|
||||
suites[result.id] = result;
|
||||
suites.push(result);
|
||||
suites_hash[result.id] = result;
|
||||
}
|
||||
|
||||
this.suites = function() {
|
||||
return suites;
|
||||
return suites_hash;
|
||||
};
|
||||
|
||||
var specs = [];
|
||||
this.specStarted = function(result) { };
|
||||
|
||||
this.specDone = function(result) {
|
||||
specs.push(result);
|
||||
|
||||
Reference in New Issue
Block a user