ngMock.provider

Name Description $exceptionHandlerProvider Configures the mock implementation of $exceptionHandler to rethrow or to log errors passed to the $exceptionHandler.

ngMock.object

Name Description angular.mock Namespace from 'angular-mocks.js' which contains testing related code.

ngMock.angular.mock.module.sharedInjector

function in module ngMock NOTE: This function is declared ONLY WHEN running tests with jasmine or mocha This function ensures a single injector will be used for all tests in a given describe context. This contrasts with the default behaviour where a new injector is created per test case. Use sharedInjector when you want to take advantage of Jasmine's beforeAll(), or mocha's before() methods. Call module.sharedInjector() before you setup any other hooks that will create (i.e call module())

ngMock.angular.mock.inject

function in module ngMock NOTE: This function is also published on window for easy access.NOTE: This function is declared ONLY WHEN running tests with jasmine or mocha The inject function wraps a function into an injectable function. The inject() creates new instance of $injector per test, which is then used for resolving references. Resolving References (Underscore Wrapping) Often, we would like to inject a reference once, in a beforeEach() block and reuse this in multiple it() clauses. T

ngMock.angular.mock.dump

function in module ngMock NOTE: this is not an injectable instance, just a globally available function. Method for serializing common angular objects (scope, elements, etc..) into strings, useful for debugging. This method is also available on window, where it can be used to display objects on debug console. Usage angular.mock.dump(object); Arguments Param Type Details object * any object to turn into string. Returns string a serialized string of the argument

ngMock.angular.mock.TzDate

type in module ngMock NOTE: this is not an injectable instance, just a globally available mock class of Date. Mock of the Date type which has its timezone specified via constructor arg. The main purpose is to create Date-like instances with timezone fixed to the specified timezone offset, so that we can test code that depends on local timezone settings without dependency on the time zone settings of the machine where the code is running. Usage angular.mock.TzDate(offset, timestamp); Argu

ngMock.angular.mock.module

function in module ngMock NOTE: This function is also published on window for easy access.NOTE: This function is declared ONLY WHEN running tests with jasmine or mocha This function registers a module configuration code. It collects the configuration information which will be used when the injector is created by inject. See inject for usage example Usage angular.mock.module(fns); Arguments Param Type Details fns stringfunction()Object any number of modules which are represented as s

ngMock.$timeout

service in module ngMock This service is just a simple decorator for $timeout service that adds a "flush" and "verifyNoPendingTasks" methods. Methods flush([delay]); Flushes the queue of pending tasks. Parameters Param Type Details delay (optional) number maximum timeout amount to flush up until verifyNoPendingTasks(); Verifies that there are no pending tasks that need to be flushed.

ngMock.$timeout.verifyNoPendingTasks()

verifyNoPendingTasks(); Verifies that there are no pending tasks that need to be flushed.

ngMock.$rootScope.Scope.$countWatchers()

$countWatchers(); Counts all the watchers of direct and indirect child scopes of the current scope. The watchers of the current scope are included in the count and so are all the watchers of isolate child scopes. Returns number Total number of watchers.