You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Nov 15, 2022. It is now read-only.
In a couple of automated tests, we need to set the current route so it renders what's expected based on the current route.
I suppose it's as easy as exposing a function that modifies closest context value. It could be tricky in regards to nested routing though because tests don't include the whole App, but only a portion of it.
The text was updated successfully, but these errors were encountered:
In a node context you can use the to-be-documented method setPath(). Testing frontend features would require to mock history and location. Maybe its better to fire up a static server and go over the test app with cypress.
Maybe its better to fire up a static server and go over the test app with cypress.
Sure, that works in most cases. But sometimes there is a route driven logic in the component when I don't want to be prop drilling some route parameters. Wondering if that would be still possible with this lib though 🤔
Testing frontend features would require to mock history and location
I believe that's already part of the jest-environment-jsdom, so that should be fine.
In a couple of automated tests, we need to set the current route so it renders what's expected based on the current route.
I suppose it's as easy as exposing a function that modifies closest context value. It could be tricky in regards to nested routing though because tests don't include the whole App, but only a portion of it.
The text was updated successfully, but these errors were encountered: