Hook

Hook

new Hook(title, fn)

Source:

Initialize a new Hook with the given title and callback fn

Parameters:
NameTypeDescription
titleString
fnfunction

Extends

Methods

clearTimeout()

Source:
Inherited From:

Clear the timeout.

currentRetry()

Source:
Inherited From:

Set or get current retry

enableTimeouts(enabled) → {Runnable|boolean}

Source:
Inherited From:

Set and get whether timeout is enabled.

Parameters:
NameTypeDescription
enabledboolean
Returns:

enabled or Runnable instance.

Type
Runnable | boolean

error(err) → {Error}

Source:

Get or set the test err.

Parameters:
NameTypeDescription
errError
Returns:
Type
Error

globals(globals)

Source:
Inherited From:

Set or get a list of whitelisted globals for this test run.

Parameters:
NameTypeDescription
globalsArray.<string>

inspect() → {string}

Source:
Inherited From:

Inspect the runnable void of private properties.

Returns:
Type
string

isPending()

Source:
Inherited From:

Check if this runnable or its parent suite is marked as pending.

resetTimeout()

Source:
Inherited From:

Reset the timeout.

retries()

Source:
Inherited From:

Set or get number of retries.

run(fn)

Source:
Inherited From:

Run the test and invoke fn(err).

Parameters:
NameTypeDescription
fnfunction

slow(ms) → {Runnable|number}

Source:
Inherited From:

Set or get slow ms.

Parameters:
NameTypeDescription
msnumber | string
Returns:

ms or Runnable instance.

Type
Runnable | number

timeout(ms) → {Runnable|number}

Source:
Inherited From:

Set & get timeout ms.

Parameters:
NameTypeDescription
msnumber | string
Returns:

ms or Runnable instance.

Type
Runnable | number