mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-08 08:51:23 +00:00
chore: Fix types in tests 34/N.
This commit is contained in:
@@ -108,7 +108,7 @@ describe("createWebSendApi", () => {
|
||||
});
|
||||
|
||||
it("falls back to unknown messageId if Baileys result does not expose key.id", async () => {
|
||||
sendMessage.mockResolvedValueOnce({ key: {} });
|
||||
sendMessage.mockResolvedValueOnce({ key: {} as { id: string } });
|
||||
const res = await api.sendMessage("+1555", "hello");
|
||||
expect(res.messageId).toBe("unknown");
|
||||
});
|
||||
|
||||
@@ -281,9 +281,7 @@ describe("web monitor inbox", () => {
|
||||
|
||||
expect(onMessage).toHaveBeenCalledTimes(2);
|
||||
|
||||
if (typeof resolveFirst === "function") {
|
||||
resolveFirst();
|
||||
}
|
||||
(resolveFirst as (() => void) | null)?.();
|
||||
await listener.close();
|
||||
});
|
||||
|
||||
|
||||
@@ -185,9 +185,7 @@ describe("web session", () => {
|
||||
await new Promise<void>((resolve) => setImmediate(resolve));
|
||||
expect(inFlight).toBe(1);
|
||||
|
||||
if (typeof release === "function") {
|
||||
release();
|
||||
}
|
||||
(release as (() => void) | null)?.();
|
||||
|
||||
// let both queued saves complete
|
||||
await new Promise<void>((resolve) => setImmediate(resolve));
|
||||
|
||||
Reference in New Issue
Block a user