I am testing my application using Angular Mocks, and when it tries to create some kind of module, I have this problem.
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); }); }); });
Below is the error.
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'%
I can not find the answer. Any help would be appreciated.
source share