【发布时间】:2013-09-21 06:39:02
【问题描述】:
如何使用 jasmine 对这个 sn-p 代码进行单元测试?
$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);
});
其中 ProfileSharedObject 是一个 Angular js 服务
【问题讨论】:
标签: javascript unit-testing angularjs jasmine javascript-framework