diff --git a/src/infra/net/runtime-fetch.test.ts b/src/infra/net/runtime-fetch.test.ts index 4736b976a22..70c118696e1 100644 --- a/src/infra/net/runtime-fetch.test.ts +++ b/src/infra/net/runtime-fetch.test.ts @@ -28,6 +28,18 @@ class RuntimeFormData { } } +class MockAgent { + readonly __testStub = true; +} + +class MockEnvHttpProxyAgent { + readonly __testStub = true; +} + +class MockProxyAgent { + readonly __testStub = true; +} + afterEach(() => { Reflect.deleteProperty(globalThis as object, TEST_UNDICI_RUNTIME_DEPS_KEY); }); @@ -55,10 +67,10 @@ describe("fetchWithRuntimeDispatcher", () => { }); (globalThis as Record)[TEST_UNDICI_RUNTIME_DEPS_KEY] = { - Agent: class MockAgent {}, - EnvHttpProxyAgent: class MockEnvHttpProxyAgent {}, + Agent: MockAgent, + EnvHttpProxyAgent: MockEnvHttpProxyAgent, FormData: RuntimeFormData, - ProxyAgent: class MockProxyAgent {}, + ProxyAgent: MockProxyAgent, fetch: runtimeFetch, };