From a1279f012b7ef7563af1751b95f5a98cdd461b81 Mon Sep 17 00:00:00 2001 From: Vincent Koc Date: Sun, 12 Apr 2026 10:43:43 +0100 Subject: [PATCH] fix(infra): avoid empty test stub classes --- src/infra/net/runtime-fetch.test.ts | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) 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, };