Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
import { JSDOM } from 'jsdom';
import Enzyme from 'enzyme';
import Adapter from 'enzyme-adapter-react-16.2';
import { createElementMock } from './setup-canvas-jsdom';
Enzyme.configure({ adapter: new Adapter() });
const dom = new JSDOM('', {
useAgent: 'node.js',
});
global.window = dom.window;
global.document = dom.window.document;
global.navigator = dom.window.navigator;
// needed by elements/functions using canvas:
// <select>, , filterTickValuesByWidth
global.document.createElement = createElementMock.bind(
null,
document.createElement.bind(document),
);
// needed by interact.js</select>