How to pass { history, location, match } when unit testing

Viewed 390

I am running tests against the following component:

const App: React.FC<RouteComponentProps> = ({ history, location, match }) => { ... }

All the tests are passing however I get this warning:

const { getByText, debug } = render(<MemoryRouter><Route><App/></Route></MemoryRouter>);

Type '{}' is missing the following properties from type 'RouteComponentProps<{}, StaticContext, {}>': history, location, match(2739)

I was under the impression that <MemoryRouter> & <Route> would provide <App/> with the missing properties...

0 Answers
Related