setupTests.js 443 Bytes
Newer Older
afc163's avatar
afc163 committed
1 2
/* eslint-disable import/first */
import '../src/polyfill';
偏右's avatar
偏右 committed
3
import { jsdom } from 'jsdom';
afc163's avatar
afc163 committed
4
import Enzyme from 'enzyme';
afc163's avatar
afc163 committed
5
import Adapter from 'enzyme-adapter-react-16';
afc163's avatar
afc163 committed
6 7

Enzyme.configure({ adapter: new Adapter() });
偏右's avatar
偏右 committed
8 9 10 11 12 13

// 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;