fix: use partial carbon mock in discord tests (#13262) (thanks @arosstale)

This commit is contained in:
Shadow
2026-02-11 13:10:22 -06:00
parent 940ce424c8
commit 48993aebc8
2 changed files with 14 additions and 18 deletions

View File

@@ -14,6 +14,7 @@ Docs: https://docs.openclaw.ai
- Ollama: use configured `models.providers.ollama.baseUrl` for model discovery and normalize `/v1` endpoints to the native Ollama API root. (#14131) Thanks @shtse8.
- Slack: detect control commands when channel messages start with bot mention prefixes (for example, `@Bot /new`). (#14142) Thanks @beefiker.
- Discord tests: use a partial @buape/carbon mock in slash command coverage. (#13262) Thanks @arosstale.
- CLI/Wizard: exit with code 1 when `configure`, `agents add`, or interactive `onboard` wizards are canceled, so `set -e` automation stops correctly. (#14156) Thanks @0xRaini.
## 2026.2.9

View File

@@ -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<typeof import("@buape/carbon")>();
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<typeof import("../auto-reply/dispatch.js")>();