Skip to content

Commit c01ac05

Browse files
lukechildsnovemberborn
authored andcommitted
Add warning to browser recipe (#1355)
1 parent 4cc3403 commit c01ac05

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

docs/recipes/browser-testing.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@ This recipe works for any library that needs a mocked browser environment.
99

1010
## Install browser-env
1111

12+
> **❗️ Important note**
13+
>
14+
>`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.
15+
1216
Install [browser-env](https://github.com/lukechilds/browser-env).
1317

1418
> Simulates a global browser environment using jsdom.

0 commit comments

Comments
 (0)