test: guard daemon service mock call

This commit is contained in:
Peter Steinberger
2026-05-12 05:57:11 +01:00
parent e6b32e6609
commit d2a9b8405c

View File

@@ -37,7 +37,7 @@ function createGatewayParentLikeCommand() {
function expectSingleDaemonCall(mockFn: ReturnType<typeof vi.fn>) {
expect(mockFn).toHaveBeenCalledTimes(1);
const opts = mockFn.mock.calls[0]?.[0] as Record<string, unknown> | undefined;
const opts = mockFn.mock.calls.at(0)?.[0] as Record<string, unknown> | undefined;
if (opts === undefined) {
throw new Error("expected daemon call options");
}