From 5fc21de45e857da48cc41b7b1d94991714a0fb96 Mon Sep 17 00:00:00 2001 From: Benedek Kozma Date: Wed, 16 Oct 2024 17:11:39 +0200 Subject: [PATCH 1/2] Allow passing non-async function to group --- packages/core/src/core.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/core/src/core.ts b/packages/core/src/core.ts index 0a1416937c..4595da57ec 100644 --- a/packages/core/src/core.ts +++ b/packages/core/src/core.ts @@ -324,7 +324,7 @@ export function endGroup(): void { * @param name The name of the group * @param fn The function to wrap in the group */ -export async function group(name: string, fn: () => Promise): Promise { +export async function group(name: string, fn: () => T | Promise): Promise { startGroup(name) let result: T From e9bcf2a4e44f6be6aa25999886453a1315fcc656 Mon Sep 17 00:00:00 2001 From: Benedek Kozma Date: Wed, 16 Oct 2024 17:22:54 +0200 Subject: [PATCH 2/2] fix prettier issue --- packages/core/src/core.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/core/src/core.ts b/packages/core/src/core.ts index 4595da57ec..9d0c4e1968 100644 --- a/packages/core/src/core.ts +++ b/packages/core/src/core.ts @@ -324,7 +324,10 @@ export function endGroup(): void { * @param name The name of the group * @param fn The function to wrap in the group */ -export async function group(name: string, fn: () => T | Promise): Promise { +export async function group( + name: string, + fn: () => T | Promise +): Promise { startGroup(name) let result: T