Monday, April 3, 2017

How to resolve angular lang json file(angular-localization module) from jasmine test case

Leave a Comment

I have angular service method which uses angular-localization locale service . I want to write jasmine test cases for method , which are failing as jasmine is not able to resolve it. May be it is not waiting till it resolve completely

//service method $scope.getExcelName = function() {   var name = locale.getString('export.fileName')   return name; }  //lang file  'fileName': 'Status Report'  //Jasmine test case describe('Service:MyService', function() {   var myService   beforeEach(module('app'))    beforeEach(inject(function($injector) {     myService = $injector.get('MyService');   }))    it('check export name', function() {     //myService.getExcel giving '' instead of  Status Report     expect(myService.getExcelName()).toBe('Status Report')   }) }) 

How to resolve above issue ?

0 Answers

If You Enjoyed This, Take 5 Seconds To Share It

0 comments:

Post a Comment