koel/resources/assets/js/tests/helper.js

14 lines
283 B
JavaScript
Raw Normal View History

2016-06-25 10:15:57 +00:00
import { jsdom } from 'jsdom';
const doc = jsdom('<!doctype html><html><body></body></html>');
const win = doc.defaultView;
global.document = doc;
global.window = win;
Object.keys(window).forEach((key) => {
if (!(key in global)) {
global[key] = window[key];
}
});