Repository navigation
Replies: 1 comment
|
The important part is not to import those helpers from src/jestUtils, because that is an internal source path. Also make sure RNGH's Jest setup is loaded: Then give the gesture a test ID and simulate its lifecycle: fireGestureHandler(getByGestureTestId('pan'), [ So the main fixes are: use the documented jest-utils entry point instead of importing from src, and make sure jestSetup.js is loaded. |
Uh oh!
There was an error while loading. Please reload this page.
I cant find a good source on how to write tests within the docs. Its saying that it imports two functions, getByGestureTestId and fireGestureHandler but there is no import statements of those functions in the library. Also I found their location under react-native-gesture-handler/src/jestUtils but when I import them, they aren't working. How can I test my components properly?
All reactions