Fixing React Testing Library 'test was not wrapped in act' warning
When writing tests with React Testing Library, developers often run into the 'React state updates should be wrapped into act' warning.
Category
When writing tests with React Testing Library, developers often run into the 'React state updates should be wrapped into act' warning.
I've been working with error boundaries in React. Here's how to effectively test thrown errors by components wrapped in an error boundary using Vitest and React Testing Library.
I was recently writing unit tests for a project and I wanted to test whether a function in one class had been called by a parent class. Sounds simple right? I found it a bit trickier than anticipated so wanted to share my learnings.