JsApiReporter reports nested suites correctly.

Runner#topLevelSuites() returns only top level suites.
Suite#specs(), Suite#suites(), and Suite#children() return immediate children.
This commit is contained in:
Lee Byrd & Christian Williams
2010-06-22 10:18:22 -07:00
parent c187adc096
commit e30b99e7b3
8 changed files with 191 additions and 100 deletions

View File

@@ -58,11 +58,20 @@ jasmine.Runner.prototype.specs = function () {
return specs;
};
jasmine.Runner.prototype.suites = function() {
return this.suites_;
};
jasmine.Runner.prototype.topLevelSuites = function() {
var topLevelSuites = [];
for (var i = 0; i < this.suites_.length; i++) {
if (!this.suites_[i].parentSuite) {
topLevelSuites.push(this.suites_[i]);
}
}
return topLevelSuites;
};
jasmine.Runner.prototype.results = function() {
return this.queue.results();
};