{"QuestionId": 19767368, "AnswerCount": 2, "Tags": "", "CreationDate": "2013-11-04T12:04:27.857", "AcceptedAnswerId": "19767577", "Title": "angularJS: unit tests gives: Unknown provider: $httpProviderProvider <- $httpProvider", "Body": "

In one of my unit tests I'm trying to do

\n\n
beforeEach(function () {\n    angular.mock.inject(function ($injector) {\n        $httpBackend = $injector.get('$httpBackend');\n        mockUserResource = $injector.get('User');\n        $httpProvider = $injector.get('$httpProvider');  // <-- problem\n        $httpProvider.interceptors.push('myInterceptor');\n    });\n});\n
\n\n

(demo)

\n\n

Why is it not possible to inject $httpProvider ?

\n\n

The reason I'm doing this is because I don't load the file which adds all my interceptors, because I want to test them one by one!

\n", "Lable": "No"} {"QuestionId": 19865653, "AnswerCount": 2, "Tags": "