title: What is the purpose of `beforeEach` global in Jest?
body: <p>I always find Jest-Enzyme test cases starting with a <code>beforeEach</code> global that resembles like the following:</p>
  <pre><code>describe('TEST BLOCK' () =&gt; {
    let wrapper;
  
    beforeEach(() =&gt; {
      wrapper = shallow(&lt;Component /&gt;);
    });
  ));
  </code></pre>
  <p>The function inside the <code>beforeEach</code> global runs before each test inside the <code>TEST BLOCK</code> <code>describe</code> block. In this case, it shallow renders the <code>Component</code> and assigns to <code>wrapper</code> before running each test. I am not quite sure why do we do this in the first place. Are we not deliberatly slowing down the test runtime? Isn't it okay to render it once and assign it to <code>wrapper</code>? What is the purpose of the <code>beforeEach</code> here? Are there other scenarios where <code>beforeEach</code> is beneficial when testing React components?</p>