set suite status to failed when afterAll has failures
This commit is contained in:
@@ -43,7 +43,6 @@ getJasmineRequireObj().Suite = function() {
|
||||
|
||||
Suite.prototype.disable = function() {
|
||||
this.disabled = true;
|
||||
this.result.status = 'disabled';
|
||||
};
|
||||
|
||||
Suite.prototype.beforeEach = function(fn) {
|
||||
@@ -66,6 +65,18 @@ getJasmineRequireObj().Suite = function() {
|
||||
this.children.push(child);
|
||||
};
|
||||
|
||||
Suite.prototype.status = function() {
|
||||
if (this.disabled) {
|
||||
return 'disabled';
|
||||
}
|
||||
|
||||
if (this.result.failedExpectations.length > 0) {
|
||||
return 'failed';
|
||||
} else {
|
||||
return 'finished';
|
||||
}
|
||||
};
|
||||
|
||||
Suite.prototype.execute = function(onComplete) {
|
||||
var self = this;
|
||||
|
||||
@@ -96,7 +107,7 @@ getJasmineRequireObj().Suite = function() {
|
||||
});
|
||||
|
||||
function complete() {
|
||||
self.result.status = self.disabled ? 'disabled' : 'finished';
|
||||
self.result.status = self.status();
|
||||
self.resultCallback(self.result);
|
||||
|
||||
if (onComplete) {
|
||||
|
||||
@@ -55,7 +55,7 @@ jasmineRequire.HtmlReporter = function(j$) {
|
||||
};
|
||||
|
||||
this.suiteDone = function(result) {
|
||||
if (result.failedExpectations && result.failedExpectations.length > 0) {
|
||||
if (result.status == 'failed') {
|
||||
failedSuites.push(result);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user