It's always important to test your code, especially if you're open-sourcing it for others to use. In this video, we'll learn how to use
react-hooks-testing-library to write a few tests for our custom hook.
Can we still use @testing-library/react-hooks with react version 16.8. ?
Not that I know of. According to the docs for @testing-library/react-hooks, they say,
The minimum supported version of react and react-test-renderer is ^16.9.0
Isn't it safer to mock the network call? BTW, there's a funky typo in the transcript: "givs" should be "keys".
@Jeff Yes, you're absolutely right that it's safer to mock the network call. Generally, that's preferred.
Thanks for the flag on the transcript! I've flagged the lesson for the egghead team to update.