UNPKG

412 BJavaScriptView Raw
1'use strict';
2
3var _jsdom = require('jsdom');
4
5module.exports = function (props) {
6 var window = (0, _jsdom.jsdom)('<html><body></body></html>').defaultView;
7
8 Object.keys(window).forEach(function (prop) {
9 if (typeof global[prop] === 'undefined') {
10 if (props instanceof Array && props.indexOf(prop) === -1) {
11 return;
12 }
13 global[prop] = window[prop];
14 }
15 });
16
17 return window;
18};
\No newline at end of file