Skip to content

Commit

Permalink
docs [ci skip]
Browse files Browse the repository at this point in the history
  • Loading branch information
juergba committed Jul 19, 2021
1 parent 96e196a commit baf4095
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 2 deletions.
19 changes: 17 additions & 2 deletions docs/index.md
Expand Up @@ -1015,6 +1015,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 +1168,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 +1216,10 @@ 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 +1239,10 @@ 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
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
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 baf4095

Please sign in to comment.