Skip to content

Commit 48645bf

Browse files
authoredJan 15, 2025··
fix: return test fn result to runner (#7239)
1 parent 1e7915b commit 48645bf

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed
 

‎packages/runner/src/suite.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -479,7 +479,7 @@ function createSuiteCollector(
479479

480480
function withAwaitAsyncAssertions<T extends (...args: any[]) => any>(fn: T, task: TaskPopulated): T {
481481
return (async (...args: any[]) => {
482-
await fn(...args)
482+
const fnResult = await fn(...args)
483483
// some async expect will be added to this array, in case user forget to await them
484484
if (task.promises) {
485485
const result = await Promise.allSettled(task.promises)
@@ -490,6 +490,7 @@ function withAwaitAsyncAssertions<T extends (...args: any[]) => any>(fn: T, task
490490
throw errors
491491
}
492492
}
493+
return fnResult
493494
}) as T
494495
}
495496

0 commit comments

Comments
 (0)
Please sign in to comment.