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(() => {
proxyAgentSpy.mockReset();
webSocketSpy.mockReset();
proxyAgentSpy.mockClear();
webSocketSpy.mockClear();
resetLastAgent();
});

View File

@@ -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");

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",
});