mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 07:00:43 +00:00
test(discord): isolate debug proxy env
This commit is contained in:
@@ -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({
|
||||
|
||||
Reference in New Issue
Block a user