React Native - JEST: react-native/jest/hasteImpl.js in the haste.hasteImplModulePath option was not found

Viewed 949

I am implementing jest on a react native application based on expo.io After following the implementation notes I have been able to successfully pass the jest tests on my system

The issue is with bitbucket pipelines. I get the following issue and the pipeline gets failed

npx jest --ci
ā— Validation Error:
  Module react-native/jest/hasteImpl.js in the haste.hasteImplModulePath option was not found.
     <rootDir> is: /opt/atlassian/pipelines/agent/build

The following is my jest config in the package.json file

"jest": {
    "preset": "jest-expo"
},
"devDependencies": {
    "babel-jest": "^23.6.0",
    "babel-preset-react-native": "^4.0.1",
    "expo-cli": "^2.4.3",
    "enzyme": "3.3.0",
    "enzyme-adapter-react-16": "1.1.1",
    "jest": "^23.6.0",
    "jest-expo": "^31.0.0",
    "jest-react-native": "^18.0.0",
    "react-test-renderer": "^16.6.3"

}

Can someone please let know how can i resolve this issue?

The application and tests work fine. But its the pipeline which gets failed!

1 Answers

I had this issue and downgraded jest-expo from ^31.0.0" to ~29.0.0 and it started working again.

Related