Test React Components that use React Hooks

Share this video with your friends

Send Tweet

Testing our <Counter /> React Component that uses the useState hook is actually very straightforward with react-testing-library. Let's give it a whirl!

Darren Seet
Darren Seet
~ 5 years ago

Hey Kent,

I got a test is not defined error when running this in codesandbox. Am I missing some references, I tried playing with the dependencies and also imports. Even using @testing-library/react but I could not get it to work

~ 2 years ago

react-testing-library has been deprecated