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

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

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

google shop client API returns 400 bad request error while adding an item -