Skip to content

Commit d1cfd3e

Browse files
platinumazureboneskull
authored andcommitted
Improve description of --check-leaks option [ci skip]
Also ensuring the --globals option references --check-leaks as well.
1 parent ce84260 commit d1cfd3e

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

docs/index.md

+3-1
Original file line numberDiff line numberDiff line change
@@ -822,9 +822,11 @@ Enables node's debugger support, this executes your script(s) with `node debug <
822822

823823
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.
824824

825+
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.
826+
825827
### `--check-leaks`
826828

827-
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`.
829+
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`).
828830

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

0 commit comments

Comments
 (0)