Explores how to test timer-based actions in React 18.
See "Planned changes to act
testing API" for more information.
Testing real timers currently has a misleading warning.
When letting real timers run, React will issue warnings if an update was not wrapped in act.
However, wrapping the real timer run inside act()
will only flush the updates when exiting the act
call.
This makes it impossible to wait for a generic condition e.g. an element to appear.