How to resolve $q.all promises in Jasmine unit tests?
You can try putting $rootScope.$apply() in an afterEach() callback function. Promises resolve on $apply() in Angular. afterEach(function(){ rootScope.$apply(); });
You can try putting $rootScope.$apply() in an afterEach() callback function. Promises resolve on $apply() in Angular. afterEach(function(){ rootScope.$apply(); });
In your unit tests you need to manually call $scope.$digest() or $scope.$apply() to trigger $scope.$watch(). Normally in your code you wouldn’t have to do this, since directives like ng-click do $rootScope.$apply for you behind the scenes.