From ea27bce7e2db121c6f4f11a7c8d4d521ce6099e6 Mon Sep 17 00:00:00 2001 From: Shakker Date: Sun, 10 May 2026 23:55:45 +0100 Subject: [PATCH] test: tighten matrix http client request assertion --- .../matrix/src/matrix/sdk/http-client.test.ts | 27 ++++++++++--------- 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/extensions/matrix/src/matrix/sdk/http-client.test.ts b/extensions/matrix/src/matrix/sdk/http-client.test.ts index 22a670989f6e..c992b358bc96 100644 --- a/extensions/matrix/src/matrix/sdk/http-client.test.ts +++ b/extensions/matrix/src/matrix/sdk/http-client.test.ts @@ -48,18 +48,21 @@ describe("MatrixAuthedHttpClient", () => { }); expect(result).toEqual({ ok: true }); - expect(performMatrixRequestMock).toHaveBeenCalledWith( - expect.objectContaining({ - method: "GET", - endpoint: "https://matrix.example.org/_matrix/client/v3/account/whoami", - allowAbsoluteEndpoint: true, - ssrfPolicy: { allowPrivateNetwork: true }, - dispatcherPolicy: { - mode: "explicit-proxy", - proxyUrl: "http://proxy.internal:8080", - }, - }), - ); + expect(performMatrixRequestMock).toHaveBeenCalledWith({ + homeserver: "https://matrix.example.org", + accessToken: "token", + method: "GET", + endpoint: "https://matrix.example.org/_matrix/client/v3/account/whoami", + qs: undefined, + body: undefined, + timeoutMs: 5000, + ssrfPolicy: { allowPrivateNetwork: true }, + dispatcherPolicy: { + mode: "explicit-proxy", + proxyUrl: "http://proxy.internal:8080", + }, + allowAbsoluteEndpoint: true, + }); }); it("returns plain text when response is not JSON", async () => {