From c45e890e5d2876753f964355fb9f20557747d57b Mon Sep 17 00:00:00 2001 From: Luke Childs Date: Tue, 11 Apr 2017 13:52:41 +0700 Subject: [PATCH] Add warning to browser recipe --- docs/recipes/browser-testing.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/docs/recipes/browser-testing.md b/docs/recipes/browser-testing.md index 802c0ce43..e90bc9bec 100644 --- a/docs/recipes/browser-testing.md +++ b/docs/recipes/browser-testing.md @@ -9,6 +9,10 @@ This recipe works for any library that needs a mocked browser environment. ## Install browser-env +> **❗️ Important note** +> +>`browser-env` adds properties from the `jsdom` window namespace to the Node.js global namespace. This is explicitly [recommended against](https://github.com/tmpvar/jsdom/wiki/Don't-stuff-jsdom-globals-onto-the-Node-global) by `jsdom`. Please read through the linked wiki page and make sure you understand the caveats. If you don't have lots of dependencies that also require a browser environment then [`window`](https://github.com/lukechilds/window#universal-testing-pattern) may be a better solution. + Install [browser-env](https://github.com/lukechilds/browser-env). > Simulates a global browser environment using jsdom.