title: mocking store.getState()
body: <p>I want to assert that when a function gets my redux state value using <code>store.getState()</code>, it does various things based on the conditions of that state. How am I able to assert / mock what I want the state value to be for certain tests using the <code>store.getState()</code> method? Thanks.</p>
  
  <p><strong>sampleFunction.js:</strong></p>
  
  <pre><code>import { store } from './reduxStore';
  
  const sampleFunction = () =&gt; {
    const state = store.getState();
    let result = false;
    if (state.foo.isGood) {
      result = true;
    }
  
    return result;
  };
  
  export default sampleFunction;
  </code></pre>
  
  <p><strong>sampleFunction.test.js:</strong></p>
  
  <pre><code>import sampleFunction from './sampleFunction.js';
  
  test('sampleFunction returns true', () =&gt; {
    // assert that state.foo.isGood = true
    expect(sampleFunction()).toBeTruthy();
  });
  </code></pre>