test: guard gateway run loop mock calls

This commit is contained in:
Peter Steinberger
2026-05-12 07:20:43 +01:00
parent 5a432aacd7
commit dad240eecd

View File

@@ -289,7 +289,7 @@ function expectRestartHandoffCall(expected: {
supervisorMode: "external" | "launchd";
}) {
expect(writeGatewayRestartHandoffSync).toHaveBeenCalledTimes(1);
const [handoff] = writeGatewayRestartHandoffSync.mock.calls[0] ?? [];
const [handoff] = writeGatewayRestartHandoffSync.mock.calls.at(0) ?? [];
if (!handoff || typeof handoff !== "object" || Array.isArray(handoff)) {
throw new Error("expected restart handoff options object");
}