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(string){ return string.split('').reverse().join(''); } }]); and this spec.js describe('Filters', function(){ //describe your object type beforeEach(module('whapp')); //load module describe('reverse',function(){ //describe your app name var reverse, rootScope; beforeEach(inject(function($filter){ //initialize your filter