mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-22 15:38:12 +00:00
fix: use partial carbon mock in discord tests (#13262) (thanks @arosstale)
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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")>();
|
||||
|
||||
Reference in New Issue
Block a user