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:
12
src/Suite.js
12
src/Suite.js
@@ -16,6 +16,8 @@ jasmine.Suite = function(env, description, specDefinitions, parentSuite) {
|
||||
self.env = env;
|
||||
self.before_ = [];
|
||||
self.after_ = [];
|
||||
self.children_ = [];
|
||||
self.suites_ = [];
|
||||
self.specs_ = [];
|
||||
};
|
||||
|
||||
@@ -50,7 +52,9 @@ jasmine.Suite.prototype.results = function() {
|
||||
};
|
||||
|
||||
jasmine.Suite.prototype.add = function(block) {
|
||||
this.children_.push(block);
|
||||
if (block instanceof jasmine.Suite) {
|
||||
this.suites_.push(block);
|
||||
this.env.currentRunner().addSuite(block);
|
||||
} else {
|
||||
this.specs_.push(block);
|
||||
@@ -62,6 +66,14 @@ jasmine.Suite.prototype.specs = function() {
|
||||
return this.specs_;
|
||||
};
|
||||
|
||||
jasmine.Suite.prototype.suites = function() {
|
||||
return this.suites_;
|
||||
};
|
||||
|
||||
jasmine.Suite.prototype.children = function() {
|
||||
return this.children_;
|
||||
};
|
||||
|
||||
jasmine.Suite.prototype.execute = function(onComplete) {
|
||||
var self = this;
|
||||
this.queue.start(function () {
|
||||
|
||||
Reference in New Issue
Block a user