diff --git a/src/commands/agent.delivery.test.ts b/src/commands/agent.delivery.test.ts index 8c9a0d5b4d52..206de3ff3c53 100644 --- a/src/commands/agent.delivery.test.ts +++ b/src/commands/agent.delivery.test.ts @@ -369,7 +369,7 @@ describe("deliverAgentCommandResult", () => { expect(runtime.log).toHaveBeenCalledTimes(1); expect( - JSON.parse(String((runtime.log as ReturnType).mock.calls.at(0)?.[0])), + JSON.parse(String((runtime.log as ReturnType).mock.calls[0]?.[0])), ).toEqual({ payloads: [ { diff --git a/src/commands/agent.runtime-config.test.ts b/src/commands/agent.runtime-config.test.ts index 03db12f2baf3..5b4d6db34f32 100644 --- a/src/commands/agent.runtime-config.test.ts +++ b/src/commands/agent.runtime-config.test.ts @@ -64,7 +64,7 @@ async function withTempHome(fn: (home: string) => Promise): Promise { } function requireResolveCommandConfigParams(callIndex = 0): ResolveCommandConfigParams { - const call = resolveCommandConfigWithSecretsMock.mock.calls.at(callIndex); + const call = resolveCommandConfigWithSecretsMock.mock.calls[callIndex]; if (!call) { throw new Error(`expected command config resolution call ${callIndex}`); } diff --git a/src/commands/auth-choice.test.ts b/src/commands/auth-choice.test.ts index 8d19572f96ab..899d9ea3ccc1 100644 --- a/src/commands/auth-choice.test.ts +++ b/src/commands/auth-choice.test.ts @@ -639,7 +639,7 @@ describe("applyAuthChoice", () => { expect(promptMessages(mock)).toContain(expected); } function firstCallArg(mock: { mock: { calls: unknown[][] } }): unknown { - const call = mock.mock.calls.at(0); + const call = mock.mock.calls[0]; if (!call) { throw new Error("Expected first mock call"); } diff --git a/src/commands/configure.gateway-auth.prompt-auth-config.test.ts b/src/commands/configure.gateway-auth.prompt-auth-config.test.ts index eeaaa2ea694f..68b93fbce12a 100644 --- a/src/commands/configure.gateway-auth.prompt-auth-config.test.ts +++ b/src/commands/configure.gateway-auth.prompt-auth-config.test.ts @@ -211,7 +211,7 @@ function makeRuntime(): RuntimeEnv { } function promptModelAllowlistOptions(index = 0) { - return mocks.promptModelAllowlist.mock.calls.at(index)?.at(0) as + return mocks.promptModelAllowlist.mock.calls[index]?.[0] as | { allowedKeys?: string[]; initialSelections?: string[]; diff --git a/src/commands/doctor-gateway-daemon-flow.test.ts b/src/commands/doctor-gateway-daemon-flow.test.ts index 5ce67f2747fb..7136da2275c0 100644 --- a/src/commands/doctor-gateway-daemon-flow.test.ts +++ b/src/commands/doctor-gateway-daemon-flow.test.ts @@ -307,7 +307,7 @@ describe("maybeRepairGatewayDaemon", () => { }); expect(readGatewayRestartHandoffSync).toHaveBeenCalledOnce(); - const [handoffEnv] = readGatewayRestartHandoffSync.mock.calls.at(0) as unknown as [ + const [handoffEnv] = readGatewayRestartHandoffSync.mock.calls[0] as unknown as [ { OPENCLAW_STATE_DIR?: string; OPENCLAW_CONFIG_PATH?: string }, ]; expect(handoffEnv?.OPENCLAW_STATE_DIR).toBe("/tmp/openclaw-service"); diff --git a/src/commands/doctor-gateway-services.test.ts b/src/commands/doctor-gateway-services.test.ts index 1511fdbfc3ce..733402414045 100644 --- a/src/commands/doctor-gateway-services.test.ts +++ b/src/commands/doctor-gateway-services.test.ts @@ -202,7 +202,7 @@ function requireRecord(value: unknown, label: string): Record { } function callArg(mock: { mock: { calls: Array> } }, index: number, label: string) { - const call = mock.mock.calls.at(index); + const call = mock.mock.calls[index]; if (!call) { throw new Error(`Expected mock call: ${label}`); } diff --git a/src/commands/migrate.test.ts b/src/commands/migrate.test.ts index 9583bd12bc69..1a54a5050dd8 100644 --- a/src/commands/migrate.test.ts +++ b/src/commands/migrate.test.ts @@ -226,7 +226,7 @@ type MigrationSelectionPrompt = { }; function mockCall(source: MockCallSource, callIndex = 0): ReadonlyArray { - const call = source.mock.calls.at(callIndex); + const call = source.mock.calls[callIndex]; if (!call) { throw new Error(`Expected mock call ${callIndex}`); } diff --git a/src/commands/model-picker.test.ts b/src/commands/model-picker.test.ts index 641982753abb..631412112639 100644 --- a/src/commands/model-picker.test.ts +++ b/src/commands/model-picker.test.ts @@ -182,7 +182,7 @@ function requireRecord(value: unknown, label: string): Record { } function mockArg(source: MockCallSource, callIndex: number, argIndex: number, label: string) { - const call = source.mock.calls.at(callIndex); + const call = source.mock.calls[callIndex]; if (!call) { throw new Error(`expected mock call: ${label}`); } @@ -617,7 +617,7 @@ describe("promptDefaultModel", () => { expect(result.model).toBe("openai-codex/gpt-5.5-pro"); expect(loadModelCatalog).toHaveBeenCalledOnce(); expect(select).toHaveBeenCalledTimes(2); - expect(select.mock.calls.at(1)?.[0]?.searchable).toBe(true); + expect(select.mock.calls[1]?.[0]?.searchable).toBe(true); }); it("supports configuring vLLM during setup", async () => {