title: How to test a react component that is dependent on useContext hook?
body: <p>I have a component that uses <code>useContext</code> and then its output is dependent on the value in the context. A simple example:</p>
  
  <pre><code>import React, { useContext } from 'react';
  
  const MyComponent = () =&gt; {
    const name = useContext(NameContext);
  
    return &lt;div&gt;{name}&lt;/div&gt;;
  };
  </code></pre>
  
  <p>When testing this component with the shallow renderer from react and jest snapshots. How can I change the value of <code>NameContext</code>?</p>