From 3923062ee3f85010088eeac77a6af11062378e76 Mon Sep 17 00:00:00 2001 From: Ray Kraesig Date: Fri, 11 Oct 2019 11:06:46 -0700 Subject: [PATCH] deps/jest: Add `jsdom-global` to dev dependencies 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 facebook/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. --- package.json | 2 ++ yarn.lock | 5 +++++ 2 files changed, 7 insertions(+) diff --git a/package.json b/package.json index acfef3a9741..72841b66ff8 100644 --- a/package.json +++ b/package.json @@ -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", diff --git a/yarn.lock b/yarn.lock index 9c088ebc935..900aa02281f 100644 --- a/yarn.lock +++ b/yarn.lock @@ -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"