software-mansion / react-native-gesture-handler

Declarative API exposing platform native touch and gesture system to React Native.
https://docs.swmansion.com/react-native-gesture-handler/
MIT License
6.13k stars 982 forks source link

[jest] Suppress warning about non-worklet callbacks #3050

Closed m-bert closed 3 months ago

m-bert commented 3 months ago

Description

As mentioned in this discussion, while testing Gesture Handler with jest you can see the following warning:

None of the callbacks in the gesture are worklets. If you wish to run them on the JS thread use '.runOnJS(true)' modifier on the gesture to make this explicit. Otherwise, mark the callbacks as 'worklet' to run them on the UI thread.

Since worklets do not work in jest, I believe it is safe to simply suppress this error.

Test plan

Run tests in our repository