How to mock angular translate filter in unit tests for directives

前端 未结 4 945
说谎
说谎 2020-12-05 14:29

In my directive templates, I need to use the angular translate filter as such:

    
4条回答
  •  星月不相逢
    2020-12-05 14:56

    The simple solution which worked for me is to add this line in your test file:

    beforeEach(angular.mock.module('pascalprecht.translate'));
    

提交回复
热议问题