diff --git a/src/cli/program/register.backup.test.ts b/src/cli/program/register.backup.test.ts index eeb0c52f84f..45c927f8df0 100644 --- a/src/cli/program/register.backup.test.ts +++ b/src/cli/program/register.backup.test.ts @@ -43,10 +43,11 @@ describe("registerBackupCommand", () => { function expectForwardedOptions(command: typeof backupCreateCommand): Record { expect(command).toHaveBeenCalledTimes(1); - const [runtimeArg, options] = command.mock.calls[0] as unknown as [ - typeof runtime, - Record, - ]; + const call = command.mock.calls.at(0); + if (!call) { + throw new Error("expected backup command call"); + } + const [runtimeArg, options] = call as unknown as [typeof runtime, Record]; expect(runtimeArg).toBe(runtime); return options; }