From ad48b6e409b5421a42fea222beab50579f46953e Mon Sep 17 00:00:00 2001 From: m-tartari <37861893+m-tartari@users.noreply.github.com> Date: Sat, 17 Feb 2024 14:36:39 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=A7=20chore(vitest):=20mock=20the=20Re?= =?UTF-8?q?sizeObserver=20API?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit used by ParallaxProvider --- vitest.setup.ts | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/vitest.setup.ts b/vitest.setup.ts index b92f6ef..ab619fc 100644 --- a/vitest.setup.ts +++ b/vitest.setup.ts @@ -13,3 +13,15 @@ afterEach(() => { vi.resetAllMocks() cleanup() }) + +/** + * Mocks the ResizeObserver API (used by ParallaxProvider) + */ +vi.stubGlobal( + 'ResizeObserver', + vi.fn().mockImplementation(() => ({ + observe: vi.fn(), + unobserve: vi.fn(), + disconnect: vi.fn(), + })) +)