perf(test): cut slow monitor/subagent test overhead

This commit is contained in:
Peter Steinberger
2026-02-18 03:50:22 +00:00
parent 99db4d13e5
commit 797ea7ed27
6 changed files with 50 additions and 84 deletions

View File

@@ -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,