title: Having trouble testing routes with React Router/Jest/Enzyme
body: <p>So I've been trying to figure out how to write unit tests for a component of mine that conditionally renders components using React Router. My problem has been that I have never been able to get it to render anything other than the root route, no matter what I do.</p>
  <p>To further investigate this, I put together a small piece of test code, which I'm including here:</p>
  <pre><code>it('testing', () =&gt; {
          const component = mount(
              &lt;MemoryRouter initalEntries={ [ '/next' ] }&gt;
                  &lt;Switch&gt;
                      &lt;Route path=&quot;/next&quot; render={ () =&gt; &lt;p&gt;Next&lt;/p&gt; } /&gt;
                      &lt;Route path=&quot;/&quot; exact render={ () =&gt; &lt;p&gt;Root&lt;/p&gt; } /&gt;
                  &lt;/Switch&gt;
              &lt;/MemoryRouter&gt;
          );
  
          console.log(component.debug());
      });
  </code></pre>
  <p>So, my expectation would be that this code would render <code>&lt;p&gt;Next&lt;/p&gt;</code>, because I'm hitting the /next route. However, it will only ever render <code>&lt;p&gt;Root&lt;/p&gt;</code>.</p>