Skip to content

Commit

Permalink
deps/jest: Add jsdom-global to dev dependencies
Browse files Browse the repository at this point in the history
For a later test, we'll want to be able to set up the test environment
to appear as though it's a browser at a specified URL. Jest currently
uses `jsdom` as its mock-browser environment, but doesn't (presently)
expose the `jsdom` facilities needed to set the mock `location`. (See
jestjs/jest#5124.)

Fortunately, Jest does allow alternate mock environments. We install
one which is identical to Jest's default environment, except that it
does expose that capability.
  • Loading branch information
rk-for-zulip committed Oct 16, 2019
1 parent b82c6c9 commit 3923062
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,8 @@
"flow-typed": "^2.4.0",
"jest": "^24.9.0",
"jest-cli": "^24.9.0",
"jest-environment-jsdom": "^24.9.0",
"jest-environment-jsdom-global": "^1.2.0",
"jest-extended": "^0.11.2",
"metro-react-native-babel-preset": "^0.54.1",
"prettier": "^1.18.2",
Expand Down
5 changes: 5 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4737,6 +4737,11 @@ jest-each@^24.9.0:
jest-util "^24.9.0"
pretty-format "^24.9.0"

jest-environment-jsdom-global@^1.2.0:
version "1.2.0"
resolved "https://registry.yarnpkg.com/jest-environment-jsdom-global/-/jest-environment-jsdom-global-1.2.0.tgz#dd5b16fe0a0566ee40010d8632be5adf5a5ccb65"
integrity sha512-41cDl0OxzmFY/cnW0COUN+lnt2N2ks1r3V4fAKOnlZ9xIrGy0PNPan+Bz8HP+uQy/8bGV6T7J4Oi7X+h43It6g==

jest-environment-jsdom@^24.9.0:
version "24.9.0"
resolved "https://registry.yarnpkg.com/jest-environment-jsdom/-/jest-environment-jsdom-24.9.0.tgz#4b0806c7fc94f95edb369a69cc2778eec2b7375b"
Expand Down

0 comments on commit 3923062

Please sign in to comment.