diff --git a/extensions/matrix/src/matrix/send-queue.test.ts b/extensions/matrix/src/matrix/send-queue.test.ts index bc90c5f50..aa4765eaa 100644 --- a/extensions/matrix/src/matrix/send-queue.test.ts +++ b/extensions/matrix/src/matrix/send-queue.test.ts @@ -79,8 +79,11 @@ describe("enqueueSend", () => { await vi.advanceTimersByTimeAsync(DEFAULT_SEND_GAP_MS); const firstResult = await first; expect(firstResult.ok).toBe(false); + if (firstResult.ok) { + throw new Error("expected first queue item to fail"); + } expect(firstResult.error).toBeInstanceOf(Error); - expect((firstResult.error as Error).message).toBe("boom"); + expect(firstResult.error.message).toBe("boom"); const second = enqueueSend("!room:example.org", async () => "ok"); await vi.advanceTimersByTimeAsync(DEFAULT_SEND_GAP_MS); @@ -110,6 +113,9 @@ describe("enqueueSend", () => { gate.resolve(); const firstResult = await first; expect(firstResult.ok).toBe(false); + if (firstResult.ok) { + throw new Error("expected head queue item to fail"); + } expect(firstResult.error).toBeInstanceOf(Error); await vi.advanceTimersByTimeAsync(DEFAULT_SEND_GAP_MS); diff --git a/src/auto-reply/reply/followup-runner.test.ts b/src/auto-reply/reply/followup-runner.test.ts index a9d4249e5..7627c79a5 100644 --- a/src/auto-reply/reply/followup-runner.test.ts +++ b/src/auto-reply/reply/followup-runner.test.ts @@ -64,7 +64,7 @@ const baseQueuedRun = (messageProvider = "whatsapp"): FollowupRun => }) as FollowupRun; function createQueuedRun( - overrides: Partial & { run?: Partial } = {}, + overrides: Partial> & { run?: Partial } = {}, ): FollowupRun { const base = baseQueuedRun(); return {