

























@@ -53,6 +53,14 @@ function buildPreparedCliRunContext(params: {
5353};
5454}
555556+function requireSupervisorSpawnInput(): SupervisorSpawnInput {
57+const call = supervisorSpawnMock.mock.calls[0];
58+if (!call) {
59+throw new Error("Expected supervisor spawn");
60+}
61+return call[0] as SupervisorSpawnInput;
62+}
63+5664beforeEach(() => {
5765resetAgentEventsForTest();
5866supervisorSpawnMock.mockReset();
@@ -78,7 +86,7 @@ describe("executePreparedCliRun supervisor output capture", () => {
7886});
79878088const result = await executePreparedCliRun(buildPreparedCliRunContext({ output: "text" }));
81-const spawnInput = supervisorSpawnMock.mock.calls.at(0)?.[0] as SupervisorSpawnInput;
89+const spawnInput = requireSupervisorSpawnInput();
82908391expect(spawnInput.captureOutput).toBe(false);
8492expect(result.rawText).toBe(fullText);
@@ -107,7 +115,7 @@ describe("executePreparedCliRun supervisor output capture", () => {
107115await expect(
108116executePreparedCliRun(buildPreparedCliRunContext({ output: "text" })),
109117).rejects.toThrow("CLI stdout exceeded");
110-const spawnInput = supervisorSpawnMock.mock.calls.at(0)?.[0] as SupervisorSpawnInput;
118+const spawnInput = requireSupervisorSpawnInput();
111119112120expect(spawnInput.captureOutput).toBe(false);
113121});
@@ -281,7 +289,7 @@ describe("executePreparedCliRun supervisor output capture", () => {
281289const result = await executePreparedCliRun(
282290buildPreparedCliRunContext({ output: "jsonl", provider: "claude-cli" }),
283291);
284-const spawnInput = supervisorSpawnMock.mock.calls.at(0)?.[0] as SupervisorSpawnInput;
292+const spawnInput = requireSupervisorSpawnInput();
285293286294expect(spawnInput.captureOutput).toBe(false);
287295expect(result.text).toBe("Hello world");
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。