How can this snippet code be unit tested using jasmine ?
$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);
});
where ProfileSharedObject is a angular js service