test(discord): isolate debug proxy env · openclaw/openclaw@0747a9c
steipete
·
2026-04-18
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
|
1 | | -import { beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; |
| 1 | +import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; |
2 | 2 | |
3 | 3 | const { |
4 | 4 | GatewayIntents, |
@@ -221,6 +221,9 @@ describe("createDiscordGatewayPlugin", () => {
|
221 | 221 | } |
222 | 222 | |
223 | 223 | beforeEach(() => { |
| 224 | +vi.unstubAllEnvs(); |
| 225 | +vi.stubEnv("OPENCLAW_DEBUG_PROXY_ENABLED", ""); |
| 226 | +vi.stubEnv("OPENCLAW_DEBUG_PROXY_URL", ""); |
224 | 227 | vi.stubGlobal("fetch", globalFetchMock); |
225 | 228 | vi.useRealTimers(); |
226 | 229 | baseRegisterClientSpy.mockClear(); |
@@ -236,6 +239,11 @@ describe("createDiscordGatewayPlugin", () => {
|
236 | 239 | resetLastAgent(); |
237 | 240 | }); |
238 | 241 | |
| 242 | +afterEach(() => { |
| 243 | +vi.useRealTimers(); |
| 244 | +vi.unstubAllEnvs(); |
| 245 | +}); |
| 246 | + |
239 | 247 | it("uses safe gateway metadata lookup without proxy", async () => { |
240 | 248 | const runtime = createRuntime(); |
241 | 249 | const plugin = createDiscordGatewayPlugin({ |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。