All files / testHelpers jsdomHelper.js

42.86% Statements 3/7
25% Branches 1/4
100% Functions 1/1
42.86% Lines 3/7
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'
	};
};