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