$exceptionHandlerProvider
(service in module ngMock
)
Configures the mock implementation of ng.$exceptionHandler
to rethrow or to log errors passed
into the $exceptionHandler
.
Sets the logging mode.
mode – {string} –
Mode of operation, defaults to rethrow
.
rethrow
: If any errors are are passed into the handler in tests, it typically
means that there is a bug in the application or test, so this mock will
make these tests fail.log
: Sometimes it is desirable to test that an error is throw, for this case the log
mode stores the
error and allows later assertion of it.
See assertEmpty() and
reset()