小编kru*_* kk的帖子

类型错误:无法读取未定义的属性“LENGTH_LONG”

我正在 React Native 中进行玩笑测试,并且在我的项目中使用了 Snackbar。在执行 jest 时,我收到此错误。\'LENGTH_LONG\' 是小吃栏中的内置变量。我发布了我使用“LENGTH_LONG”变量和错误消息的位置。任何人请帮助我

\n\n

\r\n
\r\n
 jest "login"\r\n\r\n FAIL  __tests__\\jest\\LoginScreen.test.js\r\n  \xe2\x97\x8f Test suite failed to run\r\n\r\n    TypeError: Cannot read property \'LENGTH_LONG\' of undefined\r\n\r\n      10 |     ScrollView\r\n      11 | } from "react-native";\r\n    > 12 | import Snackbar from \'react-native-snackbar\';\r\n      13 |\r\n      14 | import { connect } from "react-redux";\r\n      15 | import { Button, Text, Divider } from "react-native-elements";\r\n\r\n      at Object.<anonymous> (node_modules/react-native-snackbar/lib/index.js:1:252)\r\n      at Object.<anonymous> (src/screens/login/loginScreen.js:12:26)\r\n      at Object.<anonymous> (__tests__/jest/LoginScreen.test.js:3:18)\r\n\r\nTest Suites: 1 failed, 1 total\r\nTests:       0 total\r\nSnapshots:   0 …
Run Code Online (Sandbox Code Playgroud)

jestjs react-native react-native-navigation

2
推荐指数
1
解决办法
3991
查看次数