@testing-library/react
16.3.3 · 27 Aug 2026MIT89.5M / weekRepositoryHomepagenpmAtom feed
9.5.0 is the newest release of 9.x.
In short
3 breaking1 new1 internal
- breaking
deps: If you were using
debugDOMbefore, useprettyDOMinstead. Note thatdebugDOMis different fromdebugwhich you get back fromrender. That is unchanged. - breaking
cleanup: If your tests were not isolated before (and you referenced the same component between tests) then this change will break your tests. You should keep your tests isolated, but if you're unable/unwilling to do that right away, then you can either run your tests with the environment variable
RTL_SKIP_AUTO_CLEANUPset totrueor import@testing-library/react/pureinstead of@testing-library/react. - breaking
cleanup-after-each: If any of your code has
import '@testing-library/react/cleanup-after-each'then you need to remove that. It's happening automatically now.
Release note
Features
Breaking changes
- breaking
deps: If you were using
debugDOMbefore, useprettyDOMinstead. Note thatdebugDOMis different fromdebugwhich you get back fromrender. That is unchanged. - breaking
cleanup: If your tests were not isolated before (and you referenced the same component between tests) then this change will break your tests. You should keep your tests isolated, but if you're unable/unwilling to do that right away, then you can either run your tests with the environment variable
RTL_SKIP_AUTO_CLEANUPset totrueor import@testing-library/react/pureinstead of@testing-library/react. - breaking
cleanup-after-each: If any of your code has
import '@testing-library/react/cleanup-after-each'then you need to remove that. It's happening automatically now.