Spec-Zone.ru › Angular.js 1.4

Улучшить эту документацию Просмотреть исходный код $exceptionHandlerProvider

  1. $exceptionHandler
  2. provider в модуле ngMock

Настраивает имитацию реализации $exceptionHandler для повторной генерации или регистрации ошибок, переданных в $exceptionHandler.

Методы

  • mode(mode);

    Устанавливает режим регистрации.

    Параметры

    Параметр Тип Подробности
    mode string

    Режим работы, по умолчанию rethrow.

    • log: Иногда желательно проверить, что ошибка была выброшена, для этого используется log
      mode 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

Spec-Zone.ru

Настройки Оффлайн Что нового Помощь О нас
Spec-Zone .ru
спецификации, руководства, описания, API