How do I spy on an Angular promise chain using Jasmine

◇◆丶佛笑我妖孽 提交于 2019-12-05 15:15:49

try a $rootScope.$apply() before the second expect

also about defer.resolve(). i don't know if this actually resolves the promise, i think it just setups the value to return when it resolves.

so i would move that up to just underneath the $q.defer() call, before passing the promise to the andReturn()

you could do defer.resolve(true), defer.reject(false), so if you're promise will get rejected insinde callsteps, true or false will be returned

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!