chore: Fix types in tests 38/N.

This commit is contained in:
cpojer
2026-02-17 15:47:23 +09:00
parent 238718c1d8
commit 084e39b519
19 changed files with 85 additions and 40 deletions

View File

@@ -44,10 +44,10 @@ describe("gateway config.apply", () => {
},
}),
);
const res = await onceMessage<{ ok: boolean; error?: { message?: string } }>(
ws,
(o) => o.type === "res" && o.id === id,
);
const res = await onceMessage<{ ok: boolean; error?: { message?: string } }>(ws, (o) => {
const msg = o as { type?: string; id?: string };
return msg.type === "res" && msg.id === id;
});
expect(res.ok).toBe(false);
expect(res.error?.message ?? "").toMatch(/invalid|SyntaxError/i);
} finally {
@@ -69,10 +69,10 @@ describe("gateway config.apply", () => {
},
}),
);
const res = await onceMessage<{ ok: boolean; error?: { message?: string } }>(
ws,
(o) => o.type === "res" && o.id === id,
);
const res = await onceMessage<{ ok: boolean; error?: { message?: string } }>(ws, (o) => {
const msg = o as { type?: string; id?: string };
return msg.type === "res" && msg.id === id;
});
expect(res.ok).toBe(false);
expect(res.error?.message ?? "").toContain("raw");
} finally {