setupTests.js 559 B

12345678910111213141516
  1. /* eslint-disable import/first */
  2. global.requestAnimationFrame =
  3. global.requestAnimationFrame || function requestAnimationFrame(callback) {
  4. setTimeout(callback, 0);
  5. };
  6. import { jsdom } from 'jsdom';
  7. import Enzyme from 'enzyme';
  8. import Adapter from 'enzyme-adapter-react-16';
  9. Enzyme.configure({ adapter: new Adapter() });
  10. // fixed jsdom miss
  11. const documentHTML = '<!doctype html><html><body><div id="root"></div></body></html>';
  12. global.document = jsdom(documentHTML);
  13. global.window = document.defaultView;
  14. global.navigator = global.window.navigator;