I am using Protractor's addMockModule
functionality to mock some request data, but am having issues with the target Angular app being in strict mode.
This is the error:
Failed: unknown error: [$injector:strictdi] function($httpBackend) is not using explicit annotation and cannot be invoked in strict mode
This is the code:
var httpBackendMock = function() {
angular.module('httpBackendMock', ['my-app', 'ngMockE2E'])
.run(function($httpBackend){
var expected_response = {"limit": 1}
$httpBackend.whenGET(/homepage/).respond(function() {
return [200, expected_response];
});
$httpBackend.whenGET(/.*/).passThrough();
});
};
browser.addMockModule('httpBackendMock', httpBackendMock);
Is there a way how I can explicitly inject $httpBackend in Angular's context here?