title: Jasmine: check if a variable is an empty function
body: <p>In my controller I've a statement assigning an empty function in a variable based on a condition.</p>
  
  <pre><code>var vm = this;
  vm.emptyFunction = angular.isFunction(callback) ? callback : function() {};
  </code></pre>
  
  <p>How can I test that this <code>vm.emptyFunction</code> is actually an empty function?</p>
  
  <p>Things which didn't work:</p>
  
  <pre><code>expect(vm.emptyFunction).toEqual({});
  expect(vm.emptyFunction()).toEqual({});
  expect(vm.emptyFunction).toEqual(() =&gt; {}); //using typescript
  </code></pre>
  
  <p>Thing which work is:</p>
  
  <pre><code>expect(vm.emptyFunction).toEqual(jasmine.any(Function));
  </code></pre>
  
  <p>But this will get valid for any function definition.</p>