diff --git a/lib/jasmine-core/jasmine.js b/lib/jasmine-core/jasmine.js index 10e4d900..eeb857f1 100644 --- a/lib/jasmine-core/jasmine.js +++ b/lib/jasmine-core/jasmine.js @@ -11584,14 +11584,11 @@ getJasmineRequireObj().TreeRunner = function(j$) { } this.#runQueue({ - // TODO: if onComplete always takes 0-1 arguments (and it probably does) - // then it can be switched to an arrow fn with a named arg. - onComplete: function() { - const args = Array.prototype.slice.call(arguments, [0]); + onComplete: maybeError => { this.#suiteSegmentComplete(suite, suite.getResult(), () => { - done.apply(undefined, args); + done(maybeError); }); - }.bind(this), + }, queueableFns, userContext: suite.sharedUserContext(), onException: function() { diff --git a/src/core/TreeRunner.js b/src/core/TreeRunner.js index 1a84a59a..8b7c5703 100644 --- a/src/core/TreeRunner.js +++ b/src/core/TreeRunner.js @@ -162,14 +162,11 @@ getJasmineRequireObj().TreeRunner = function(j$) { } this.#runQueue({ - // TODO: if onComplete always takes 0-1 arguments (and it probably does) - // then it can be switched to an arrow fn with a named arg. - onComplete: function() { - const args = Array.prototype.slice.call(arguments, [0]); + onComplete: maybeError => { this.#suiteSegmentComplete(suite, suite.getResult(), () => { - done.apply(undefined, args); + done(maybeError); }); - }.bind(this), + }, queueableFns, userContext: suite.sharedUserContext(), onException: function() {