perf(slack): avoid module resets in outbound adapter test

This commit is contained in:
Vincent Koc
2026-03-31 22:13:03 +09:00
parent dbe6663c34
commit 3f2fb73cfe
2 changed files with 6 additions and 4 deletions

View File

@@ -16,6 +16,7 @@ vi.mock("openclaw/plugin-sdk/plugin-runtime", () => ({
}));
let slackOutbound: typeof import("./outbound-adapter.js").slackOutbound;
({ slackOutbound } = await import("./outbound-adapter.js"));
describe("slackOutbound", () => {
const cfg = {
@@ -27,13 +28,11 @@ describe("slackOutbound", () => {
},
};
beforeEach(async () => {
vi.resetModules();
beforeEach(() => {
sendMessageSlackMock.mockReset();
hasHooksMock.mockReset();
runMessageSendingMock.mockReset();
hasHooksMock.mockReturnValue(false);
({ slackOutbound } = await import("./outbound-adapter.js"));
});
it("sends payload media first, then finalizes with blocks", async () => {