How to write testable controllers with private methods in AngularJs?
Alright, so I have been stumbling upon some issue for a long time and I would like to hear an opinion from the rest of community. First, let's look at some abstract controller. function Ctrl($scope, anyService) { $scope.field = "field"; $scope.whenClicked = function() { util(); }; function util() { anyService.doSmth(); } } Clearly we have here: regular scaffold for controller with $scope and some service injected some field and function attached to the scope private method util() Now, I'd like to cover this class in unit tests (Jasmine). However, the problem is that I want to verify that when