commit | author | age | ||
0d9dc7 | 1 | module.exports = function(markup) { |
M | 2 | if (typeof document !== 'undefined') return |
3 | var jsdom = require("jsdom").jsdom | |
4 | global.document = jsdom(markup || '<!doctype html><html><body></body></html>'); | |
2d8253 | 5 | global.window = document.defaultView; |
0d9dc7 | 6 | |
7c26ac | 7 | global.navigator = global.window.navigator = {}; |
0d9dc7 | 8 | navigator.userAgent = 'NodeJs JsDom'; |
M | 9 | navigator.appVersion = ''; |
10 | ||
11 | return document; | |
12 | }; |