We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d3c3b1e commit 9828b57Copy full SHA for 9828b57
src/App.test.tsx
@@ -5,3 +5,17 @@ import App from './App'
5
test('renders learn react link', () => {
6
render(<App />)
7
})
8
+// Add this before your tests run
9
+Object.defineProperty(window, 'matchMedia', {
10
+ writable: true,
11
+ value: jest.fn().mockImplementation(query => ({
12
+ matches: false,
13
+ media: query,
14
+ onchange: null,
15
+ addListener: jest.fn(), // deprecated
16
+ removeListener: jest.fn(), // deprecated
17
+ addEventListener: jest.fn(),
18
+ removeEventListener: jest.fn(),
19
+ dispatchEvent: jest.fn(),
20
+ })),
21
+});
0 commit comments