ngMock.$log.assertEmpty()

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

ngMock.$log

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

ngMock.$interval.flush()

flush([millis]); Runs interval tasks scheduled to be run in the next millis milliseconds. Parameters Param Type Details millis (optional) number maximum timeout amount to flush up until. Returns number The amount of time moved forward.

ngMock.$interval.cancel()

cancel(promise); Cancels a task associated with the promise. Parameters Param Type Details promise promise A promise from calling the $interval function. Returns boolean Returns true if the task was successfully cancelled.

ngMock.$interval

service in module ngMock Mock implementation of the $interval service. Use $interval.flush(millis) to move forward by millis milliseconds and trigger any functions scheduled to run in that time. Usage $interval(fn, delay, [count], [invokeApply], [Pass]); Arguments Param Type Details fn function() A function that should be called repeatedly. delay number Number of milliseconds between each function call. count (optional) number Number of times to repeat. If not set, or 0,

ngMock.$httpBackend.whenRoute()

whenRoute(method, url); Creates a new backend definition that compares only with the requested route. Parameters Param Type Details method string HTTP method. url string HTTP url string that supports colon param matching. Returns requestHandler Returns an object with respond method that controls how a matched request is handled. You can save this object for later use and invoke respond again in order to change how a matched request is handled. See #when for more info.

ngMock.$httpBackend.whenPUT()

whenPUT(url, [data], [headers], [keys]); Creates a new backend definition for PUT requests. For more info see when(). Parameters Param Type Details url stringRegExpfunction(string) HTTP url or function that receives a url and returns true if the url matches the current definition. data (optional) stringRegExpfunction(string) HTTP request body or function that receives data string and returns true if the data is as expected. headers (optional) Objectfunction(Object) HTTP heade

ngMock.$httpBackend.whenPOST()

whenPOST(url, [data], [headers], [keys]); Creates a new backend definition for POST requests. For more info see when(). Parameters Param Type Details url stringRegExpfunction(string) HTTP url or function that receives a url and returns true if the url matches the current definition. data (optional) stringRegExpfunction(string) HTTP request body or function that receives data string and returns true if the data is as expected. headers (optional) Objectfunction(Object) HTTP hea

ngMock.$httpBackend.whenJSONP()

whenJSONP(url, [keys]); Creates a new backend definition for JSONP requests. For more info see when(). Parameters Param Type Details url stringRegExpfunction(string) HTTP url or function that receives a url and returns true if the url matches the current definition. keys (optional) Array Array of keys to assign to regex matches in request url described above. Returns requestHandler Returns an object with respond method that controls how a matched request is handled. You can sav

ngMock.$httpBackend.whenHEAD()

whenHEAD(url, [headers], [keys]); Creates a new backend definition for HEAD requests. For more info see when(). Parameters Param Type Details url stringRegExpfunction(string) HTTP url or function that receives a url and returns true if the url matches the current definition. headers (optional) Objectfunction(Object) HTTP headers. keys (optional) Array Array of keys to assign to regex matches in request url described above. Returns requestHandler Returns an object with res