mirror of
https://github.com/moltbot/moltbot.git
synced 2026-05-13 23:56:07 +00:00
test: tighten discord listener error assertions
This commit is contained in:
@@ -135,8 +135,10 @@ describe("DiscordMessageListener", () => {
|
||||
|
||||
await expect(listener.handle(fakeEvent("ch-1"), {} as never)).resolves.toBeUndefined();
|
||||
await flushAsyncWork();
|
||||
expect(logger.error).toHaveBeenCalledWith(
|
||||
expect.stringContaining("discord handler failed: Error: boom"),
|
||||
expect(logger.error).toHaveBeenCalledTimes(1);
|
||||
expect(logger.error.mock.calls[0]).toHaveLength(1);
|
||||
expect(String(logger.error.mock.calls[0]?.[0])).toContain(
|
||||
"discord handler failed: Error: boom",
|
||||
);
|
||||
});
|
||||
|
||||
@@ -182,8 +184,10 @@ describe("DiscordInteractionListener", () => {
|
||||
await listener.handle({ id: "interaction-1" } as never, { handleInteraction } as never);
|
||||
await flushAsyncWork();
|
||||
|
||||
expect(logger.error).toHaveBeenCalledWith(
|
||||
expect.stringContaining("discord interaction handler failed: Error: interaction boom"),
|
||||
expect(logger.error).toHaveBeenCalledTimes(1);
|
||||
expect(logger.error.mock.calls[0]).toHaveLength(1);
|
||||
expect(String(logger.error.mock.calls[0]?.[0])).toContain(
|
||||
"discord interaction handler failed: Error: interaction boom",
|
||||
);
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user