Allow expectations in a global beforeAll or afterAll

- Report afterAll failures in jasmineDone
- Issue #811
This commit is contained in:
Gregg Van Hove
2016-02-25 15:01:47 -08:00
parent 5583b6f954
commit dbd198f7d0
3 changed files with 116 additions and 28 deletions

View File

@@ -204,7 +204,9 @@ getJasmineRequireObj().Env = function(j$) {
var topSuite = new j$.Suite({
env: this,
id: getNextSuiteId(),
description: 'Jasmine__TopLevel__Suite'
description: 'Jasmine__TopLevel__Suite',
expectationFactory: expectationFactory,
expectationResultFactory: expectationResultFactory
});
runnableLookupTable[topSuite.id] = topSuite;
defaultResourcesForRunnable(topSuite.id);
@@ -257,9 +259,15 @@ getJasmineRequireObj().Env = function(j$) {
totalSpecsDefined: totalSpecsDefined
});
currentlyExecutingSuites.push(topSuite);
processor.execute(function() {
clearResourcesForRunnable(topSuite.id);
currentlyExecutingSuites.pop();
reporter.jasmineDone({
order: order
order: order,
failedExpectations: topSuite.result.failedExpectations
});
});
};