title: JEST + React Testing Library: should I render my component with a beforeAll before tests?
body: <p>As the title says, I'm using RTL + Jest (with Create-react-app setup).</p>
  
  <p>My question is if I should be using a beforeAll in each test pre-rendering the component within that block, so each test doesn't have to re-render the component from scratch since my test suites always start from the same base component. <strong>Is there a performance improvement by doing this?</strong></p>
  
  <p>For example, is there an improvement in doing this</p>
  
  <pre><code>describe("MyComponent", () =&gt; {
      beforeAll(() =&gt; {
          render(&lt;MyComponent {...props} /&gt;);
      });
  
      it("tests something", () =&gt; {
          expect(something).toDoSomething();
      });
  
      it("tests something else", () =&gt; {
          expect(somethingElse).toDoSomethingElse();
      });
  });
  </code></pre>
  
  <p>over this (other than being less verbose and re-writing the component rendering)?</p>
  
  <pre><code>describe("MyComponent", () =&gt; {
  
      it("tests something", () =&gt; {
          render(&lt;MyComponent {...props} /&gt;);
          expect(something).toDoSomething();
      });
  
      it("tests something else", () =&gt; {
          render(&lt;MyComponent {...props} /&gt;);
          expect(somethingElse).toDoSomethingElse();
      });
  });
  </code></pre>
  
  <p>Should I be approaching my test suites differently by doing something else? Is it just a matter of personal preference?</p>
  
  <p>I've read from Kent C Dodds blog <a href="https://kentcdodds.com/blog/avoid-nesting-when-youre-testing" rel="noreferrer">this post</a> where he mainly states it makes code less readable but doesn't talk about performance or if it has any kind of impact on the tests.</p>