To test a component (with Jest) that contains <Route>
and withRouter
you need to import Router in you test, not in your component
import { BrowserRouter as Router } from 'react-router-dom';
and use it like this
app = shallow(
<Router>
<App />
</Router>);