2017-06-29 21:03:03 +10:00
|
|
|
import { JSDOM } from 'jsdom';
|
2017-09-30 12:29:56 +10:00
|
|
|
import Enzyme from 'enzyme';
|
|
|
|
import Adapter from 'enzyme-adapter-react-16';
|
|
|
|
|
|
|
|
Enzyme.configure({ adapter: new Adapter() });
|
2016-10-13 03:06:18 +11:00
|
|
|
|
2017-06-29 21:03:03 +10:00
|
|
|
const { window } = new JSDOM('', {
|
|
|
|
userAgent: 'node.js',
|
|
|
|
});
|
2017-09-30 12:29:56 +10:00
|
|
|
|
2017-06-29 21:03:03 +10:00
|
|
|
Object.keys(window).forEach(property => {
|
2016-10-11 07:32:03 +11:00
|
|
|
if (typeof global[property] === 'undefined') {
|
2017-06-29 21:03:03 +10:00
|
|
|
global[property] = window[property];
|
2016-10-11 07:32:03 +11:00
|
|
|
}
|
|
|
|
});
|