MochaConfig
Index
Properties
optionalconfig
optionalallow-uncaught
Allow uncaught errors to propagate.
optionalasync-only
Require all tests to use a callback (async) or return a Promise.
optionalbail
Abort (“bail”) after first test failure.
optionalcheck-leaks
Check for global variable leaks.
optionaldelay
Delay initial execution of root suite.
optionalfgrep
Only run tests containing this string.
Note: MochaConfig.fgrep and MochaConfig.grep are mutually exclusive.
optionalfile
Files to be loaded prior to root suite execution.
optionalforbid-only
Fail if exclusive test(s) encountered.
forbid-pending
Fail if pending test(s) encountered.
optionalglobal
List of allowed global variables.
optionalgrep
Only run tests matching this string or regexp.
Note: MochaConfig.grep and MochaConfig.fgrep are mutually exclusive.
optionalgrowl
Enable Growl notifications.
optionalinvert
Inverts MochaConfig.grep and MochaConfig.fgrep matches.
optionalrequire
Require module.
optionalretries
Retry failed tests this many times.
optionalslow
Specify “slow” test threshold (in milliseconds).
optionaltimeout
Specify test timeout threshold (in milliseconds).
Note: setting this property to 0 means “no timeout”.
optionalui
optionalstrict
When set to true
, a skipped test is considered a failure.
Configuration object for the Mocha test runner.
Learn more
.mocharc.yml
example