Report AfterAll failures as they occur

There didn't seem to be a valid reason to wait until the very end to
report these.
This commit is contained in:
Greg Cobb and Tim Jarratt
2014-08-27 14:01:28 -07:00
parent cc3678f033
commit 5b6edff3fd

View File

@@ -14,7 +14,6 @@ getJasmineRequireObj().Suite = function() {
this.afterFns = [];
this.beforeAllFns = [];
this.afterAllFns = [];
this.afterAllExpectationFailures = [];
this.queueRunner = attrs.queueRunner || function() {};
this.disabled = false;
@@ -95,7 +94,6 @@ getJasmineRequireObj().Suite = function() {
});
function complete() {
self.reportAfterAllExpectationFailures();
self.resultCallback(self.result);
if (onComplete) {
@@ -108,12 +106,6 @@ getJasmineRequireObj().Suite = function() {
}
};
Suite.prototype.reportAfterAllExpectationFailures = function() {
while (this.afterAllExpectationFailures.length) {
this.reportExpectationFailure(this.afterAllExpectationFailures.pop());
}
};
Suite.prototype.isExecutable = function() {
var foundActive = false;
for(var i = 0; i < this.children.length; i++) {
@@ -146,7 +138,7 @@ getJasmineRequireObj().Suite = function() {
Suite.prototype.addExpectationResult = function () {
if(isAfterAll(this.children) && isFailure(arguments)){
this.afterAllExpectationFailures.push(arguments[1].message);
this.reportExpectationFailure(arguments[1].message);
} else {
for (var i = 0; i < this.children.length; i++) {
var child = this.children[i];