























@@ -370,7 +370,10 @@ describe("runHeartbeatOnce ack handling", () => {
370370});
371371372372expect(res.status).toBe("skipped");
373-expect(res).toMatchObject({ reason: "whatsapp-not-linked" });
373+if (!("reason" in res)) {
374+throw new Error("expected skipped heartbeat result reason");
375+}
376+expect(res.reason).toBe("whatsapp-not-linked");
374377expect(sendWhatsApp).not.toHaveBeenCalled();
375378});
376379});
@@ -405,11 +408,11 @@ describe("runHeartbeatOnce ack handling", () => {
405408});
406409407410expect(sendTelegram).toHaveBeenCalledTimes(1);
408-expect(sendTelegram).toHaveBeenCalledWith(
409- TELEGRAM_GROUP,
410- "Hello from heartbeat",
411- expect.objectContaining({ accountId: params.expectedAccountId, verbose: false }),
412-);
411+const [chatId, text, options] = sendTelegram.mock.calls[0] ?? [];
412+expect(chatId).toBe(TELEGRAM_GROUP);
413+expect(text).toBe("Hello from heartbeat");
414+expect(options?.accountId).toBe(params.expectedAccountId);
415+expect(options?.verbose).toBe(false);
413416});
414417}
415418此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。