1. 6
    Test Component Rendering with Jest and Testing Library
    3m 31s

Test Component Rendering with Jest and Testing Library

InstructorAndy Van Slaars

Share this video with your friends

Send Tweet

As the core unit of functionality in a React application, our components should be tested. Using Jest and Testing Library, we can render our individual components right in a test context and make assertions about their rendered output and behavior. Tests are a great way to work through API decisions, provide living documentation for your code, and to allow for confidence when refactoring. In this lesson, we'll create an initial test to verify the initial rendered output for a component, given specific props.

~ 3 years ago

It may help to re-iterate that getByText implicitly means "get this element by the text I'm passing in".