From 08c242b45a520772cdcc4fef07f998c397495ac8 Mon Sep 17 00:00:00 2001 From: Younes ENNAJI Date: Wed, 25 Feb 2026 19:50:01 +0000 Subject: [PATCH] fix test to properly suppress expected console error --- tests/flasher.test.ts | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/tests/flasher.test.ts b/tests/flasher.test.ts index ddd48d87..bc902cba 100644 --- a/tests/flasher.test.ts +++ b/tests/flasher.test.ts @@ -713,7 +713,9 @@ describe('Flasher', () => { }) it('should silently handle non-existent theme', async () => { - // This should not throw, just silently not render + const consoleSpy = vi.spyOn(console, 'error').mockImplementation(() => {}) + + // This should not throw, just log error and continue await flasher.render({ envelopes: [{ type: 'success', @@ -724,7 +726,13 @@ describe('Flasher', () => { }], }) - // Should not throw + // Should not throw and should log error + expect(consoleSpy).toHaveBeenCalledWith( + expect.stringContaining('PHPFlasher: Error rendering envelopes'), + expect.any(Error), + ) + + consoleSpy.mockRestore() }) })