test: narrow the fake-client cast to a single assertion
Signed-off-by: cliffhall <cliff@futurescale.com>
This commit is contained in:
parent
f96c4583ee
commit
9f42a5ef10
1 changed files with 3 additions and 1 deletions
|
|
@ -2552,7 +2552,9 @@ describe("App background command rejections (#2049)", () => {
|
||||||
const rejections = captureUnhandledRejections();
|
const rejections = captureUnhandledRejections();
|
||||||
try {
|
try {
|
||||||
const user = await connect();
|
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>;
|
setLoggingLevel: ReturnType<typeof vi.fn>;
|
||||||
};
|
};
|
||||||
client.setLoggingLevel.mockRejectedValueOnce(new Error("no logging"));
|
client.setLoggingLevel.mockRejectedValueOnce(new Error("no logging"));
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue