test(discord): isolate debug proxy env

This commit is contained in:
Peter Steinberger
2026-04-17 18:21:42 +01:00
parent 7876e3e736
commit 0747a9c85a

View File

@@ -1,4 +1,4 @@
import { beforeAll, beforeEach, describe, expect, it, vi } from "vitest";
import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest";
const {
GatewayIntents,
@@ -221,6 +221,9 @@ describe("createDiscordGatewayPlugin", () => {
}
beforeEach(() => {
vi.unstubAllEnvs();
vi.stubEnv("OPENCLAW_DEBUG_PROXY_ENABLED", "");
vi.stubEnv("OPENCLAW_DEBUG_PROXY_URL", "");
vi.stubGlobal("fetch", globalFetchMock);
vi.useRealTimers();
baseRegisterClientSpy.mockClear();
@@ -236,6 +239,11 @@ describe("createDiscordGatewayPlugin", () => {
resetLastAgent();
});
afterEach(() => {
vi.useRealTimers();
vi.unstubAllEnvs();
});
it("uses safe gateway metadata lookup without proxy", async () => {
const runtime = createRuntime();
const plugin = createDiscordGatewayPlugin({