@amsterdam/design-system-react
Version:
All React components from the Amsterdam Design System. Use it to compose pages in your website or application.
16 lines (15 loc) • 531 B
JavaScript
;
// Sourced from https://jestjs.io/docs/29.4/manual-mocks#mocking-methods-which-are-not-implemented-in-jsdom
Object.defineProperty(window, 'matchMedia', {
value: jest.fn().mockImplementation((query) => ({
addEventListener: jest.fn(),
addListener: jest.fn(), // deprecated
dispatchEvent: jest.fn(),
matches: false,
media: query,
onchange: null,
removeEventListener: jest.fn(),
removeListener: jest.fn(), // deprecated
})),
writable: true,
});