Skip to content

Commit

Permalink
Recipe instructions for making jQuery available in browser (#1543)
Browse files Browse the repository at this point in the history
  • Loading branch information
ptim authored and sindresorhus committed Oct 15, 2017
1 parent 68ce4b8 commit f43d5ae
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions docs/recipes/browser-testing.md
Expand Up @@ -38,6 +38,16 @@ import browserEnv from 'browser-env';
browserEnv(['window', 'document', 'navigator']);
```

You can expose more global variables by assigning them to the `global` object. For instance, jQuery is typically available through the `$` variable:

```js
import browserEnv from 'browser-env';
import jQuery from 'jquery';

browserEnv();
global.$ = jQuery(window);
```

## Configure tests to use browser-env

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

0 comments on commit f43d5ae

Please sign in to comment.