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
Post a Comment