Browse Source

Add functionality

pull/2/head
Luke Childs 9 years ago
parent
commit
26f1022666
  1. 5
      package.json
  2. 4
      src/index.js

5
package.json

@ -22,5 +22,8 @@
"bugs": {
"url": "https://github.com/lukechilds/node-browser-environment/issues"
},
"homepage": "https://github.com/lukechilds/node-browser-environment#readme"
"homepage": "https://github.com/lukechilds/node-browser-environment#readme",
"dependencies": {
"jsdom": "^9.2.0"
}
}

4
src/index.js

@ -0,0 +1,4 @@
global.window = require('jsdom').jsdom('<html><body></body></html>').defaultView;
Object.keys(window).forEach(prop => !global[prop] && (global[prop] = window[prop]));
module.exports = window;
Loading…
Cancel
Save