Skip everything except afterAll fns when a beforeAll fn errors

* Fixes #1533
This commit is contained in:
Steve Gravrock
2021-09-30 10:19:58 -07:00
parent 5eaeeb0b6c
commit 5f1ef5ac2b
14 changed files with 316 additions and 70 deletions

View File

@@ -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;
};