* Removed old Queue & Runner in favor of Suite using the new QueueRunner
* New reporter interface across all reporters * xdescribe & xit now store disabled specs * Rewrite of HtmlReporter to support new interface and be more performant
This commit is contained in:
committed by
Dan Hansen and Davis W. Frank
parent
05977203a6
commit
3fc79bac9e
@@ -1,80 +0,0 @@
|
||||
//TODO: runner is a special case of suite.
|
||||
/**
|
||||
* Runner
|
||||
*
|
||||
* @constructor
|
||||
* @param {jasmine.Env} env
|
||||
*/
|
||||
jasmine.Runner = function(env, isSuite) {
|
||||
var self = this;
|
||||
self.env = env;
|
||||
self.queue = new jasmine.Queue(env);
|
||||
self.before_ = [];
|
||||
self.after_ = [];
|
||||
self.suites_ = [];
|
||||
self.isSuite = isSuite || function() {};
|
||||
};
|
||||
|
||||
jasmine.Runner.prototype.execute = function() {
|
||||
var self = this;
|
||||
if (self.env.reporter.reportRunnerStarting) {
|
||||
self.env.reporter.reportRunnerStarting(this);
|
||||
}
|
||||
self.queue.start(function () {
|
||||
self.finishCallback();
|
||||
});
|
||||
};
|
||||
|
||||
jasmine.Runner.prototype.beforeEach = function(beforeEachFunction) {
|
||||
beforeEachFunction.typeName = 'beforeEach';
|
||||
this.before_.splice(0,0,beforeEachFunction);
|
||||
};
|
||||
|
||||
jasmine.Runner.prototype.afterEach = function(afterEachFunction) {
|
||||
afterEachFunction.typeName = 'afterEach';
|
||||
this.after_.splice(0,0,afterEachFunction);
|
||||
};
|
||||
|
||||
|
||||
jasmine.Runner.prototype.finishCallback = function() {
|
||||
this.env.reporter.reportRunnerResults(this);
|
||||
};
|
||||
|
||||
jasmine.Runner.prototype.addSuite = function(suite) {
|
||||
this.suites_.push(suite);
|
||||
this.queue.add(suite);
|
||||
};
|
||||
|
||||
|
||||
//TODO: runner should die a slow unhappy death.
|
||||
//Nobody should ever call instanceof.
|
||||
jasmine.Runner.prototype.add = function(block) {
|
||||
if (this.isSuite(block)) {
|
||||
this.addSuite(block);
|
||||
} else {
|
||||
this.queue.add(block);
|
||||
}
|
||||
};
|
||||
|
||||
jasmine.Runner.prototype.specs = function () {
|
||||
var suites = this.suites();
|
||||
var specs = [];
|
||||
for (var i = 0; i < suites.length; i++) {
|
||||
specs = specs.concat(suites[i].specs());
|
||||
}
|
||||
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;
|
||||
};
|
||||
Reference in New Issue
Block a user