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
Hi @stramel, you can use the wrapper option of renderHook to wrap the test component in anything you want. An example of using a context Provider can be seen in our test suite
constwrapper=({ children })=>(<YourContext.Providervalue="some context">{children}</YourContext.Provider>)const{ result }=renderHook(()=>useYourHook(),{ wrapper })
Please feel free to submit a PR improving the docs as some examples are definitely missing.
What is your question:
How can I wrap a hook with a necessary Provider?
The text was updated successfully, but these errors were encountered: