diff --git a/src/storybook.test.ts b/src/storybook.test.ts index 750317cf..e4e9f666 100644 --- a/src/storybook.test.ts +++ b/src/storybook.test.ts @@ -1,2 +1,17 @@ import initStoryshots from '@storybook/addon-storyshots' + +Object.defineProperty(window, 'matchMedia', { + writable: true, + value: jest.fn().mockImplementation(query => ({ + matches: false, + media: query, + onchange: null, + addListener: jest.fn(), // deprecated + removeListener: jest.fn(), // deprecated + addEventListener: jest.fn(), + removeEventListener: jest.fn(), + dispatchEvent: jest.fn() + })) +}) + initStoryshots()