I am studying Jest and i am trying to add it to my component => github.com/bolket/react-native-scrollview-smart.
When i start my test i have this error:
$ jest
FAIL lib/ScrollViewSmart.test.js
● Test suite failed to run
Cannot find module 'setupDevtools' from 'setup.js'
at Resolver.resolveModule (node_modules/jest-resolve/build/index.js:179:17)
at Object.<anonymous> (node_modules/react-native/jest/setup.js:30:1)
Test Suites: 1 failed, 1 total
Tests: 0 total
Snapshots: 0 total
Time: 0.492s
After many attempts i have moved the test in __DEV__
folder and the error has been resolved.
But if i run again the test, i have the error again...🤔.
Can you explain to me what is wrong?
I think there are multiple cases that can lead to this same error. In my case, I had node_modules
added to the ignore_dirs
in the .watchmanconfig
file, I removed it and the error disappeared. Try running jest --no-watchman
to see if watchman is the origin of the problem.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With