我正在使用Angular Mocks测试我的应用程序,当它尝试创建一些模块时,我遇到了这个问题。
describe('navRegisterOverrideSpec', function () {
var navigationServiceProvider;
beforeEach(module('wrapper'));
describe('remove un needed navs', function () {
var navigationService;
beforeEach(
inject(function ($injector) {
navigationService = $injector.get('navigationService');
}));
it('Should not have admin menu', function () {
var filtered = _.filter(navigationService.items, function (item) {
return item.id == 'admin_menu';
});
expect(filtered.length).toEqual(0);
});
});
});
以下是我得到的错误。
Error: [$injector:modulerr] Failed to instantiate module ng due to:
Error: [$injector:pget] Provider '$$sanitizeUri' must define $get factory method.
http://errors.angularjs.org/1.5.5/$injector/pget?p0=%24%24sanitizeUri
at provider (D:/Projects/l35workflow/src/portals/verybest/bower_components/angular/angular.js:4497)
at D:/Projects/l35workflow/src/portals/verybest/bower_components/angular/angular.js:366
at forEach (D:/Projects/l35workflow/src/portals/verybest/bower_components/angular/angular.js:336)
at D:/Projects/l35workflow/src/portals/verybest/bower_components/angular/angular.js:4484
at ngModule (D:/Projects/l35workflow/src/portals/verybest/bower_components/angular/angular.js:2530)
at invoke (D:/Projects/l35workflow/src/portals/verybest/bower_components/angular/angular.js:4665)
at runInvokeQueue (D:/Projects/l35workflow/src/portals/verybest/bower_components/angular/angular.js:4558)
at D:/Projects/l35workflow/src/portals/verybest/bower_components/angular/angular.js:4567
at forEach (D:/Projects/l35workflow/src/portals/verybest/bower_components/angular/angular.js:322)
at loadModules (D:/Projects/l35workflow/src/portals/verybest/bower_components/angular/angular.js:4590)
at createInjector (D:/Projects/l35workflow/src/portals/verybest/bower_components/angular/angular.js:4470)
at workFn (D:/Projects/l35workflow/src/portals/verybest/bower_components/angular-mocks/angular-mocks.js:2464)
http://errors.angularjs.org/1.5.5/$injector/modulerr?p0=ng&p1=Error%3A%20%5B%24injector%3Apget%5D%20Provider%20'%
我找不到任何答案。任何帮助将不胜感激。