Skip to content Skip to sidebar Skip to footer

How To Inject Ngroute Into Jasmine / Karma Angularjs Unit Test?

I'm trying to get a basic unit test example working. It all works fine with this app.js var whapp = angular.module('whapp', []) .filter('reverse',[function(){ return function(s

Solution 1:

Apparently, you get this error because PhantomJS fails to instantiate your main Angular module whapp. One possible reason is, that the file node_modules/angular-mocks/angular-route/angular-route.js is missing.

Obviously, you are using npm to manage your dependencies. So try to replace your current file with:

node_modules/angular-route/angular-route.js

The same for the ui-route module:

node_modules/angular-ui-router/release/angular-ui-router.js

I hope this will help you.

Post a Comment for "How To Inject Ngroute Into Jasmine / Karma Angularjs Unit Test?"