title: How to mock angular translate filter in unit tests for directives
body: <p>In my directive templates, I need to use the angular translate filter as such:</p>
  
  <pre><code>    &lt;label for="data-source-btn"&gt;
        &lt;span id="data-source-btn-span"&gt;&lt;/span&gt;
        {{'Data Source' | translate}}
      &lt;/label&gt;
  </code></pre>
  
  <p>Then in my unit test for this directive, I get the error:</p>
  
  <blockquote>
    <p>Unknown provider: translateFilterProvider &lt;- translateFilter</p>
  </blockquote>
  
  <p>I've tried injecting <code>$filter</code> and getting <code>$translate</code> by <code>$translate = $filter('translate');</code> which doesn't solve the problem - this is really for testing the filter</p>
  
  <p>I can inject the module <code>pascalprecht.translate</code>, but that is heavy handed. How do I best mock the filter?</p>