setupTests.js 392 Bytes
Newer Older
偏右's avatar
偏右 committed
1 2 3 4 5 6 7 8 9 10 11
import { jsdom } from 'jsdom';

// fixed jsdom miss
const documentHTML = '<!doctype html><html><body><div id="root"></div></body></html>';
global.document = jsdom(documentHTML);
global.window = document.defaultView;
global.navigator = global.window.navigator;

global.requestAnimationFrame = global.requestAnimationFrame || function requestAnimationFrame(cb) {
  return setTimeout(cb, 0);
};