Skip to main content

externalMochaConfig

Configuration object for the Mocha test runner.

Learn more

Index

Properties

externaloptionalconfig

config?: string

Path to config file.

Learn more

externaloptionalallow-uncaught

allow-uncaught?: boolean

Allow uncaught errors to propagate.

externaloptionalasync-only

async-only?: boolean

Require all tests to use a callback (async) or return a Promise.

externaloptionalbail

bail?: boolean

Abort ("bail") after first test failure.

externaloptionalcheck-leaks

check-leaks?: boolean

Check for global variable leaks.

externaloptionaldelay

delay?: boolean

Delay initial execution of root suite.

externaloptionalfgrep

fgrep?: string

Only run tests containing this string.

Note: MochaConfig.fgrep and MochaConfig.grep are mutually exclusive.

externaloptionalfile

file?: string[]

Files to be loaded prior to root suite execution.

externaloptionalforbid-only

forbid-only?: boolean

Fail if exclusive test(s) encountered.

externalforbid-pending

forbid-pending: boolean

Fail if pending test(s) encountered.

externaloptionalglobal

global?: string[]

List of allowed global variables.

externaloptionalgrep

grep?: string | RegExp

Only run tests matching this string or regexp.

Note: MochaConfig.grep and MochaConfig.fgrep are mutually exclusive.

externaloptionalgrowl

growl?: boolean

Enable Growl notifications.

externaloptionalinvert

invert?: boolean

Inverts MochaConfig.grep and MochaConfig.fgrep matches.

externaloptionalrequire

require?: string[]

Require module.

externaloptionalretries

retries?: number

Retry failed tests this many times.

externaloptionalslow

slow?: number

Specify "slow" test threshold (in milliseconds).

externaloptionaltimeout

timeout?: number

Specify test timeout threshold (in milliseconds).

Note: setting this property to 0 means "no timeout".

externaloptionalui

ui?: string

Specify user interface. Defaults to bdd.

Learn more

externaloptionalstrict

strict?: boolean

When set to true, a skipped test is considered a failure.