test(discord): trim proxy and reply-delivery setup resets

This commit is contained in:
Peter Steinberger
2026-02-22 00:11:51 +00:00
parent 1e1851a991
commit 706837f6a3
3 changed files with 7 additions and 7 deletions

View File

@@ -87,8 +87,8 @@ describe("createDiscordGatewayPlugin", () => {
} }
beforeEach(() => { beforeEach(() => {
proxyAgentSpy.mockReset(); proxyAgentSpy.mockClear();
webSocketSpy.mockReset(); webSocketSpy.mockClear();
resetLastAgent(); resetLastAgent();
}); });

View File

@@ -30,8 +30,8 @@ describe("resolveDiscordRestFetch", () => {
error: vi.fn(), error: vi.fn(),
exit: vi.fn(), exit: vi.fn(),
} as const; } as const;
undiciFetchMock.mockReset().mockResolvedValue(new Response("ok", { status: 200 })); undiciFetchMock.mockClear().mockResolvedValue(new Response("ok", { status: 200 }));
proxyAgentSpy.mockReset(); proxyAgentSpy.mockClear();
const fetcher = resolveDiscordRestFetch("http://proxy.test:8080", runtime); const fetcher = resolveDiscordRestFetch("http://proxy.test:8080", runtime);
await fetcher("https://discord.com/api/v10/oauth2/applications/@me"); await fetcher("https://discord.com/api/v10/oauth2/applications/@me");

View File

@@ -20,15 +20,15 @@ describe("deliverDiscordReply", () => {
const runtime = {} as RuntimeEnv; const runtime = {} as RuntimeEnv;
beforeEach(() => { beforeEach(() => {
sendMessageDiscordMock.mockReset().mockResolvedValue({ sendMessageDiscordMock.mockClear().mockResolvedValue({
messageId: "msg-1", messageId: "msg-1",
channelId: "channel-1", channelId: "channel-1",
}); });
sendVoiceMessageDiscordMock.mockReset().mockResolvedValue({ sendVoiceMessageDiscordMock.mockClear().mockResolvedValue({
messageId: "voice-1", messageId: "voice-1",
channelId: "channel-1", channelId: "channel-1",
}); });
sendWebhookMessageDiscordMock.mockReset().mockResolvedValue({ sendWebhookMessageDiscordMock.mockClear().mockResolvedValue({
messageId: "webhook-1", messageId: "webhook-1",
channelId: "thread-1", channelId: "thread-1",
}); });