Skip to content

Commit

Permalink
fix: return test fn result to runner (#7239)
Browse files Browse the repository at this point in the history
  • Loading branch information
wmertens authored Jan 15, 2025
1 parent 1e7915b commit 48645bf
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/runner/src/suite.ts
Original file line number Diff line number Diff line change
Expand Up @@ -479,7 +479,7 @@ function createSuiteCollector(

function withAwaitAsyncAssertions<T extends (...args: any[]) => any>(fn: T, task: TaskPopulated): T {
return (async (...args: any[]) => {
await fn(...args)
const fnResult = await fn(...args)
// some async expect will be added to this array, in case user forget to await them
if (task.promises) {
const result = await Promise.allSettled(task.promises)
Expand All @@ -490,6 +490,7 @@ function withAwaitAsyncAssertions<T extends (...args: any[]) => any>(fn: T, task
throw errors
}
}
return fnResult
}) as T
}

Expand Down

0 comments on commit 48645bf

Please sign in to comment.