$filter is not a function while running the test case for custom filter?
<p>I am new to <code>unit test</code> and have written unit test for custom filter and I am getting the error,</p>

<blockquote>
  <p>$filter is not defined.</p>
</blockquote>

<p><strong>Here is my code:</strong></p>

<p><em>For Unit Test:</em></p>

<pre><code>describe('filter', function() {

    beforeEach(module('usp'));

    var $filter;

    beforeEach(inject(function(_$filter_){
        $filter = _$filter_;
    }));

    it('should format the date in this format MMM-DD-YYYY', function() {
      var dateFormat = $filter('dateFormat');
      expect(dateFormat('13-10-2016')).toEqual('10-13-2016');
    });
});
</code></pre>

<p><em>Custom filter:</em></p>

<pre><code>angular.module('usp').filter('dateFormat', function () {
     return function (input) {
         return moment(input).format("MMM-DD-YYYY");
     };
 });
</code></pre>

<p>Please tell me where I am going wrong?</p>