Runner

Runner

new Runner(suite, delayopt)

Source:

Initialize a Runner at the Root Suite, which represents a hierarchy of Suites and Tests.

Parameters:
NameTypeAttributesDescription
suiteSuite

Root suite

delayboolean<optional>

Whether or not to delay execution of root suite
until ready.

Extends

Members

(static, readonly) constants :string

Source:
Properties:
NameTypeDescription
EVENT_HOOK_BEGINstring

Emitted when Hook execution begins

EVENT_HOOK_ENDstring

Emitted when Hook execution ends

EVENT_RUN_BEGINstring

Emitted when Root Suite execution begins (all files have been parsed and hooks/tests are ready for execution)

EVENT_DELAY_BEGINstring

Emitted when Root Suite execution has been delayed via delay option

EVENT_DELAY_ENDstring

Emitted when delayed Root Suite execution is triggered by user via global.run()

EVENT_RUN_ENDstring

Emitted when Root Suite execution ends

EVENT_SUITE_BEGINstring

Emitted when Suite execution begins

EVENT_SUITE_ENDstring

Emitted when Suite execution ends

EVENT_TEST_BEGINstring

Emitted when Test execution begins

EVENT_TEST_ENDstring

Emitted when Test execution ends

EVENT_TEST_FAILstring

Emitted when Test execution fails

EVENT_TEST_PASSstring

Emitted when Test execution succeeds

EVENT_TEST_PENDINGstring

Emitted when Test becomes pending

EVENT_TEST_RETRYstring

Emitted when Test execution has failed, but will retry

Runner-related constants.

Type:
  • string

Methods

abort() → {Runner}

Source:

Cleanly abort execution.

Returns:

Runner instance.

Type
Runner

globals(arr) → {Runner}

Source:

Allow the given arr of globals.

Parameters:
NameTypeDescription
arrArray
Returns:

Runner instance.

Type
Runner

grep(re, invert) → {Runner}

Source:

Run tests with full titles matching re. Updates runner.total
with number of tests matched.

Parameters:
NameTypeDescription
reRegExp
invertboolean
Returns:

Runner instance.

Type
Runner

grepTotal(suite) → {number}

Source:

Returns the number of tests matching the grep search for the
given suite.

Parameters:
NameTypeDescription
suiteSuite
Returns:
Type
number

run(fn) → {Runner}

Source:

Run the root suite and invoke fn(failures)
on completion.

Parameters:
NameTypeDescription
fnfunction
Returns:

Runner instance.

Type
Runner