我对嘲笑单元测试非常陌生,所以像模拟模块这样的东西是令人困惑的。在react本机中,有一个组件使用firebase数据库从给定的ref返回数据:// when the data of the current user is available });});我现在正在尝试进行使用以下组件的单元测试:impo
为了查看我的代码是否有效,我使用为库编写的代码编写了一个简单的单元测试。由于这是第一次对进行测试,所以我将react-native与metro-react-native-babel-preset一起添加为开发依赖项。此外,我给babel添加了预置。" relative to directory(node:1841) UnhandledPromiseRejectionWarning: Er
我刚刚将TouchableOpacity添加到一个组件中,应用程序运行正常,但我使用react-native-testing-library的测试无法运行:
at Object.Direction (node_modules/react-native-gesture-handler<anonymous&