mirror of
https://github.com/moltbot/moltbot.git
synced 2026-03-21 16:41:56 +00:00
test(discord): trim proxy and reply-delivery setup resets
This commit is contained in:
@@ -87,8 +87,8 @@ describe("createDiscordGatewayPlugin", () => {
|
||||
}
|
||||
|
||||
beforeEach(() => {
|
||||
proxyAgentSpy.mockReset();
|
||||
webSocketSpy.mockReset();
|
||||
proxyAgentSpy.mockClear();
|
||||
webSocketSpy.mockClear();
|
||||
resetLastAgent();
|
||||
});
|
||||
|
||||
|
||||
@@ -30,8 +30,8 @@ describe("resolveDiscordRestFetch", () => {
|
||||
error: vi.fn(),
|
||||
exit: vi.fn(),
|
||||
} as const;
|
||||
undiciFetchMock.mockReset().mockResolvedValue(new Response("ok", { status: 200 }));
|
||||
proxyAgentSpy.mockReset();
|
||||
undiciFetchMock.mockClear().mockResolvedValue(new Response("ok", { status: 200 }));
|
||||
proxyAgentSpy.mockClear();
|
||||
const fetcher = resolveDiscordRestFetch("http://proxy.test:8080", runtime);
|
||||
|
||||
await fetcher("https://discord.com/api/v10/oauth2/applications/@me");
|
||||
|
||||
@@ -20,15 +20,15 @@ describe("deliverDiscordReply", () => {
|
||||
const runtime = {} as RuntimeEnv;
|
||||
|
||||
beforeEach(() => {
|
||||
sendMessageDiscordMock.mockReset().mockResolvedValue({
|
||||
sendMessageDiscordMock.mockClear().mockResolvedValue({
|
||||
messageId: "msg-1",
|
||||
channelId: "channel-1",
|
||||
});
|
||||
sendVoiceMessageDiscordMock.mockReset().mockResolvedValue({
|
||||
sendVoiceMessageDiscordMock.mockClear().mockResolvedValue({
|
||||
messageId: "voice-1",
|
||||
channelId: "channel-1",
|
||||
});
|
||||
sendWebhookMessageDiscordMock.mockReset().mockResolvedValue({
|
||||
sendWebhookMessageDiscordMock.mockClear().mockResolvedValue({
|
||||
messageId: "webhook-1",
|
||||
channelId: "thread-1",
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user