/* eslint-env node, browser */
import jsdom from 'jsdom';

if (typeof global.document === 'undefined') {
  global.document = jsdom.jsdom('<!doctype html><html><body></body></html>');
  global.window = global.document.defaultView;
}

global.navigator = window.navigator;

@@ -104,37 +104,35 @@
 %7B%0A  
-global.document =
+const dom = new
  jsdom.
-jsdom
+JSDOM
 ('%3C!
@@ -187,43 +187,67 @@
 bal.
-window = global.document.defaultVie
+document = dom.window.document;%0A  global.window = dom.windo
 w;%0A%7D

Fix jsdom setup