angularjs - error in angular.mock.inject when testing service -


i want make test of service in angularjs there problem injector.

here service:

var projectapp = angular.module("projectapp", []);  projectapp.service("worktimeservice", function(){      this.workhours = function(workhours){         return workhours;     } } 

here test:

describe("unit: testing services", function(){     var worktimeservice;      beforeeach(function(){         module("projectapp");     });     beforeeach(inject(function(_worktimeservice_){         worktimeservice = _worktimeservice_;     }));      it('should have funtion', function(){         expect(angular.isfunction(worktimeservice.workhours)).tobe(true);     }); }); 

i have made in tutorials jasmine says worktimeservice undefined.


Comments

Popular posts from this blog

android - MPAndroidChart - How to add Annotations or images to the chart -

javascript - Add class to another page attribute using URL id - Jquery -

firefox - Where is 'webgl.osmesalib' parameter? -