new Runner(suite, delayopt)
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
suite | Suite | Root suite | |
delay | boolean | <optional> | Whether or not to delay execution of root suite |
Extends
Members
(static, readonly) constants :string
Properties:
Name | Type | Description |
---|---|---|
EVENT_HOOK_BEGIN | string | Emitted when Hook execution begins |
EVENT_HOOK_END | string | Emitted when Hook execution ends |
EVENT_RUN_BEGIN | string | Emitted when Root Suite execution begins (all files have been parsed and hooks/tests are ready for execution) |
EVENT_DELAY_BEGIN | string | Emitted when Root Suite execution has been delayed via |
EVENT_DELAY_END | string | Emitted when delayed Root Suite execution is triggered by user via |
EVENT_RUN_END | string | Emitted when Root Suite execution ends |
EVENT_SUITE_BEGIN | string | Emitted when Suite execution begins |
EVENT_SUITE_END | string | Emitted when Suite execution ends |
EVENT_TEST_BEGIN | string | Emitted when Test execution begins |
EVENT_TEST_END | string | Emitted when Test execution ends |
EVENT_TEST_FAIL | string | Emitted when Test execution fails |
EVENT_TEST_PASS | string | Emitted when Test execution succeeds |
EVENT_TEST_PENDING | string | Emitted when Test becomes pending |
EVENT_TEST_RETRY | string | Emitted when Test execution has failed, but will retry |
Runner-related constants.
Type:
- string
Methods
abort() → {Runner}
Cleanly abort execution.
Returns:
Runner instance.
- Type
- Runner
globals(arr) → {Runner}
Allow the given arr
of globals.
Parameters:
Name | Type | Description |
---|---|---|
arr | Array |
Returns:
Runner instance.
- Type
- Runner
grep(re, invert) → {Runner}
Run tests with full titles matching re
. Updates runner.total
with number of tests matched.
Parameters:
Name | Type | Description |
---|---|---|
re | RegExp | |
invert | boolean |
Returns:
Runner instance.
- Type
- Runner
grepTotal(suite) → {number}
Returns the number of tests matching the grep search for the
given suite.
Parameters:
Name | Type | Description |
---|---|---|
suite | Suite |
Returns:
- Type
- number
run(fn) → {Runner}
Run the root suite and invoke fn(failures)
on completion.
Parameters:
Name | Type | Description |
---|---|---|
fn | function |
Returns:
Runner instance.
- Type
- Runner