





















@@ -223,16 +223,19 @@ describe("createPinnedDispatcher", () => {
223223});
224224225225it("keeps the override bound to the matching hostname only", () => {
226-const originalLookup = vi.fn(
226+const originalLookupMock = vi.fn(
227227(_hostname: string, callback: (err: null, address: string, family: number) => void) => {
228228callback(null, "93.184.216.34", 4);
229229},
230-) as unknown as PinnedHostname["lookup"];
230+);
231+const originalLookup = originalLookupMock as unknown as PinnedHostname["lookup"];
231232const lookup = createDispatcherWithPinnedOverride(originalLookup);
232233const callback = vi.fn();
233234lookup?.("example.com", callback);
234235235-expect(originalLookup).toHaveBeenCalledWith("example.com", expect.any(Function));
236+const originalLookupCall = originalLookupMock.mock.calls[0];
237+expect(originalLookupCall?.[0]).toBe("example.com");
238+expect(typeof originalLookupCall?.[1]).toBe("function");
236239expect(callback).toHaveBeenCalledWith(null, "93.184.216.34", 4);
237240});
238241此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。