ngMock.$log

Improve this Doc View Source $log

  1. service in module ngMock

Mock implementation of $log that gathers all logged messages in arrays (one array per logging level). These arrays are exposed as logs property of each of the level-specific log function, e.g. for level error the array is exposed as $log.error.logs.

Methods

  • reset();

    Reset all of the logging arrays to empty.

  • assertEmpty();

    Assert that all of the logging methods have no logged messages. If any messages are present, an exception is thrown.

Properties

  • log.logs

    Array of messages logged using log().

  • info.logs

    Array of messages logged using info().

  • warn.logs

    Array of messages logged using warn().

  • error.logs

    Array of messages logged using error().

  • debug.logs

    Array of messages logged using debug().

© 2010–2017 Google, Inc.
Licensed under the Creative Commons Attribution License 4.0.
https://code.angularjs.org/1.6.4/docs/api/ngMock/service/$log

在线笔记
App下载
App下载

扫描二维码

下载编程狮App

公众号
微信公众号

编程狮公众号

意见反馈
返回顶部