[lifecycle hooks] Make afterAll hooks operate in the fashion as afterEach.

It was discovered that afterAll hooks run in the same order that you add them,
while afterEach hooks were running in reverse order.  This commit makes their
order consistent, and adds regression tests.

Relevant issue - https://github.com/jasmine/jasmine/issues/1311
This commit is contained in:
Gary Borton
2017-04-10 07:00:55 -07:00
parent ddcae84480
commit 50880fcff7
2 changed files with 22 additions and 2 deletions

View File

@@ -54,7 +54,7 @@ getJasmineRequireObj().Suite = function(j$) {
};
Suite.prototype.afterAll = function(fn) {
this.afterAllFns.push(fn);
this.afterAllFns.unshift(fn);
};
Suite.prototype.addChild = function(child) {