1
我有一个方法叫$scope.openGroupInbox()
,它的确做了$scope.init()
和其他的东西。 我想测试是否已调用$scope.init()
。在打电话之前,在测试中.toHaveBeenCalled()
功能
it('call init', function() {
$scope.openGroupInbox(3);
expect($scope.init(3)).toHaveBeenCalled();
});