Angular and Jasmine: How to test requestError / rejection in HTTP interceptor?
问题 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 ... 回答1: Hey its been long since you post this question but I think I have solution for this question