mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-09 10:17:39 +00:00
test(discord): trim proxy and reply-delivery setup resets
This commit is contained in:
@@ -87,8 +87,8 @@ describe("createDiscordGatewayPlugin", () => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
proxyAgentSpy.mockReset();
|
proxyAgentSpy.mockClear();
|
||||||
webSocketSpy.mockReset();
|
webSocketSpy.mockClear();
|
||||||
resetLastAgent();
|
resetLastAgent();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -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");
|
||||||
|
|||||||
@@ -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",
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user