3

I'm trying to write tests for animation that I did with 'react-native-reanimated'.

When the page is loading for the first time the animation is running for 3 sec, so I'm wondering how can I test it.

I thought about taking a snapshot at the start of the animation and then take a snapshot at the end and then I can be sure he did the animation, but i didn't find any delay func that I can use to do so.

Any code example of someone that experienced testing 'react-native-reanimated' with this situation will be great, thanks!

Barak
  • 654
  • 13
  • 30

1 Answers1

0

You can try invoking jest.useFakeTimers() for your suite and then invoke jest.runAllTimers() after you take a snapshot at the start.

purewatashi21
  • 151
  • 3
  • 12