Convert some TreeRunner internals to promises
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user