Улучшить эту документацию Просмотреть исходный код $exceptionHandlerProvider
- $exceptionHandler
- provider в модуле ngMock
Настраивает имитацию реализации $exceptionHandler для повторной генерации или регистрации ошибок, переданных в $exceptionHandler.
Методы
-
mode(mode);
Устанавливает режим регистрации.
Параметры
Параметр Тип Подробности mode stringРежим работы, по умолчанию
rethrow.-
log: Иногда желательно проверить, что ошибка была выброшена, для этого используетсяlogmode stores an array of errors in `$exceptionHandler.errors`, to allow later assertion of them. See assertEmpty() and reset()
-
rethrow: Если в тесты передаются какие-либо ошибки обработчику, это обычно означает, что в нихis a bug in the application or test, so this mock will make these tests fail. For any implementations that expect exceptions to be thrown, the `rethrow` mode will also maintain a log of thrown errors.
-
© 2010–2017 Google, Inc.
Licensed under the Creative Commons Attribution License 4.0.
https://code.angularjs.org/1.4.14/docs/api/ngMock/provider/$exceptionHandlerProvider