If you don't specify any component, but snapshot recorded more than one an error is thrown. Same if you specify a component, but there is only one recording.
Other changes in this PR include:
Organise logic of matcher functions:
Move rawMatchers into separate file
Move snapshot matchers into separate file
Clean up error log of snapshot mismatch and format as an array:
Test plan
File Animations.test.tsx was renamed into TestsOfTestingFramework.test.tsx, include some tests of snapshot mismatch (and mismatch of callback functions)
Tested on Paper, on IOS and Android. Some of the fixes, created to make tests work well on Android, were extracted into separate PR https://github.com/software-mansion/react-native-reanimated/pull/6084
Summary
Previously recording snapshots of component containing multiple views were generating array of all the updates in random order.
The new API is as follows:
If you don't specify any component, but snapshot recorded more than one an error is thrown. Same if you specify a component, but there is only one recording.
Other changes in this PR include:
Test plan
File
Animations.test.tsx
was renamed intoTestsOfTestingFramework.test.tsx
, include some tests of snapshot mismatch (and mismatch of callback functions) Tested on Paper, on IOS and Android. Some of the fixes, created to make tests work well on Android, were extracted into separate PR https://github.com/software-mansion/react-native-reanimated/pull/6084