Skip to content

Commit

Permalink
docs
Browse files Browse the repository at this point in the history
  • Loading branch information
juergba committed Jul 25, 2021
1 parent 99a609c commit fd95c88
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 5 deletions.
19 changes: 14 additions & 5 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -876,9 +876,7 @@ Use this option to have Mocha check for global variables that are leaked while r
### `--dry-run`

> _New in v9.0.0._
Report tests without executing any of them, neither tests nor hooks.
> _New in v9.0.0._ Report tests without executing any of them, neither tests nor hooks.
### `--exit`

Expand Down Expand Up @@ -1015,6 +1013,15 @@ Specify an explicit path to a [configuration file](#configuring-mocha-nodejs).

By default, Mocha will search for a config file if `--config` is not specified; use `--no-config` to suppress this behavior.

### `--node-option <name>, -n <name>`

> _New in v9.1.0._
For Node.js and V8 options. Mocha forwards these options to Node.js by spawning a new child-process.<br>
e.g. `-n require=foo -n unhandled-rejections=strict`

Can also be specified as a comma-delimited list: `-n "require=foo, unhandled-rejections=strict"`

### `--opts <path>`

> _Removed in v8.0.0. Please use [configuration file](#configuring-mocha-nodejs) instead._
Expand Down Expand Up @@ -1159,8 +1166,6 @@ Requires either `--grep` or `--fgrep` (but not both).

### `--inspect, --inspect-brk, inspect`

> _BREAKING CHANGE in v7.0.0; `--debug` / `--debug-brk` are removed and `debug` is deprecated._
Enables Node.js' inspector.

Use `--inspect` / `--inspect-brk` to launch the V8 inspector for use with Chrome Dev Tools.
Expand Down Expand Up @@ -1209,6 +1214,8 @@ These flags vary depending on your version of Node.js.

`node` flags can be defined in Mocha's [configuration](#configuring-mocha-nodejs).

> _New in v9.1.0._ You can also pass `node` flags to Node.js using [`--node-option`](#-node-option-name-n-name).
### `--enable-source-maps`

> _New in Node.js v12.12.0_
Expand All @@ -1228,6 +1235,8 @@ Prepend `--v8-` to any flag listed in the output of `node --v8-options` (excludi

V8 flags can be defined in Mocha's [configuration](#configuring-mocha-nodejs).

> _New in v9.1.0._ You can also pass V8 flags (without `--v8-`) to Node.js using [`--node-option`](#-node-option-name-n-name).
## Parallel Tests

> _New in v.8.0.0._
Expand Down
1 change: 1 addition & 0 deletions example/config/.mocharc.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ module.exports = {
'inline-diffs': false,
// invert: false, // needs to be used with grep or fgrep
jobs: 1,
'node-option': ['unhandled-rejections=strict'], // without leading "--", also V8 flags
package: './package.json',
parallel: false,
recursive: false,
Expand Down
2 changes: 2 additions & 0 deletions example/config/.mocharc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ inline-diffs: false
# needs to be used with grep or fgrep
# invert: false
jobs: 1
node-option:
- 'unhandled-rejections=strict' # without leading "--", also V8 flags
package: './package.json'
parallel: false
recursive: false
Expand Down

0 comments on commit fd95c88

Please sign in to comment.