

























@@ -175,7 +175,7 @@ function callArg(
175175argIndex: number,
176176label: string,
177177) {
178-const call = mock.mock.calls.at(callIndex);
178+const call = mock.mock.calls[callIndex];
179179if (!call) {
180180throw new Error(`Expected mock call: ${label}`);
181181}
@@ -185,6 +185,14 @@ function callArg(
185185return call[argIndex];
186186}
187187188+function firstSystemEventCall(): Array<unknown> {
189+const call = enqueueSystemEventMock.mock.calls[0];
190+if (!call) {
191+throw new Error("expected system event call");
192+}
193+return call;
194+}
195+188196async function expectFailoverAttribution(
189197run: Promise<unknown>,
190198expected: { sessionId: string; lane: string },
@@ -290,7 +298,7 @@ describe("runCliAgent reliability", () => {
290298).rejects.toThrow("produced no output");
291299292300expect(enqueueSystemEventMock).toHaveBeenCalledTimes(1);
293-const [notice, opts] = enqueueSystemEventMock.mock.calls.at(0) ?? [];
301+const [notice, opts] = firstSystemEventCall();
294302expect(String(notice)).toContain("produced no output");
295303expect(String(notice)).toContain("interactive input or an approval prompt");
296304expect(requireRecord(opts, "system event options").sessionKey).toBe("agent:main:main");
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。