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

14 lines
275 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) => {
2016-06-25 16:05:24 +00:00
if (!(key in global)) {
global[key] = window[key];
}
2016-06-25 10:15:57 +00:00
});