






















@@ -282,11 +282,10 @@ describe("gateway bonjour advertiser", () => {
282282const started = await startAdvertiser({ gatewayPort: 18789 });
283283childProcessModule.exec('arp -a | findstr /C:"---"', () => {});
284284285-expect(execMock).toHaveBeenCalledWith(
286-'arp -a | findstr /C:"---"',
287-{ windowsHide: true },
288-expect.any(Function),
289-);
285+const execCall = execMock.mock.calls[0];
286+expect(execCall?.[0]).toBe('arp -a | findstr /C:"---"');
287+expect(execCall?.[1]).toEqual({ windowsHide: true });
288+expect(execCall?.[2]).toBeTypeOf("function");
290289291290await started.stop();
292291childProcessModule.exec('arp -a | findstr /C:"---"', () => {});
@@ -339,8 +338,11 @@ describe("gateway bonjour advertiser", () => {
339338{ logger },
340339);
341340342-expect(processOn).toHaveBeenCalledWith("unhandledRejection", expect.any(Function));
343-expect(processOn).not.toHaveBeenCalledWith("uncaughtException", expect.any(Function));
341+const unhandledRejectionRegistration = processOn.mock.calls.find(
342+([event]) => event === "unhandledRejection",
343+);
344+expect(unhandledRejectionRegistration?.[1]).toBeTypeOf("function");
345+expect(processOn.mock.calls.some(([event]) => event === "uncaughtException")).toBe(false);
344346345347await started.stop();
346348});
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。