mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-10 04:42:44 +00:00
perf(test): cut slow monitor/subagent test overhead
This commit is contained in:
@@ -124,43 +124,6 @@ function createCategoryGuildClient() {
|
||||
}
|
||||
|
||||
describe("discord tool result dispatch", () => {
|
||||
it("sends status replies with responsePrefix", async () => {
|
||||
const cfg = {
|
||||
...BASE_CFG,
|
||||
messages: { responsePrefix: "PFX" },
|
||||
channels: { discord: { dmPolicy: "open", allowFrom: ["*"], dm: { enabled: true } } },
|
||||
} as ReturnType<typeof import("../config/config.js").loadConfig>;
|
||||
|
||||
const runtimeError = vi.fn();
|
||||
const handler = await createDmHandler({ cfg, runtimeError });
|
||||
const client = createDmClient();
|
||||
|
||||
await handler(
|
||||
{
|
||||
message: {
|
||||
id: "m1",
|
||||
content: "/status",
|
||||
channelId: "c1",
|
||||
timestamp: new Date().toISOString(),
|
||||
type: MessageType.Default,
|
||||
attachments: [],
|
||||
embeds: [],
|
||||
mentionedEveryone: false,
|
||||
mentionedUsers: [],
|
||||
mentionedRoles: [],
|
||||
author: { id: "u1", bot: false, username: "Ada" },
|
||||
},
|
||||
author: { id: "u1", bot: false, username: "Ada" },
|
||||
guild_id: null,
|
||||
},
|
||||
client,
|
||||
);
|
||||
|
||||
expect(runtimeError).not.toHaveBeenCalled();
|
||||
expect(sendMock).toHaveBeenCalledTimes(1);
|
||||
expect(sendMock.mock.calls[0]?.[1]).toMatch(/^PFX /);
|
||||
}, 30_000);
|
||||
|
||||
it("caches channel info lookups between messages", async () => {
|
||||
const cfg = {
|
||||
...BASE_CFG,
|
||||
|
||||
Reference in New Issue
Block a user