rsnext/test/integration/link-without-router
Damien Varron 55afe80c31
Only prefetch Link if router is in context (#19857)
Fixes #16864 

The `router` can be missing in a test environment when trying to render a `Link` component. This PR bails out of `router.prefetch()` when `router` is missing.

The alternative is for users to mock `next/link` or to mock the `router` and wrap their test components.

Please let me know any feedback.
2021-01-06 16:19:57 +00:00
..
components Only prefetch Link if router is in context (#19857) 2021-01-06 16:19:57 +00:00
test Only prefetch Link if router is in context (#19857) 2021-01-06 16:19:57 +00:00