React Native-JEST:在haste.hasteImplModulePath选项中找不到react-native/jest/hasteImpl.js [英] React Native - JEST: react-native/jest/hasteImpl.js in the haste.hasteImplModulePath option was not found

查看:166
本文介绍了React Native-JEST:在haste.hasteImplModulePath选项中找不到react-native/jest/hasteImpl.js的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在基于expo.io的React Native应用上实现笑话 遵循实施说明后,我已经能够成功通过系统上的笑话测试

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

以下是我在package.json文件中的笑话配置

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!

推荐答案

我遇到了这个问题,并将jest-expo^31.0.0"降级为~29.0.0,它又开始工作了.

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

这篇关于React Native-JEST:在haste.hasteImplModulePath选项中找不到react-native/jest/hasteImpl.js的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆