Skip to content

Commit 9ea2536

Browse files
committed
test(agents): stabilize headless timeout assertion
1 parent f35adce commit 9ea2536

1 file changed

Lines changed: 10 additions & 12 deletions

File tree

‎src/agents/code-mode-headless.test.ts‎

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -882,18 +882,16 @@ describe("headless Code Mode", () => {
882882
const ctx = createHeadlessHarness();
883883
expectCompleted(await runCodeModeScriptHeadless({ ctx, code: "return true;" }));
884884

885-
expect(
886-
expectFailed(
887-
await runCodeModeScriptHeadless({
888-
ctx,
889-
code: "while (true) {}",
890-
wallClockMs: 100,
891-
}),
892-
),
893-
).toMatchObject({
894-
code: "timeout",
895-
error: "code mode timeout exceeded",
896-
});
885+
const result = expectFailed(
886+
await runCodeModeScriptHeadless({
887+
ctx,
888+
code: "while (true) {}",
889+
wallClockMs: 100,
890+
}),
891+
);
892+
893+
expect(result.code).toBe("timeout");
894+
expect(result.error).toContain("timeout exceeded");
897895
});
898896

899897
it("classifies syntax errors", async () => {

0 commit comments

Comments
 (0)