title: Unit testing watchers in angular js controller
body: <p>How can this snippet code be unit tested using jasmine ?</p>
  
  <pre><code>    $scope.profileObject = ProfilesSharedObject;
  
  $scope.$watch("profileObject.startDate", function() {
      var startDate = $scope.profileObject.startDate._d;
      var endDate = $scope.profileObject.endDate._d;
  
      var newStartDate = moment(startDate).format("YYYY-MM-DD");
      var newEndDate = moment(endDate).format("YYYY-MM-DD");
  
      $scope.startDate = moment(startDate).format("MM/DD");
      $scope.endDate = moment(endDate).format("MM/DD/YYYY");
  
      $scope.getSleepData(newStartDate, newEndDate);
  });
  </code></pre>
  
  <p>where ProfileSharedObject is a angular js service</p>