Skip to content

Commit

Permalink
Improve description of --check-leaks option [ci skip]
Browse files Browse the repository at this point in the history
Also ensuring the --globals option references --check-leaks as well.
  • Loading branch information
platinumazure authored and boneskull committed Dec 9, 2017
1 parent ce84260 commit d1cfd3e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -822,9 +822,11 @@ Enables node's debugger support, this executes your script(s) with `node debug <

Accepts a comma-delimited list of accepted global variable names. For example, suppose your app deliberately exposes a global named `app` and `YUI`, you may want to add `--globals app,YUI`. It also accepts wildcards. You could do `--globals '*bar'` and it would match `foobar`, `barbar`, etc. You can also simply pass in `'*'` to ignore all globals.

By using this option in conjunction with `--check-leaks`, you can specify a whitelist of known global variables that you would expect to leak into global scope.

### `--check-leaks`

By default, Mocha will not check for global variables leaked while running tests, to enable this pass `--check-leaks`, to specify globals that are acceptable use `--globals`, for example `--globals jQuery,MyLib`.
Use this option to have Mocha check for global variables that are leaked while running tests. Specify globals that are acceptable via the `--globals` option (for example: `--check-leaks --globals jQuery,MyLib`).

### `-r, --require <module-name>`

Expand Down

0 comments on commit d1cfd3e

Please sign in to comment.