/Angular.js 1.8

Service components in ngMock

Name Description

Flushes all currently pending tasks and executes the corresponding callbacks.


Verifies that there are no pending tasks that need to be flushed. It throws an error if there are still pending tasks.


Mock implementation of $exceptionHandler that rethrows or logs errors passed to it. See $exceptionHandlerProvider for configuration information.


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.


Mock implementation of the $interval service.


Mock implementation of the $animate service. Exposes two additional methods for testing animations.


Fake HTTP backend implementation suitable for unit testing applications that use the $http service.


This service is just a simple decorator for $timeout service that adds a "flush" and "verifyNoPendingTasks" methods.


A decorator for $controller with additional bindings parameter, useful when testing controllers of directives that use bindToController.


A service that can be used to create instances of component controllers. Useful for unit-testing.

© 2010–2020 Google, Inc.
Licensed under the Creative Commons Attribution License 3.0.