/** * @file setup test env * @author nighca */ /* eslint-disable */ import { configure } from 'mobx' configure({ enforceActions: 'observed' }) // createPortal 会导致 TypeError: parentInstance.children.indexOf is not a function // https://github.com/facebook/react/issues/11565 jest.mock('react-dom', () => { const original = jest.requireActual('react-dom') return { ...original, createPortal: (node: any) => node } }) window.matchMedia = window.matchMedia || function() { return { matches: false, addListener: function() {}, removeListener: function() {} } } window.requestAnimationFrame = window.requestAnimationFrame || function(callback) { setTimeout(callback, 0) }