Global

Type Definitions

MochaGlobalFixture() → {void|Promise:.<void:>}

Source:

A function that's invoked once which is either sync or async.
Can be a "teardown" or "setup". These will all share the same context.

Returns:
Type
void | Promise:.<void:>

MochaRootHookFunction() → {MochaRootHookObject|Promise:.<MochaRootHookObject:>}

Source:

An function that returns a MochaRootHookObject, either sync or async.

Returns:
Type
MochaRootHookObject | Promise:.<MochaRootHookObject:>

MochaRootHookObject

Source:
Properties:
NameTypeAttributesDescription
beforeAllfunction | Array:.<function()><optional>

"Before all" hook(s)

beforeEachfunction | Array:.<function()><optional>

"Before each" hook(s)

afterAllfunction | Array:.<function()><optional>

"After all" hook(s)

afterEachfunction | Array:.<function()><optional>

"After each" hook(s)

An alternative way to define root hooks that works with parallel runs.

Type:
  • Object

PluginDefinition

Source:
Properties:
NameTypeAttributesDescription
exportNamestring

Named export to use

optionNamestring<optional>

Option name for Mocha constructor (use exportName if omitted)

validatePluginValidator<optional>

Validator function

finalizePluginFinalizer<optional>

Finalizer/aggregator function

An object making up all necessary parts of a plugin loader and aggregator

Type:
  • Object

PluginFinalizer(impls) → {Promise:.<*:>|*}

Source:

A function to finalize plugins impls of a particular ilk

Parameters:
NameTypeDescription
implsArray:.<*:>

User-supplied implementations

Returns:
Type
Promise:.<*:> | *

PluginLoaderOptions

Source:
Properties:
NameTypeAttributesDescription
pluginDefsArray:.<PluginDefinition:><optional>

Plugin definitions

ignoreArray:.<string:><optional>

A list of plugins to ignore when loading

Options for PluginLoader

Type:
  • Object

PluginValidator(value) → {void}

Source:

A (sync) function to assert a user-supplied plugin implementation is valid.

Defined in a PluginDefinition.

This:
Parameters:
NameTypeDescription
value*

Value to check

Returns:
Type
void