Testing Custom React Hooks

Learn to test custom React Hooks in this lesson.

Starter project

The project for this lesson contains a HomePage component that uses a custom hook, useTitle, to set the document title to "My App - Home". In this lesson, we’ll create a test for useTitle.

A copy of the project is in the code widget below. Clicking the “Run” button executes the tests.

Get hands-on with 1400+ tech skills courses.