Pass queue runner factory to Spec#execute, not ctor

This commit is contained in:
Steve Gravrock
2022-06-12 10:52:10 -07:00
parent d6cdc1841c
commit d8b65028a1
7 changed files with 116 additions and 117 deletions

View File

@@ -718,7 +718,6 @@ getJasmineRequireObj().Spec = function(j$) {
return '';
};
this.onLateError = attrs.onLateError || function() {};
this.queueRunnerFactory = attrs.queueRunnerFactory || function() {};
this.catchingExceptions =
attrs.catchingExceptions ||
function() {
@@ -792,7 +791,7 @@ getJasmineRequireObj().Spec = function(j$) {
return this.asyncExpectationFactory(actual, this);
};
Spec.prototype.execute = function(onComplete, excluded, failSpecWithNoExp) {
Spec.prototype.execute = function(queueRunnerFactory, onComplete, excluded, failSpecWithNoExp) {
const onStart = {
fn: done => {
this.timer.start();
@@ -854,7 +853,7 @@ getJasmineRequireObj().Spec = function(j$) {
runnerConfig.queueableFns.unshift(onStart);
runnerConfig.queueableFns.push(complete);
this.queueRunnerFactory(runnerConfig);
queueRunnerFactory(runnerConfig);
};
Spec.prototype.reset = function() {
@@ -1462,7 +1461,7 @@ getJasmineRequireObj().Env = function(j$) {
deprecator.addDeprecationWarning(runable, deprecation, options);
};
function queueRunnerFactory(options, args) {
function queueRunnerFactory(options) {
if (options.isLeaf) {
// A spec
options.SkipPolicy = j$.CompleteOnFirstErrorSkipPolicy;
@@ -1492,7 +1491,7 @@ getJasmineRequireObj().Env = function(j$) {
};
options.deprecated = self.deprecated;
new j$.QueueRunner(options).execute(args);
new j$.QueueRunner(options).execute();
}
const suiteBuilder = new j$.SuiteBuilder({
@@ -9649,7 +9648,6 @@ getJasmineRequireObj().SuiteBuilder = function(j$) {
this.onLateError_ = options.onLateError;
this.specResultCallback_ = options.specResultCallback;
this.specStarted_ = options.specStarted;
this.queueRunnerFactory_ = options.queueRunnerFactory;
this.nextSuiteId_ = 0;
this.nextSpecId_ = 0;
@@ -9849,7 +9847,6 @@ getJasmineRequireObj().SuiteBuilder = function(j$) {
},
onStart: (spec, next) => this.specStarted_(spec, suite, next),
description: description,
queueRunnerFactory: this.queueRunnerFactory_,
userContext: function() {
return suite.clonedSharedUserContext();
},
@@ -10197,6 +10194,7 @@ getJasmineRequireObj().TreeProcessor = function() {
return {
fn: function(done) {
node.execute(
queueRunnerFactory,
done,
stats[node.id].excluded,
failSpecWithNoExpectations