This is my test case for checking whether the function is defined or not in the controller
Function:
$scope.loadData = ()=> {
LoadService.loadListing().then(function (responseData) {
alert("Success");
}
Test Case:
it('should have loadMeetings function', function () {
expect(angular.isFunction(scope.loadData )).toBe(true);
});
The Error : TypeError: Cannot read property 'loadListing' of undefined at Scope.MyCtrl.$scope.loadData