diff --git a/src/utils/directive-tags.test.ts b/src/utils/directive-tags.test.ts index 39751043981..7010b6ad270 100644 --- a/src/utils/directive-tags.test.ts +++ b/src/utils/directive-tags.test.ts @@ -216,9 +216,10 @@ describe("stripInlineDirectiveTagsFromMessageForDisplay", () => { content: [{ type: "text", text: "hello [[reply_to_current]] world [[audio_as_voice]]" }], }; const result = stripInlineDirectiveTagsFromMessageForDisplay(input); - expect(result).toMatchObject({ - content: [{ type: "text", text: "hello world " }], - }); + if (!result) { + throw new Error("expected stripped message"); + } + expect(result.content).toEqual([{ type: "text", text: "hello world " }]); }); test("preserves empty-string text when directives are entire content", () => { @@ -227,9 +228,10 @@ describe("stripInlineDirectiveTagsFromMessageForDisplay", () => { content: [{ type: "text", text: "[[reply_to_current]]" }], }; const result = stripInlineDirectiveTagsFromMessageForDisplay(input); - expect(result).toMatchObject({ - content: [{ type: "text", text: "" }], - }); + if (!result) { + throw new Error("expected stripped message"); + } + expect(result.content).toEqual([{ type: "text", text: "" }]); }); test("returns original message when content is not an array", () => {