I am using karma to test a controller in my angular app, the app it self works as expected but unit test throws error: unexpected request: GET views/home.html
as I got the problem is by ui-router and $httpBackend. so one approach was caching by ‘karma-preprocessor’ but what I have done is:
var MenuController, scope, $httpBackend;
// Initialize the controller and a mock scope
beforeEach(inject(function($controller, _$httpBackend_, $rootScope, menuService) {
// place here mocked dependencies
$httpBackend = _$httpBackend_;
$httpBackend.whenGET("views/header.html").respond(200,'');
$httpBackend.expectGET("http://localhost:3000/dishes").respond([{ ....
but the GET error shows for every template in my views folder.
NOW is there any way to ignore all templates and any other unexpected GET requests?