Timeouts
Timeouts
Suite-level
Suite-level timeouts may be applied to entire test “suites”, or disabled via this.timeout(0)
.
This will be inherited by all nested suites and test-cases that do not override the value.
Test-level
Test-specific timeouts may also be applied, or the use of this.timeout(0)
to disable timeouts all together:
Hook-level
Hook-level timeouts may also be applied:
Again, use this.timeout(0)
to disable the timeout for a hook.
Diffs
Mocha supports the err.expected
and err.actual
properties of any thrown AssertionError
s from an assertion library.
Mocha will attempt to display the difference between what was expected, and what the assertion actually saw.
Here’s an example of a “string” diff using --inline-diffs
: