koel/resources/assets/js/tests/helper.js
2016-06-26 00:05:24 +08:00

13 lines
275 B
JavaScript

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];
}
});