title: Passing parameters to jest function
body: <p>I have this function in my child component:</p>
  
  <pre><code>&lt;div&gt; {handTotal('dealersHand').total} &lt;/div&gt;
  </code></pre>
  
  <p>This has been passed down from above</p>
  
  <p>however when I run jest it says <code>Cannot read property 'total' of undefined</code></p>
  
  <p>when i <code>console.log(handTotal('dealersHand')</code> it is logging the right thing and the function works so I know it's doing the correct thing</p>
  
  <p>I've stubbed it out in jest like so:</p>
  
  <pre><code>const handTotalStub = jest.fn()
    beforeEach(() =&gt; {
      wrapper = mount(&lt;Dealer
        dealersHand={dealersHandStub}
        containsAce={containsAceStub}
        handTotal={handTotalStub}
      /&gt;);
    })
  </code></pre>
  
  <p>How do I pass the parameter into this function so that jest understands what it is?</p>
  
  <p>can add more code/explanation if doesn't make sense</p>
  
  <p>stubbing:</p>
  
  <pre><code>  const handTotalStub = jest.fn().mockReturnValue('dealersHand')
  </code></pre>
  
  <p>test:</p>
  
  <pre><code>  it('expects dealers hand to equal', () =&gt; {
      expect(handTotalStub('dealersHand').total).toEqual(1);
    });
  </code></pre>