$httpBackend is undefined although angular-mock is included

爷,独闯天下 提交于 2019-12-07 15:26:31

Based on the information you've provided, first, look at the page that your first error message links to:

https://docs.angularjs.org/error/$injector/unpr?p0=configProvider%20%3C-%20config

It doesn't look like you're redefining your module or injecting a controller into a controller.

I think the most likely reason you're having this error (based on assuming there aren't other problems, and the fact that I had a similar problem) is that you either didn't include config in your karma.conf.js file, or if you did, you included it after your test. The order of files matters in Karma:

http://karma-runner.github.io/0.8/config/files.html

You've probably figured out your problem by now, but I had a similar one and would've appreciated an answer when looking for it.

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