October 2019
Intermediate to advanced
426 pages
11h 49m
English
In addition to the React Hooks Testing Library, we also need a special renderer for React. To render React components to the DOM, we used react-dom; for tests, we can use the react-test-renderer. We are now going to install the React Hooks Testing Library and the react-test-renderer via npm:
> npm install --save-dev @testing-library/react-hooks react-test-renderer
The React Hooks Testing Library should be used in the following circumstances:
However, the library should not be used when a Hook is only defined and used in a single component (local Hooks).
In that case, we should test ...
Read now
Unlock full access