How would you test this requestError
method?
angular.module('myApp').factory 'HTTPInterceptor', [
'$rootScope'
'$q'
'$window'
'LocalStorageService'
'$injector'
($rootScope, $q, $window, $injector) ->
{
request: (config) ->
config.headers = config.headers or {}
// do stuff with config then
config # Return Config
requestError: (rejection) ->
q.reject(rejection) # Return the promise rejection
...
Hey its been long since you post this question but I think I have solution for this question.Last describe is for requestError method in intreceptors. Here is example of how I test my httpInterceptor:
TEST
Actual Interceptor