Testing selectors that are dependent on RTK Query in isolation #4016
marcoturi
started this conversation in
Show and tell
Replies: 1 comment 7 replies
-
generally instead of mocking state, we recommend setting up a real store and instead using something like Mock Service Worker to intercept the (real) network requests. That way, you don't have to worry about how the reducers manage state. |
Beta Was this translation helpful? Give feedback.
7 replies
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.
-
I would like to test a selector that is dependent on RTK query and I would like to get a mocked state without having to know the implementation details on how RTK Query design its state:
Instead I would like to achieve the same result in a way similar to this:
I expect this to be a common scenario in modern redux testing and was wandering if there is no already built-in solution for this situation.
Beta Was this translation helpful? Give feedback.
All reactions