I am trying to mock Next/Link component and substitute it with react router link component.
Everything goes well except that I don’t know how to pass the url from the ‘href’ porp of Next/Link to the ‘to’ prop of React Router Link.
Here is some code:
vi.mock('next/link', async () => {
const { Link } = await vi.importActual('react-router-dom');
return { default: Link };
});