Skip to content

Commit

Permalink
Return the result of the callback in the promise
Browse files Browse the repository at this point in the history
  • Loading branch information
georgehb committed Dec 16, 2021
1 parent 6be6e2e commit 15cc683
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ const waitForExpect = function waitForExpect(
tries += 1;
try {
Promise.resolve(expectation())
.then(() => resolve())
.then((result) => resolve(result))
.catch(rejectOrRerun);
} catch (error) {
rejectOrRerun(error);
Expand Down

0 comments on commit 15cc683

Please sign in to comment.