Skip to content

Commit f43d5ae

Browse files
ptimsindresorhus
authored andcommitted
Recipe instructions for making jQuery available in browser (#1543)
1 parent 68ce4b8 commit f43d5ae

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

docs/recipes/browser-testing.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,16 @@ import browserEnv from 'browser-env';
3838
browserEnv(['window', 'document', 'navigator']);
3939
```
4040

41+
You can expose more global variables by assigning them to the `global` object. For instance, jQuery is typically available through the `$` variable:
42+
43+
```js
44+
import browserEnv from 'browser-env';
45+
import jQuery from 'jquery';
46+
47+
browserEnv();
48+
global.$ = jQuery(window);
49+
```
50+
4151
## Configure tests to use browser-env
4252

4353
Configure AVA to `require` the helper before every test file.

0 commit comments

Comments
 (0)