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

This commit is contained in:
Peter Steinberger
2026-02-22 07:35:54 +00:00
parent 1e1851a991
commit 706837f6a3
3 changed files with 7 additions and 7 deletions
+2 -2
View File
@@ -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");
+3 -3
View File
@@ -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",
});