In my directive templates, I need to use the angular translate filter as such:
This is the ES6 way:
beforeEach(angular.mock.module('myModule'), ($provide) => {
$provide.value('$translate', t => ({ then: cb => cb(t) }));
}));
This does not mock the $translate.instant method. For this you could assign the function to a variable and then assign the angular.identity method to the instantproperty.