Migration to React Native Testing Library version 11 from version 9.x or 10.x should be a relatively easy task due small amount of breaking changes.
If you use fake timers in any of your tests you should update your Jest dependencies to version 28. This is due to the fact that jest.useFakeTimers()
config structure has changed.
waitForOptions
positionIn version 9 we introducted query options
parameters for each query type. This affected all findBy
and findAllBy
queries because their signatures changed e.g. from:
to
In order to facilitate transition, in version 9 and 10, we provided a temporary possibility to pass WaitForOptions
like timeout
, interval
, etc inside options
argument. From this release we require passing these as the proper third parameter.
This change is easy to implement:
should become
pointerEvents="box-none"
propUp to version 10, RNTL disables all events for a target with pointerEvents="box-none"
. This behavior is counter to how React Native itself functions.
From version 11, RNTL continues to disable press
event for these targets but allows triggering other events, e.g. layout
.
https://github.com/callstack/react-native-testing-library/compare/v10.1.1...v11.0.0