diff --git a/src/agents/auth-profiles/external-oauth.test.ts b/src/agents/auth-profiles/external-oauth.test.ts index 9d6bd180c4f0..26e63d9d3133 100644 --- a/src/agents/auth-profiles/external-oauth.test.ts +++ b/src/agents/auth-profiles/external-oauth.test.ts @@ -96,7 +96,7 @@ describe("auth external oauth helpers", () => { }); const resolveParams = requireRecord( - resolveExternalAuthProfilesWithPluginsMock.mock.calls[0]?.[0], + resolveExternalAuthProfilesWithPluginsMock.mock.calls.at(0)?.[0], "resolve external auth params", ); expect(resolveParams.config).toBe(cfg); diff --git a/src/agents/auth-profiles/state-observation.test.ts b/src/agents/auth-profiles/state-observation.test.ts index 1fbc6abb5ab0..c7c76ae1d3a1 100644 --- a/src/agents/auth-profiles/state-observation.test.ts +++ b/src/agents/auth-profiles/state-observation.test.ts @@ -29,7 +29,7 @@ describe("logAuthProfileFailureStateChange", () => { now: 1_700_000_000_000, }); - const consoleLine = warnSpy.mock.calls[0]?.[0]; + const consoleLine = warnSpy.mock.calls.at(0)?.[0]; expect(typeof consoleLine).toBe("string"); expect(consoleLine).toContain("runId=run-1 forged entry test"); expect(consoleLine).toContain("provider=openai]8;;https://evil.test"); diff --git a/src/agents/auth-profiles/usage.test.ts b/src/agents/auth-profiles/usage.test.ts index 05753d47b147..7e402a56885c 100644 --- a/src/agents/auth-profiles/usage.test.ts +++ b/src/agents/auth-profiles/usage.test.ts @@ -876,7 +876,7 @@ describe("markAuthProfileFailure — WHAM-aware Codex cooldowns", () => { await markCodexFailureAt({ store, now }); expect(fetchMock).toHaveBeenCalledTimes(1); - const [url, init] = fetchMock.mock.calls[0] as [string, RequestInit]; + const [url, init] = fetchMock.mock.calls.at(0) as [string, RequestInit]; expect(url).toBe("https://chatgpt.com/backend-api/wham/usage"); expect(init.method).toBe("GET"); const headers = init.headers as Record; diff --git a/src/agents/bash-tools.exec.path.test.ts b/src/agents/bash-tools.exec.path.test.ts index 456b80f15371..1136f6001e73 100644 --- a/src/agents/bash-tools.exec.path.test.ts +++ b/src/agents/bash-tools.exec.path.test.ts @@ -250,7 +250,7 @@ describe("exec PATH login shell merge", () => { expect(entries).toEqual(["/usr/bin"]); expect(shellPathMock).toHaveBeenCalledTimes(1); - const shellPathCall = shellPathMock.mock.calls[0]?.[0]; + const shellPathCall = shellPathMock.mock.calls.at(0)?.[0]; expect(shellPathCall?.env).toBe(process.env); expect(shellPathCall?.timeoutMs).toBe(1234); } finally { diff --git a/src/agents/bash-tools.test.ts b/src/agents/bash-tools.test.ts index 3080fcde4ac8..cf1e9c5b3d4c 100644 --- a/src/agents/bash-tools.test.ts +++ b/src/agents/bash-tools.test.ts @@ -400,7 +400,9 @@ async function expectNotifyOnExitWake(tool: ExecToolInstance, expected: Record wakeHandler.mock.calls[0]?.[0], NOTIFY_POLL_OPTIONS).toEqual(expected); + await expect + .poll(() => wakeHandler.mock.calls.at(0)?.[0], NOTIFY_POLL_OPTIONS) + .toEqual(expected); } finally { dispose(); }