Chris gives an introduction to React Testing and walks through a Jest and React Testing Library tutorial. Testing is a critical part of the React development process. There is no shortage of different ways to test our apps. This talk will give an intro to general testing principles and tools before diving into the specifics of testing React components using Jest and React Testing Library, the tooling recommended by the React core team.
Guest presenter, Chris Schmitz, Senior Software Engineer at Handshake, will teach you how to get started with Jest and the React Testing Library.
👉 Jest Documentation
https://jestjs.io/docs/en/tutorial-react
👉 React Testing Library
https://testing-library.com/docs/react-testing-library/intro
💻 CodeSandboxes
0-starting-file
https://codesandbox.io/s/0-starting-file-zm2zt
1-rendering-components-for-testing
https://codesandbox.io/s/1-rendering-components-for-testing-y69g5
2-use-dom-testing-library-for-querying-the-dom:
https://codesandbox.io/s/2-use-dom-testing-library-for-querying-the-dom-bzh71
3-rendering-and-testing-with-react-testing-library
https://codesandbox.io/s/3-rendering-and-testing-with-react-testing-library-0kvor
4-simulating-user-interaction
https://codesandbox.io/s/4-simulating-user-interaction-jg46k
5-testing-async-code
https://codesandbox.io/s/5-testing-async-code-4wtsi
Segments:
#react #testing