diff --git a/docs/docs/testing.md b/docs/docs/testing.md index d6b6875a73ae..63064466181d 100644 --- a/docs/docs/testing.md +++ b/docs/docs/testing.md @@ -274,6 +274,19 @@ render(
, { }) ``` ::: +### Mocking useLocation + +To mock `useLocation` in your component tests, wrap the component with `LocationProvider`: + +```jsx +import { LocationProvider } from '@redwoodjs/router' + +render( + + + +) +``` ## Testing Custom Hooks