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
Post a Comment