Separated reporter- and runable-specific queue runner configuration

This commit is contained in:
Steve Gravrock
2022-06-12 15:52:14 -07:00
parent 93c5f654d9
commit d0a9931ae6
3 changed files with 38 additions and 34 deletions

View File

@@ -57,7 +57,21 @@ getJasmineRequireObj().Runner = function(j$) {
const processor = new j$.TreeProcessor({
tree: this.topSuite_,
runnableIds: runablesToRun,
queueRunnerFactory: this.queueRunnerFactory_,
queueRunnerFactory: options => {
if (options.isLeaf) {
// A spec
options.SkipPolicy = j$.CompleteOnFirstErrorSkipPolicy;
} else {
// A suite
if (config.stopOnSpecFailure) {
options.SkipPolicy = j$.CompleteOnFirstErrorSkipPolicy;
} else {
options.SkipPolicy = j$.SkipAfterBeforeAllErrorPolicy;
}
}
return this.queueRunnerFactory_(options);
},
failSpecWithNoExpectations: config.failSpecWithNoExpectations,
nodeStart: (suite, next) => {
this.currentlyExecutingSuites_.push(suite);