test: guard agent auth bash mock calls · openclaw/openclaw@be7ac23
steipete
·
2026-05-12
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -96,7 +96,7 @@ describe("auth external oauth helpers", () => {
|
96 | 96 | }); |
97 | 97 | |
98 | 98 | const resolveParams = requireRecord( |
99 | | -resolveExternalAuthProfilesWithPluginsMock.mock.calls[0]?.[0], |
| 99 | +resolveExternalAuthProfilesWithPluginsMock.mock.calls.at(0)?.[0], |
100 | 100 | "resolve external auth params", |
101 | 101 | ); |
102 | 102 | expect(resolveParams.config).toBe(cfg); |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -29,7 +29,7 @@ describe("logAuthProfileFailureStateChange", () => {
|
29 | 29 | now: 1_700_000_000_000, |
30 | 30 | }); |
31 | 31 | |
32 | | -const consoleLine = warnSpy.mock.calls[0]?.[0]; |
| 32 | +const consoleLine = warnSpy.mock.calls.at(0)?.[0]; |
33 | 33 | expect(typeof consoleLine).toBe("string"); |
34 | 34 | expect(consoleLine).toContain("runId=run-1 forged entry test"); |
35 | 35 | expect(consoleLine).toContain("provider=openai]8;;https://evil.test"); |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -876,7 +876,7 @@ describe("markAuthProfileFailure — WHAM-aware Codex cooldowns", () => {
|
876 | 876 | await markCodexFailureAt({ store, now }); |
877 | 877 | |
878 | 878 | expect(fetchMock).toHaveBeenCalledTimes(1); |
879 | | -const [url, init] = fetchMock.mock.calls[0] as [string, RequestInit]; |
| 879 | +const [url, init] = fetchMock.mock.calls.at(0) as [string, RequestInit]; |
880 | 880 | expect(url).toBe("https://chatgpt.com/backend-api/wham/usage"); |
881 | 881 | expect(init.method).toBe("GET"); |
882 | 882 | const headers = init.headers as Record<string, string>; |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -250,7 +250,7 @@ describe("exec PATH login shell merge", () => {
|
250 | 250 | |
251 | 251 | expect(entries).toEqual(["/usr/bin"]); |
252 | 252 | expect(shellPathMock).toHaveBeenCalledTimes(1); |
253 | | -const shellPathCall = shellPathMock.mock.calls[0]?.[0]; |
| 253 | +const shellPathCall = shellPathMock.mock.calls.at(0)?.[0]; |
254 | 254 | expect(shellPathCall?.env).toBe(process.env); |
255 | 255 | expect(shellPathCall?.timeoutMs).toBe(1234); |
256 | 256 | } finally { |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -400,7 +400,9 @@ async function expectNotifyOnExitWake(tool: ExecToolInstance, expected: Record<s
|
400 | 400 | ); |
401 | 401 | try { |
402 | 402 | await startBackgroundCommand(tool, shellEcho("notify")); |
403 | | -await expect.poll(() => wakeHandler.mock.calls[0]?.[0], NOTIFY_POLL_OPTIONS).toEqual(expected); |
| 403 | +await expect |
| 404 | +.poll(() => wakeHandler.mock.calls.at(0)?.[0], NOTIFY_POLL_OPTIONS) |
| 405 | +.toEqual(expected); |
404 | 406 | } finally { |
405 | 407 | dispose(); |
406 | 408 | } |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。