Skip to content

Commit

Permalink
Fix failing tests due to unhandledRejection.
Browse files Browse the repository at this point in the history
  • Loading branch information
garg3133 committed Dec 9, 2024
1 parent aace0f4 commit 54914bf
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions lib/testsuite/runnable.js
Original file line number Diff line number Diff line change
Expand Up @@ -160,10 +160,14 @@ class Runnable {
}

if (this.currentTestCaseResult instanceof Promise) {
this.currentTestCaseResult.finally(() => {
this.currentTestCaseResult.settled = true;
this.queue.scheduleTraverse();
});
this.currentTestCaseResult
.catch(() => {
// to avoid unhandledRejections
})
.finally(() => {
this.currentTestCaseResult.settled = true;
this.queue.scheduleTraverse();
});
}

this.queue.run(this.currentTestCaseResult).then(err => {
Expand Down

0 comments on commit 54914bf

Please sign in to comment.