describe('controllers', function () { 'use strict';
beforeEach(module('myapp.controllers'));
angular.mock.module('myapp.controllers', function ($provide) {
$provide.value('$localStorage', $localStorage); }); it('should have a
creationController', inject(function ($controller, _$rootScope_, localize) {
var scope = _$rootScope_.$new(); var localize = localize; var myCtrl1 =
$controller('creationController', { $scope: scope, localize: localize });
expect(myCtrl1).toBeDefined(); })); });
My Jasmine unit test is as above. When I try to execute the test I'm getting
the following error
Error: [$injector:unpr]
http://errors.angularjs.org/1.2.20/$injector/unpr?p0=localizeProvider%20%3C-%20localize
There is a dependency called as "localize" being used in the controller.
However I'm unable to inject that in to this unit test.
Any idea how I can solve this problem ?
--
You received this message because you are subscribed to the Google Groups
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.