1 2 3 4 5 6 7 8 9 10 11 12 13 14 | 5x 5x 5x | module.exports = function (html) { Eif (typeof document !== 'undefined') { return; } var jsdom = require('jsdom').jsdom; global.document = jsdom(html || ''); global.window = global.document.defaultView; global.navigator = { userAgent: 'JSDOM' }; }; |