about summary refs log tree commit diff
path: root/spec/javascript/setup.js
blob: ab8a36b95f3bbcdfc244c9eb66966971396aeffc (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
import { JSDOM } from 'jsdom';
import Enzyme from 'enzyme';
import Adapter from 'enzyme-adapter-react-16';

Enzyme.configure({ adapter: new Adapter() });

const { window } = new JSDOM('', {
  userAgent: 'node.js',
});

Object.keys(window).forEach(property => {
  if (typeof global[property] === 'undefined') {
    global[property] = window[property];
  }
});