title: Testing anonymous function equality with Jest
body: <p>Is there a way to test anonymous function equality with <code>jest@20</code>?</p>
  
  <p>I am trying to pass a test similar to:</p>
  
  <pre><code>const foo = i =&gt; j =&gt; {return i*j}
  const bar = () =&gt; {baz:foo(2), boz:1}
  
  describe('Test anonymous function equality',()=&gt;{
  
      it('+++ foo', () =&gt; {
          const obj = foo(2)
          expect(obj).toBe(foo(2))
      });
  
      it('+++ bar', () =&gt; {
          const obj = bar()
          expect(obj).toEqual({baz:foo(2), boz:1})
      });    
  });
  </code></pre>
  
  <p>which currently yields:</p>
  
  <pre><code>  ● &gt;&gt;&gt;Test anonymous function equality › +++ foo
  
      expect(received).toBe(expected)
  
      Expected value to be (using ===):
        [Function anonymous]
      Received:
        [Function anonymous]
  
      Difference:
  
      Compared values have no visual difference.
  
    ● &gt;&gt;&gt;Test anonymous function equality › +++ bar
  
      expect(received).toBe(expected)
  
      Expected value to be (using ===):
        {baz: [Function anonymous], boz:1}
      Received:
        {baz: [Function anonymous], boz:1}
  
      Difference:
  
      Compared values have no visual difference.
  </code></pre>