angularjs - How do I make $watch react on a scope variable change in a unit test -


i have unit test controller watches variable on scope. when change variable's value, $watch isn't triggered.

something in test should make sure updated:

it('should update watched value', function() {     $scope.$apply(function() {         $scope.yourwatchedvariable = 'new value';     });     //expect happen based on watch }); 

Comments

Popular posts from this blog

user interface - How to replace the Python logo in a Tkinter-based Python GUI app? -

android - Get AccessToken using signpost OAuth without opening a browser (Two legged Oauth) -

org.mockito.exceptions.misusing.InvalidUseOfMatchersException: mockito -