From 7b86539be284147aa105c3ceb73cd4d0f13ad6e9 Mon Sep 17 00:00:00 2001 From: Peter Steinberger Date: Wed, 13 May 2026 05:13:15 +0100 Subject: [PATCH] test: dedupe auto reply helper mock read --- test/helpers/auto-reply/trigger-handling-test-harness.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test/helpers/auto-reply/trigger-handling-test-harness.ts b/test/helpers/auto-reply/trigger-handling-test-harness.ts index 6acd3f637f8..54ca47cac9e 100644 --- a/test/helpers/auto-reply/trigger-handling-test-harness.ts +++ b/test/helpers/auto-reply/trigger-handling-test-harness.ts @@ -354,7 +354,8 @@ export async function expectInlineCommandHandledAndStripped(params: { expect(blockReplies.length).toBe(1); expect(blockReplies[0]?.text).toContain(params.blockReplyContains); expect(runEmbeddedPiAgentMock).toHaveBeenCalled(); - const prompt = runEmbeddedPiAgentMock.mock.calls.at(-1)?.[0]?.prompt ?? ""; + const lastCall = runEmbeddedPiAgentMock.mock.calls[runEmbeddedPiAgentMock.mock.calls.length - 1]; + const prompt = lastCall?.[0]?.prompt ?? ""; expect(prompt).not.toContain(params.stripToken); expect(text).toBe("ok"); }