title: Should I mount using beforeEach() and set props for each test or mount a specific component at the start of each test? (using Enzyme, Chai and Mocha)
body: <p>I've recently starting programming.  I'm on a team who is programming in React and is using Enzyme, Mocha and Chai for unit testing.  See package versions below.</p>
  
  <p>When testing a component where there are several use cases that require different prop values, should I use beforeEach() and then setProps() in each test, or should I do an explicit mount() (or shallow()) at the start of each test?  Does it matter?</p>
  
  <p>For example, I could use beforeEach() to mount without any props and then use setProps() in each test like this (using pseudocode):</p>
  
  <pre><code>describe('MyComponent', () =&gt; {
  
     beforeEach(... let component = mount(&lt;MyComponent /&gt;) ...)
  
     it('tests use case 1', () =&gt; {
        // set prop A = 123
        component.setProps({A: 123})
        // assert some stuff
     })
  
     it('tests use case 2, () =&gt; {
        // set prop A = 456 and B = 'foo'
        component.setProps({A: 456})
        component.setProps({B: 'foo'})
        // assert some stuff
     })
  
  })
  </code></pre>
  
  <p>or I could do a use-case specific mount at the start of each test, passing in props in the mount, like this:</p>
  
  <pre><code>describe('MyComponent', () =&gt; {
  
     it('tests use case 1', () =&gt; {
        ...mount(&lt;MyComponent A=123 /&gt;)
        // assert some stuff
     })
  
     it('tests use case 2, () =&gt; {
        ...mount(&lt;MyComponent A=456 B='foo' /&gt;)
        // assert some stuff
     })
  
  })
  </code></pre>
  
  <p>What are the pros and cons of each method?  Is there a best practice?</p>
  
  <p><strong>Packages</strong></p>
  
  <ul>
  <li>"enzyme": "^3.3.0",</li>
  <li>"enzyme-adapter-react-16": "^1.1.1",</li>
  <li>"mocha": "^5.0.0",</li>
  <li>"chai": "3.5.0"</li>
  </ul>