From a690eafdf721e3d79f8ed7ec368165bb72a7fb67 Mon Sep 17 00:00:00 2001 From: Peter Steinberger Date: Mon, 6 Apr 2026 23:53:14 +0100 Subject: [PATCH] test: stabilize outbound contract helpers --- test/helpers/channels/outbound-payload-contract.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/test/helpers/channels/outbound-payload-contract.ts b/test/helpers/channels/outbound-payload-contract.ts index db0d6ac2bc5..1fe2c064673 100644 --- a/test/helpers/channels/outbound-payload-contract.ts +++ b/test/helpers/channels/outbound-payload-contract.ts @@ -1,4 +1,4 @@ -import { expect, it, type Mock, vi } from "vitest"; +import { beforeEach, expect, it, type Mock, vi } from "vitest"; import { createSlackOutboundPayloadHarness } from "../../../extensions/slack/contract-api.js"; import { whatsappOutbound } from "../../../extensions/whatsapp/test-api.js"; import { @@ -10,6 +10,7 @@ import type { ReplyPayload } from "../../../src/auto-reply/types.js"; import { primeChannelOutboundSendMock } from "../../../src/channels/plugins/contracts/test-helpers.js"; import { createDirectTextMediaOutbound } from "../../../src/channels/plugins/outbound/direct-text-media.js"; import type { ChannelOutboundAdapter } from "../../../src/channels/plugins/types.js"; +import { resetGlobalHookRunner } from "../../../src/plugins/hook-runner-global.js"; import { loadBundledPluginTestApiSync } from "../../../src/test-utils/bundled-plugin-public-surface.js"; type ParseZalouserOutboundTarget = (raw: string) => { threadId: string; isGroup: boolean }; @@ -71,6 +72,10 @@ function installChannelOutboundPayloadContractSuite(params: { to: string; }; }) { + beforeEach(() => { + resetGlobalHookRunner(); + }); + it("text-only delegates to sendText", async () => { const { run, sendMock, to } = params.createHarness({ payload: { text: "hello" },