From 9f42a5ef10e232a53540c5bbf68e9d39e95d3cd7 Mon Sep 17 00:00:00 2001 From: cliffhall Date: Tue, 18 Aug 2026 10:52:24 -0400 Subject: [PATCH] test: narrow the fake-client cast to a single assertion Signed-off-by: cliffhall --- clients/web/src/App.test.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/clients/web/src/App.test.tsx b/clients/web/src/App.test.tsx index 09d1e67e..fdf01413 100644 --- a/clients/web/src/App.test.tsx +++ b/clients/web/src/App.test.tsx @@ -2552,7 +2552,9 @@ describe("App background command rejections (#2049)", () => { const rejections = captureUnhandledRejections(); try { const user = await connect(); - const client = clientInstances[0] as unknown as { + // Single assertion: the fake client IS an EventTarget, so narrowing it + // to that intersection needs no `as unknown as` detour. + const client = clientInstances[0] as EventTarget & { setLoggingLevel: ReturnType; }; client.setLoggingLevel.mockRejectedValueOnce(new Error("no logging"));