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