From 48645bf4f15886a41c8bfc35aa063eef2da696d3 Mon Sep 17 00:00:00 2001 From: Wout Mertens Date: Wed, 15 Jan 2025 14:39:51 +0100 Subject: [PATCH] fix: return test fn result to runner (#7239) --- packages/runner/src/suite.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/runner/src/suite.ts b/packages/runner/src/suite.ts index 360a36c45709..698763319279 100644 --- a/packages/runner/src/suite.ts +++ b/packages/runner/src/suite.ts @@ -479,7 +479,7 @@ function createSuiteCollector( function withAwaitAsyncAssertions 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) @@ -490,6 +490,7 @@ function withAwaitAsyncAssertions any>(fn: T, task throw errors } } + return fnResult }) as T }