tldraw/setupTests.ts

18 lines
509 B
TypeScript
Raw Normal View History

2021-08-14 15:46:21 +00:00
import '@testing-library/jest-dom/extend-expect'
import 'fake-indexeddb/auto'
global.ResizeObserver = require('resize-observer-polyfill')
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(),
})),
})