diff --git a/extensions/signal/src/client.test.ts b/extensions/signal/src/client.test.ts index 48d2dd0ab5d..05c2fe42803 100644 --- a/extensions/signal/src/client.test.ts +++ b/extensions/signal/src/client.test.ts @@ -95,14 +95,21 @@ describe("signalRpcRequest", () => { res.end("not-json"); }); - await expect( - signalRpcRequest("version", undefined, { + let thrown: unknown; + try { + await signalRpcRequest("version", undefined, { baseUrl, - }), - ).rejects.toMatchObject({ - message: "Signal RPC returned malformed JSON (status 502)", - cause: expect.any(SyntaxError), - }); + }); + } catch (error) { + thrown = error; + } + + expect(thrown).toBeInstanceOf(Error); + if (!(thrown instanceof Error)) { + throw new Error("expected malformed JSON request to throw an Error"); + } + expect(thrown.message).toBe("Signal RPC returned malformed JSON (status 502)"); + expect(thrown.cause).toBeInstanceOf(SyntaxError); }); it("throws when RPC response envelope has neither result nor error", async () => { diff --git a/extensions/signal/src/message-actions.test.ts b/extensions/signal/src/message-actions.test.ts index d77ee50de7f..6d71ebf1c93 100644 --- a/extensions/signal/src/message-actions.test.ts +++ b/extensions/signal/src/message-actions.test.ts @@ -136,6 +136,12 @@ describe("signalMessageActions", () => { for (const testCase of cases) { sendReactionSignalMock.mockClear(); + const expectedOptions = testCase.expectedOptions as { + accountId?: string; + groupId?: string; + targetAuthor?: string; + targetAuthorUuid?: string; + }; await signalMessageActions.handleAction?.({ channel: "signal", action: "react", @@ -149,10 +155,13 @@ describe("signalMessageActions", () => { testCase.expectedRecipient, testCase.expectedTimestamp, testCase.expectedEmoji, - expect.objectContaining({ + { cfg: testCase.cfg, - ...testCase.expectedOptions, - }), + accountId: expectedOptions.accountId, + groupId: expectedOptions.groupId, + targetAuthor: expectedOptions.targetAuthor, + targetAuthorUuid: expectedOptions.targetAuthorUuid, + }, ); } });