-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
testing custom hook within a component scope throws TypeError not a function #1144
Comments
Sorry, i think i'm maybe missing something. If you're trying to test a component with RTL, why are you posting this question in RHTL? 😄 Secondly, can you share your test code & component please? |
I'm sorry my bad didn't realize this was RHTL
then in another context provider
In the test
|
@AhmedSarhanSwvl were you able to fix this? |
I had a similar issue - the problem was that in my jest config I had a poorly defined |
when I run my unit tests to test componernts, I recieve errors similar to this one in multiple places:
TypeError: (0 , _fileName.useCustomHook) is not a function
when I test the hook itself alone it works fine, but I don't want to test the hook I want to test the component and the component have data that depends on my custom hook
Notes:
@testing-library/react": "^12.1.2 and @testing-library/react-hooks: "^8.0.1",
can someone please help with this?
The text was updated successfully, but these errors were encountered: