From e16e7be85bbdd58c3bc4d0ec1d3759ba0704ce0a Mon Sep 17 00:00:00 2001 From: Peter Steinberger Date: Sun, 22 Feb 2026 07:57:50 +0000 Subject: [PATCH] test(core): trim redundant mock resets in heartbeat suites --- src/channels/plugins/whatsapp-heartbeat.test.ts | 4 ++-- src/hooks/bundled/boot-md/handler.test.ts | 2 -- src/infra/heartbeat-runner.returns-default-unset.test.ts | 4 ++-- 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/src/channels/plugins/whatsapp-heartbeat.test.ts b/src/channels/plugins/whatsapp-heartbeat.test.ts index acde8d065..5ec7215c0 100644 --- a/src/channels/plugins/whatsapp-heartbeat.test.ts +++ b/src/channels/plugins/whatsapp-heartbeat.test.ts @@ -39,8 +39,8 @@ describe("resolveWhatsAppHeartbeatRecipients", () => { } beforeEach(() => { - vi.mocked(loadSessionStore).mockReset(); - vi.mocked(readChannelAllowFromStoreSync).mockReset(); + vi.mocked(loadSessionStore).mockClear(); + vi.mocked(readChannelAllowFromStoreSync).mockClear(); setAllowFromStore([]); }); diff --git a/src/hooks/bundled/boot-md/handler.test.ts b/src/hooks/bundled/boot-md/handler.test.ts index 6308d4085..bb0e76767 100644 --- a/src/hooks/bundled/boot-md/handler.test.ts +++ b/src/hooks/bundled/boot-md/handler.test.ts @@ -48,8 +48,6 @@ describe("boot-md handler", () => { beforeEach(() => { vi.clearAllMocks(); - logWarn.mockReset(); - logDebug.mockReset(); }); it("skips non-gateway events", async () => { diff --git a/src/infra/heartbeat-runner.returns-default-unset.test.ts b/src/infra/heartbeat-runner.returns-default-unset.test.ts index fcc8fae96..e906c50bd 100644 --- a/src/infra/heartbeat-runner.returns-default-unset.test.ts +++ b/src/infra/heartbeat-runner.returns-default-unset.test.ts @@ -760,7 +760,7 @@ describe("runHeartbeatOnce", () => { }), ); - replySpy.mockReset(); + replySpy.mockClear(); replySpy.mockResolvedValue([{ text: testCase.message }]); const sendWhatsApp = vi .fn>() @@ -896,7 +896,7 @@ describe("runHeartbeatOnce", () => { }), ); - replySpy.mockReset(); + replySpy.mockClear(); replySpy.mockResolvedValue(testCase.replies); const sendWhatsApp = vi .fn>()