How to mock a service that returns promise in AngularJS Jasmine unit test?

Posted by Jennifer | Updated on

Want to mock a service that returns promise in AngularJS Jasmine unit test? I’m not sure why the way you did it doesn’t work, but I usually do it with the spyOn function. Something like this:


If you like this question & answer and want to contribute, then write your question & answer and email to freewebmentor[@]gmail.com. Your question and answer will appear on FreeWebMentor.com and help other developers.

Related Questions & Answers