How to mock useRouter from next/router in Cypress component testing? #38375
Unanswered
maxpopovitch
asked this question in
Help
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hey community,
I use Cypress for components testing in my project.
Here is the code snippet from my component:
and this is how I want to test it:
For now, I've got this error:
How can I mock
useRouter, or perhaps you can suggest another way to manage this test to be successfully running?Thanks a lot in advance!
Beta Was this translation helpful? Give feedback.
All reactions