尝试在react native中运行UI测试时,从Jest中获取错误。同时更新了package.json文件
"jest": {
"preset": "react-native",
"setupFiles": [
"<rootDir>/jest/setup.js"
]},"transformIgnorePatterns": [
"node_modules/(?!((jest-)?react-native|react-navigation|@react-navigation/.*))"]
在**/jest/setup.js**中,仅导入jest.mock('@react-navigation/native-stack')
1条答案
按热度按时间hrirmatl1#
在package.js中添加以下代码
///修改此代码
“笑话”:{
“预置”:“React-原生”,
“重置模拟”:假的,
“设置文件”:[
],
],
],
“模块名称Map器”:{
那就进行测试