




















@@ -939,7 +939,7 @@ describe("runCodexAppServerAttempt", () => {
939939params.onAgentEvent = onRunAgentEvent;
940940const run = runCodexAppServerAttempt(params);
941941await harness.waitForMethod("turn/start");
942-await vi.waitFor(() => expect(llmInput).toHaveBeenCalled(), { interval: 1 });
942+expect(llmInput).toHaveBeenCalled();
943943944944expect(llmInput.mock.calls).toEqual(
945945expect.arrayContaining([
@@ -976,8 +976,8 @@ describe("runCodexAppServerAttempt", () => {
976976const result = await run;
977977978978expect(result.assistantTexts).toEqual(["hello back"]);
979-await vi.waitFor(() => expect(llmOutput).toHaveBeenCalledTimes(1), { interval: 1 });
980-await vi.waitFor(() => expect(agentEnd).toHaveBeenCalledTimes(1), { interval: 1 });
979+expect(llmOutput).toHaveBeenCalledTimes(1);
980+expect(agentEnd).toHaveBeenCalledTimes(1);
981981const agentEvents = onRunAgentEvent.mock.calls.map(([event]) => event);
982982expect(agentEvents).toEqual(
983983expect.arrayContaining([
@@ -1387,7 +1387,7 @@ describe("runCodexAppServerAttempt", () => {
13871387const result = await run;
1388138813891389expect(result.promptError).toBe("codex exploded");
1390-await vi.waitFor(() => expect(agentEnd).toHaveBeenCalledTimes(1), { interval: 1 });
1390+expect(agentEnd).toHaveBeenCalledTimes(1);
13911391const agentEvents = onRunAgentEvent.mock.calls.map(([event]) => event);
13921392expect(agentEvents).toEqual(
13931393expect.arrayContaining([
@@ -1446,9 +1446,9 @@ describe("runCodexAppServerAttempt", () => {
14461446runCodexAppServerAttempt(createParamsWithRuntimePlan(sessionFile, workspaceDir)),
14471447).rejects.toThrow("turn start exploded");
144814481449-await vi.waitFor(() => expect(llmInput).toHaveBeenCalledTimes(1), { interval: 1 });
1450-await vi.waitFor(() => expect(llmOutput).toHaveBeenCalledTimes(1), { interval: 1 });
1451-await vi.waitFor(() => expect(agentEnd).toHaveBeenCalledTimes(1), { interval: 1 });
1449+expect(llmInput).toHaveBeenCalledTimes(1);
1450+expect(llmOutput).toHaveBeenCalledTimes(1);
1451+expect(agentEnd).toHaveBeenCalledTimes(1);
14521452expect(llmOutput).toHaveBeenCalledWith(
14531453expect.objectContaining({
14541454assistantTexts: [],
@@ -1489,7 +1489,7 @@ describe("runCodexAppServerAttempt", () => {
1489148914901490const result = await run;
14911491expect(result.aborted).toBe(true);
1492-await vi.waitFor(() => expect(agentEnd).toHaveBeenCalledTimes(1), { interval: 1 });
1492+expect(agentEnd).toHaveBeenCalledTimes(1);
14931493expect(agentEnd).toHaveBeenCalledWith(
14941494expect.objectContaining({
14951495success: false,
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。