It does not appear to respect the NODE_PATHS
env variable, and instead just looks in the current directory.
By default, if Jest sees a Babel config, it will use that to transform your files, ignoring "node_modules".
To run Jest tests only for current folder, we can run jest with the path of the folder with the tests we want to run. to run the tests in the dev/app folder given that the test script runs jest . We can also set the testPathPattern option to the folder with the tests we want to run. to run the tests in dev/app .
From Jest doc:
https://jestjs.io/docs/en/configuration
in package.json
define:
"jest": {
"modulePaths": [
"<rootDir>/src/"
],
},
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