ngMock.object

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

ngMock.function

Name Description angular.mock.dump NOTE: this is not an injectable instance, just a globally available function. angular.mock.module NOTE: This function is also published on window for easy access.NOTE: This function is declared ONLY WHEN running tests with jasmine or mocha angular.mock.module.sharedInjector NOTE: This function is declared ONLY WHEN running tests with jasmine or mocha angular.mock.inject NOTE: This function is also published on window for easy access.NOTE: This function

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.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.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.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

object in module ngMock Namespace from 'angular-mocks.js' which contains testing related code.

ngMock.$timeout.verifyNoPendingTasks()

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

ngMock.$timeout.flush()

flush([delay]); Flushes the queue of pending tasks. Parameters Param Type Details delay (optional) number maximum timeout amount to flush up until