diff options
author | Yamagishi Kazutoshi <ykzts@desire.sh> | 2017-06-29 20:03:03 +0900 |
---|---|---|
committer | Eugen Rochko <eugen@zeonfederated.com> | 2017-06-29 13:03:03 +0200 |
commit | ead14f5bf0ae43524f055320f373a6e2ce947476 (patch) | |
tree | e5f09b1e85ee8cd53e33fd9888ff04d0f27de297 /spec/javascript | |
parent | 0a53ca444a4bd4b28eddf2064133c38a65d41f2c (diff) |
Upgrade jsdom to version 11.0.0 (#3994)
Diffstat (limited to 'spec/javascript')
-rw-r--r-- | spec/javascript/setup.js | 18 |
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', -}; |