When stop on failure is enabled, skip subsequent it() and beforeEach().
Note: afterEach() functions are still run, because skipping them is highly likely to pollute specs that run after the failure. [Finishes #92252330] - Fixes #577 - Fixes #807
This commit is contained in:
@@ -196,6 +196,7 @@ getJasmineRequireObj().Env = function(j$) {
|
||||
options.timeout = {setTimeout: realSetTimeout, clearTimeout: realClearTimeout};
|
||||
options.fail = self.fail;
|
||||
options.globalErrors = globalErrors;
|
||||
options.completeOnFirstError = throwOnExpectationFailure && options.isLeaf;
|
||||
|
||||
new j$.QueueRunner(options).execute();
|
||||
};
|
||||
@@ -520,6 +521,7 @@ getJasmineRequireObj().Env = function(j$) {
|
||||
|
||||
this.afterEach = function(afterEachFunction, timeout) {
|
||||
ensureIsFunctionOrAsync(afterEachFunction, 'afterEach');
|
||||
afterEachFunction.isCleanup = true;
|
||||
currentDeclarationSuite.afterEach({
|
||||
fn: afterEachFunction,
|
||||
timeout: function() { return timeout || j$.DEFAULT_TIMEOUT_INTERVAL; }
|
||||
@@ -568,6 +570,10 @@ getJasmineRequireObj().Env = function(j$) {
|
||||
message: message,
|
||||
error: error && error.message ? error : null
|
||||
});
|
||||
|
||||
if (self.throwingExpectationFailures()) {
|
||||
throw new Error(message);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user