1 changed files with 12 additions and 7 deletions
@ -1,8 +1,13 @@ |
|||||
global.window = require('jsdom').jsdom('<html><body></body></html>').defaultView; |
var jsdom = require('jsdom').jsdom; |
||||
Object.keys(window).forEach(function(prop) { |
|
||||
if(typeof global[prop] === 'undefined') { |
|
||||
global[prop] = window[prop]; |
|
||||
} |
|
||||
}); |
|
||||
|
|
||||
module.exports = window; |
module.exports = function() { |
||||
|
global.window = jsdom('<html><body></body></html>').defaultView; |
||||
|
|
||||
|
Object.keys(window).forEach(function(prop) { |
||||
|
if(typeof global[prop] === 'undefined') { |
||||
|
global[prop] = window[prop]; |
||||
|
} |
||||
|
}); |
||||
|
|
||||
|
return window; |
||||
|
}; |
||||
|
Loading…
Reference in new issue