diff --git a/src/discord/monitor.test.ts b/src/discord/monitor.test.ts index 325138876e..1607e72c23 100644 --- a/src/discord/monitor.test.ts +++ b/src/discord/monitor.test.ts @@ -1,6 +1,5 @@ import { ChannelType, type Guild } from "@buape/carbon"; import { describe, expect, it, vi } from "vitest"; -import { sleep } from "../utils.js"; import { allowListMatches, buildDiscordMediaPayload, @@ -108,7 +107,7 @@ describe("DiscordMessageListener", () => { {} as unknown as import("./monitor/listeners.js").DiscordMessageEvent, {} as unknown as import("@buape/carbon").Client, ); - await sleep(0); + await Promise.resolve(); expect(logger.error).toHaveBeenCalledWith(expect.stringContaining("discord handler failed")); }); diff --git a/src/hooks/internal-hooks.test.ts b/src/hooks/internal-hooks.test.ts index b1ea70ab0e..9a2b7998a5 100644 --- a/src/hooks/internal-hooks.test.ts +++ b/src/hooks/internal-hooks.test.ts @@ -109,7 +109,7 @@ describe("hooks", () => { it("should handle async handlers", async () => { const handler = vi.fn(async () => { - await new Promise((resolve) => setTimeout(resolve, 10)); + await Promise.resolve(); }); registerInternalHook("command:new", handler);