about summary refs log tree commit diff
path: root/spec
diff options
context:
space:
mode:
authorYamagishi Kazutoshi <ykzts@desire.sh>2017-06-29 20:03:03 +0900
committerEugen Rochko <eugen@zeonfederated.com>2017-06-29 13:03:03 +0200
commitead14f5bf0ae43524f055320f373a6e2ce947476 (patch)
treee5f09b1e85ee8cd53e33fd9888ff04d0f27de297 /spec
parent0a53ca444a4bd4b28eddf2064133c38a65d41f2c (diff)
Upgrade jsdom to version 11.0.0 (#3994)
Diffstat (limited to 'spec')
-rw-r--r--spec/javascript/setup.js18
1 files changed, 6 insertions, 12 deletions
diff --git a/spec/javascript/setup.js b/spec/javascript/setup.js
index 7d4b2866e..c9c8aed07 100644
--- a/spec/javascript/setup.js
+++ b/spec/javascript/setup.js
@@ -1,19 +1,13 @@
-import { jsdom } from 'jsdom/lib/old-api';
+import { JSDOM } from 'jsdom';
 import chai from 'chai';
 import chaiEnzyme from 'chai-enzyme';
 chai.use(chaiEnzyme());
 
-var exposedProperties = ['window', 'navigator', 'document'];
-
-global.document = jsdom('');
-global.window = document.defaultView;
-Object.keys(document.defaultView).forEach((property) => {
+const { window } = new JSDOM('', {
+  userAgent: 'node.js',
+});
+Object.keys(window).forEach(property => {
   if (typeof global[property] === 'undefined') {
-    exposedProperties.push(property);
-    global[property] = document.defaultView[property];
+    global[property] = window[property];
   }
 });
-
-global.navigator = {
-  userAgent: 'node.js',
-};