1. 22
    Get Rid of the "not wrapped in act(...)" Warning
    2m 13s

Get Rid of the "not wrapped in act(...)" Warning

Share this video with your friends

Send Tweet

For many years, the most annoying thing about writing tests with the React Testing Library is when the "not wrapped in act(...)" warning appears in your console. act is a React testing util that ensures all UI updates are wrapped up before proceeding with your test case. What we often miss is that we actually don't need act and that this error is there to tell us something instead, and that is: You are not testing everything!

In this lesson, we are going to understand why the "not wrapped in act(...)" shows up and how to get rid of it!

Syed Ahmad
Syed Ahmad
~ a year ago

Love the "not wrapped in act(...)" solution 🚀.