mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 15:30:47 +00:00
fix(infra): avoid empty test stub classes
This commit is contained in:
@@ -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<string, unknown>)[TEST_UNDICI_RUNTIME_DEPS_KEY] = {
|
||||
Agent: class MockAgent {},
|
||||
EnvHttpProxyAgent: class MockEnvHttpProxyAgent {},
|
||||
Agent: MockAgent,
|
||||
EnvHttpProxyAgent: MockEnvHttpProxyAgent,
|
||||
FormData: RuntimeFormData,
|
||||
ProxyAgent: class MockProxyAgent {},
|
||||
ProxyAgent: MockProxyAgent,
|
||||
fetch: runtimeFetch,
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user