How to fix conflict of ui-router and karma

Share Button

When you use karma to do unit testing for angular application using ui-router module, you will likely get following error:

The part after “GET” depends on your setup of the application. The reason this happens is that there is a conflict of ui-router module and karma. The quickest fix is to defer  intercept of  urlRouterProvider by adding following to your unit test code: