I'm making an angular app and am running end-to-end tests on them. I need to run a $httpBackend
instance for some of my tests, but I can't figure out how to do it. Currently my code looks like
myApp = angular.module('myApp', []);
myApp.controller('Controller', function () {
$http.post('/register/reg').success(function () console.log('yay'););
\\ things...
myTestingApp = angular.module('myTestingApp', ['myApp', 'ngMockE2E']);
myTestingApp.run(function ($httpBackend) {
$httpBackend.whenPOST('/\/register\/reg.*/').respond(200);
});
then I just navigate to runner.html
and run my tests. All of my other tests are seen by Karma, but this is not. What's going on?