Suites report errors in afterAlls in the suiteDone event

- remove `afterAllEvent` from reporters
This commit is contained in:
slackersoft
2014-09-03 18:52:13 -07:00
parent 6b857d11ce
commit 9402d59859
14 changed files with 306 additions and 203 deletions

View File

@@ -47,7 +47,7 @@ jasmineRequire.HtmlReporter = function(j$) {
pendingSpecCount = 0,
htmlReporterMain,
symbols,
exceptionList = [];
failedSuites = [];
this.initialize = function() {
htmlReporterMain = createDom('div', {className: 'html-reporter'},
@@ -83,6 +83,10 @@ jasmineRequire.HtmlReporter = function(j$) {
};
this.suiteDone = function(result) {
if (result.failedExpectations && result.failedExpectations.length > 0) {
failedSuites.push(result);
}
if (currentParent == topResults) {
return;
}
@@ -94,10 +98,6 @@ jasmineRequire.HtmlReporter = function(j$) {
currentParent.addChild(result, 'spec');
};
this.afterAllException = function(error) {
exceptionList.push(error);
};
var failures = [];
this.specDone = function(result) {
if (result.status != 'disabled') {
@@ -170,10 +170,13 @@ jasmineRequire.HtmlReporter = function(j$) {
var statusBarClassName = 'bar ' + ((failureCount > 0) ? 'failed' : 'passed');
alert.appendChild(createDom('span', {className: statusBarClassName}, statusBarMessage));
for(i = 0; i < exceptionList.length; i++) {
var errorBarMessage = 'An error was thrown in an afterAll: ' + (exceptionList[i].message || exceptionList[i].description);
var errorBarClassName = 'bar errored';
alert.appendChild(createDom('span', {className: errorBarClassName}, errorBarMessage));
for(i = 0; i < failedSuites.length; i++) {
var failedSuite = failedSuites[i];
for(var j = 0; j < failedSuite.failedExpectations.length; j++) {
var errorBarMessage = 'AfterAll ' + failedSuite.failedExpectations[j].message;
var errorBarClassName = 'bar errored';
alert.appendChild(createDom('span', {className: errorBarClassName}, errorBarMessage));
}
}
var results = find('.results');