test: narrow the fake-client cast to a single assertion

Signed-off-by: cliffhall <cliff@futurescale.com>
This commit is contained in:
cliffhall 2026-08-18 10:52:24 -04:00
commit 9f42a5ef10

View file

@ -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<typeof vi.fn>;
};
client.setLoggingLevel.mockRejectedValueOnce(new Error("no logging"));