Reputation: 16883
I am trying to test if a function returns an angularjs promise but there doesn't seem to be a good way to test for this can someone illuminate me?
Upvotes: 1
Views: 504
Reputation: 609
You can use:
if(angular.isFunction(yourFunction().then)){
//yourFunction returns an angularjs promise.
}
Upvotes: 2