mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-12 16:20:44 +00:00
test: tighten bonjour callback assertions
This commit is contained in:
@@ -282,11 +282,10 @@ describe("gateway bonjour advertiser", () => {
|
||||
const started = await startAdvertiser({ gatewayPort: 18789 });
|
||||
childProcessModule.exec('arp -a | findstr /C:"---"', () => {});
|
||||
|
||||
expect(execMock).toHaveBeenCalledWith(
|
||||
'arp -a | findstr /C:"---"',
|
||||
{ windowsHide: true },
|
||||
expect.any(Function),
|
||||
);
|
||||
const execCall = execMock.mock.calls[0];
|
||||
expect(execCall?.[0]).toBe('arp -a | findstr /C:"---"');
|
||||
expect(execCall?.[1]).toEqual({ windowsHide: true });
|
||||
expect(execCall?.[2]).toBeTypeOf("function");
|
||||
|
||||
await started.stop();
|
||||
childProcessModule.exec('arp -a | findstr /C:"---"', () => {});
|
||||
@@ -339,8 +338,11 @@ describe("gateway bonjour advertiser", () => {
|
||||
{ logger },
|
||||
);
|
||||
|
||||
expect(processOn).toHaveBeenCalledWith("unhandledRejection", expect.any(Function));
|
||||
expect(processOn).not.toHaveBeenCalledWith("uncaughtException", expect.any(Function));
|
||||
const unhandledRejectionRegistration = processOn.mock.calls.find(
|
||||
([event]) => event === "unhandledRejection",
|
||||
);
|
||||
expect(unhandledRejectionRegistration?.[1]).toBeTypeOf("function");
|
||||
expect(processOn.mock.calls.some(([event]) => event === "uncaughtException")).toBe(false);
|
||||
|
||||
await started.stop();
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user