1
我有一個方法叫$scope.openGroupInbox()
,它的確做了$scope.init()
和其他的東西。 我想測試是否已調用$scope.init()
。在打電話之前,在測試中.toHaveBeenCalled()
功能
it('call init', function() {
$scope.openGroupInbox(3);
expect($scope.init(3)).toHaveBeenCalled();
});