Skip to content

Commit 6f33e54

Browse files
committed
fix tests
1 parent e4a0903 commit 6f33e54

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

packages/mobile-sdk-alpha/tests/setup.ts

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,3 +26,20 @@ if (typeof global !== 'undefined') {
2626
console.log = originalConsole.log;
2727
};
2828
}
29+
30+
// Mock window.matchMedia for Tamagui components
31+
if (typeof window !== 'undefined') {
32+
Object.defineProperty(window, 'matchMedia', {
33+
writable: true,
34+
value: vi.fn().mockImplementation(query => ({
35+
matches: false,
36+
media: query,
37+
onchange: null,
38+
addListener: vi.fn(), // deprecated
39+
removeListener: vi.fn(), // deprecated
40+
addEventListener: vi.fn(),
41+
removeEventListener: vi.fn(),
42+
dispatchEvent: vi.fn(),
43+
})),
44+
});
45+
}

0 commit comments

Comments
 (0)