From ec7962fdc3a303ae4befd45f7de2813d55185af8 Mon Sep 17 00:00:00 2001 From: Peter Steinberger Date: Tue, 12 May 2026 23:21:48 +0100 Subject: [PATCH] test: dedupe diagnostics mock reads --- src/gateway/server-methods/diagnostics.test.ts | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/gateway/server-methods/diagnostics.test.ts b/src/gateway/server-methods/diagnostics.test.ts index 4f0197e3f4d..78870bec6a6 100644 --- a/src/gateway/server-methods/diagnostics.test.ts +++ b/src/gateway/server-methods/diagnostics.test.ts @@ -48,7 +48,8 @@ describe("diagnostics gateway methods", () => { }); expect(respond).toHaveBeenCalledTimes(1); - expect(respond.mock.calls.at(0)).toEqual([ + const firstRespondCall = respond.mock.calls[0]; + expect(firstRespondCall).toEqual([ true, { generatedAt: now.toISOString(), @@ -84,9 +85,7 @@ describe("diagnostics gateway methods", () => { }, undefined, ]); - expect( - Object.keys(respond.mock.calls.at(0)?.[1] as Record).toSorted(), - ).toEqual([ + expect(Object.keys(firstRespondCall?.[1] as Record).toSorted()).toEqual([ "capacity", "count", "dropped",