Skip everything except afterAll fns when a beforeAll fn errors
* Fixes #1533
This commit is contained in:
@@ -1,19 +1,20 @@
|
||||
getJasmineRequireObj().CompleteOnFirstErrorSkipPolicy = function(j$) {
|
||||
function CompleteOnFirstErrorSkipPolicy(queueableFns, firstCleanupIx) {
|
||||
this.queueableFns_ = queueableFns;
|
||||
this.firstCleanupIx_ = firstCleanupIx;
|
||||
this.skipping_ = false;
|
||||
}
|
||||
|
||||
CompleteOnFirstErrorSkipPolicy.prototype.skipTo = function(
|
||||
lastRanFnIx,
|
||||
errored
|
||||
) {
|
||||
if (errored && lastRanFnIx < this.firstCleanupIx_) {
|
||||
CompleteOnFirstErrorSkipPolicy.prototype.skipTo = function(lastRanFnIx) {
|
||||
if (this.skipping_ && lastRanFnIx < this.firstCleanupIx_) {
|
||||
return this.firstCleanupIx_;
|
||||
} else {
|
||||
return lastRanFnIx + 1;
|
||||
}
|
||||
};
|
||||
|
||||
CompleteOnFirstErrorSkipPolicy.prototype.fnErrored = function(fnIx) {
|
||||
this.skipping_ = true;
|
||||
};
|
||||
|
||||
return CompleteOnFirstErrorSkipPolicy;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user