Multiple befores/afters in a single describe should be executed in order (as declared for befores, in reverse for afters).

This commit is contained in:
Christian Williams
2010-06-04 14:41:16 -04:00
parent ed49104fad
commit a2041e90a6
3 changed files with 62 additions and 5 deletions

View File

@@ -25,12 +25,12 @@ jasmine.Runner.prototype.execute = function() {
jasmine.Runner.prototype.beforeEach = function(beforeEachFunction) {
beforeEachFunction.typeName = 'beforeEach';
this.before_.push(beforeEachFunction);
this.before_.unshift(beforeEachFunction);
};
jasmine.Runner.prototype.afterEach = function(afterEachFunction) {
afterEachFunction.typeName = 'afterEach';
this.after_.push(afterEachFunction);
this.after_.unshift(afterEachFunction);
};

View File

@@ -37,12 +37,12 @@ jasmine.Suite.prototype.finish = function(onComplete) {
jasmine.Suite.prototype.beforeEach = function(beforeEachFunction) {
beforeEachFunction.typeName = 'beforeEach';
this.before_.push(beforeEachFunction);
this.before_.unshift(beforeEachFunction);
};
jasmine.Suite.prototype.afterEach = function(afterEachFunction) {
afterEachFunction.typeName = 'afterEach';
this.after_.push(afterEachFunction);
this.after_.unshift(afterEachFunction);
};
jasmine.Suite.prototype.results = function() {