Angular Jasmine test response interceptor
问题 I'm trying to test my response interceptor but I have a hard time figuring out how to mock the $window object. Here is my interceptor code : 'use strict'; angular.module('Domain.handlers') .config(function($httpProvider) { $httpProvider.responseInterceptors.push('UnauthorizedInterceptor'); }) .factory('UnauthorizedInterceptor', function($q, $injector, $window, ENV) { return function(promise) { var success = function(response) { return response; }; var error = function(response) { if (response