Menu
Newbedev LogoNEWBEDEV Python Javascript Linux Cheat sheet
Newbedev LogoNEWBEDEV
  • Python 1
  • Javascript
  • Linux
  • Cheat sheet
  • Contact

Cannot navigate to path using MemoryRouter while testing

According to documentation, if you use a regular Router in your test, you should pass a history prop to it

While you may be tempted to stub out the router context yourself, we recommend you wrap your unit test in one of the Router components: the base Router with a history prop, or a <StaticRouter>, <MemoryRouter>, or <BrowserRouter>

Hope this will work. If not, maybe using a second MemoryRouter instead of Router will simply do the job.

Tags:

Jestjs

React Router

Enzyme

Related

EF inserting values in table failed after some time How can I make tuples an instance of this class in Haskell? How to send a response card using AWS Lambda in C# Does Python forbid two similarly looking Unicode identifiers? jQuery - Bodymovin JSON not loading Why is the "move" keyword necessary when it comes to threads; why would I ever not want that behavior? Value of protocol type 'Encodable' cannot conform to 'Encodable'; only struct/enum/class types can conform to protocols Dealing with R8 + JvmStatic Annotation + Lambda in public API for Android Library written in Kotlin Is accessing an element of a multidimensional array out of bounds undefined behavior? Pandas combining sparse columns in dataframe Check if all elements of list are prime in Raku Python Pandas - Reshape Dataframe

Recent Posts

Pandas how to find column contains a certain value Recommended way to install multiple Python versions on Ubuntu 20.04 Build super fast web scraper with Python x100 than BeautifulSoup How to convert a SQL query result to a Pandas DataFrame in Python How to write a Pandas DataFrame to a .csv file in Python
© 2021 newbedevPrivacy Policy