Provided an angular controller containing the following function:
this.checkResponse = function (response) {
if (response.success === true) {
return $q.resolve(response);
} else {
return $q.reject(response);
}
};
I am looking to test with Jasmine to confirm that the returned value is a promise. While I can easily check if resolve or reject was called within the function, or use jasmine.any(Function), how can I make sure that the returned value is indeed a promise?