Convert some TreeRunner internals to promises

This commit is contained in:
Steve Gravrock
2025-08-21 07:58:28 -07:00
parent 164a393932
commit 3780fe0b35
3 changed files with 14 additions and 12 deletions

View File

@@ -75,7 +75,7 @@ getJasmineRequireObj().TreeRunner = function(j$) {
this.#reportDispatcher.specStarted(spec.result).then(next);
},
(result, next) => {
this.#specComplete(spec, result, next);
this.#specComplete(spec).then(next);
},
done,
this.#executionTree.isExcluded(spec),
@@ -154,20 +154,20 @@ getJasmineRequireObj().TreeRunner = function(j$) {
this.#reportDispatcher.suiteDone(result).then(next);
}
#specComplete(spec, result, next) {
async #specComplete(spec) {
this.#runableResources.clearForRunable(spec.id);
this.#currentRunableTracker.setCurrentSpec(null);
if (result.status === 'failed') {
if (spec.result.status === 'failed') {
this.#hasFailures = true;
}
this.#reportSpecDone(spec, result, next);
await this.#reportSpecDone(spec);
}
#reportSpecDone(spec, result, next) {
async #reportSpecDone(spec) {
spec.reportedDone = true;
this.#reportDispatcher.specDone(result).then(next);
await this.#reportDispatcher.specDone(spec.result);
}
#addBeforeAndAfterAlls(suite, wrappedChildren) {