From a67752e6be2d762852b910c243ea97b6da03deb5 Mon Sep 17 00:00:00 2001 From: Claude Code Date: Tue, 10 Feb 2026 08:53:24 +0100 Subject: [PATCH] fix(discord): use partial mock for @buape/carbon in slash test MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Replace the full manual mock with importOriginal spread so new SDK exports are available automatically. Only ChannelType, MessageType, and Client are overridden — the rest come from the real module. Prevents CI breakage when @buape/carbon adds exports (e.g. the recent StringSelectMenu failure that blocked unrelated PRs). Closes #13244 --- src/discord/monitor.slash.test.ts | 31 +++++++++++++------------------ 1 file changed, 13 insertions(+), 18 deletions(-) diff --git a/src/discord/monitor.slash.test.ts b/src/discord/monitor.slash.test.ts index 86631a2c27..508ee5a936 100644 --- a/src/discord/monitor.slash.test.ts +++ b/src/discord/monitor.slash.test.ts @@ -3,24 +3,19 @@ import { createReplyDispatcherWithTyping } from "../auto-reply/reply/reply-dispa const dispatchMock = vi.fn(); -vi.mock("@buape/carbon", () => ({ - ChannelType: { DM: "dm", GroupDM: "group" }, - MessageType: { - ChatInputCommand: 1, - ContextMenuCommand: 2, - Default: 0, - }, - Button: class {}, - Command: class {}, - Client: class {}, - MessageCreateListener: class {}, - MessageReactionAddListener: class {}, - MessageReactionRemoveListener: class {}, - PresenceUpdateListener: class {}, - Row: class {}, - StringSelectMenu: class {}, - BaseMessageInteractiveComponent: class {}, -})); +vi.mock("@buape/carbon", async (importOriginal) => { + const actual = await importOriginal(); + return { + ...actual, + ChannelType: { DM: "dm", GroupDM: "group" }, + MessageType: { + ChatInputCommand: 1, + ContextMenuCommand: 2, + Default: 0, + }, + Client: class {}, + }; +}); vi.mock("../auto-reply/dispatch.js", async (importOriginal) => { const actual = await importOriginal();