From fc09643aa24acb3cca7c63c198e4918855aa08de Mon Sep 17 00:00:00 2001 From: Peter Steinberger Date: Wed, 13 May 2026 03:04:11 +0100 Subject: [PATCH] test: dedupe tui command mock reads --- src/tui/tui-command-handlers.test.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/tui/tui-command-handlers.test.ts b/src/tui/tui-command-handlers.test.ts index 9e76db0e914..f82b07f1d19 100644 --- a/src/tui/tui-command-handlers.test.ts +++ b/src/tui/tui-command-handlers.test.ts @@ -22,7 +22,8 @@ function expectSendChatFields( sendChat: ReturnType, expected: { message: string; sessionId?: string; sessionKey?: string }, ) { - const call = sendChat.mock.calls.at(-1); + const calls = sendChat.mock.calls; + const call = calls[calls.length - 1]; if (!call) { throw new Error("expected gateway sendChat call"); } @@ -39,7 +40,7 @@ function expectSendChatFields( type MockWithCalls = { mock: { calls: unknown[][] } }; function firstMockArg(mock: MockWithCalls, label: string) { - const call = mock.mock.calls.at(0); + const call = mock.mock.calls[0]; if (!call) { throw new Error(`expected ${label} call`); }