如何在 Jest 中模拟 Image 的 propType(React Native)

Sib*_*ini 5 snapshot mocking jestjs react-native

我在使用react-native和react-native-router-flux的玩笑测试中出现以下错误

Runtime Error
  - TypeError: Cannot read property 'source' of undefined
        at Object.<anonymous> (node_modules/react-native-router-flux/src/NavBar.js:155:45)
        at Object.<anonymous> (node_modules/react-native-router-flux/src/DefaultRenderer.js:21:13)
        at Object.<anonymous> (node_modules/react-native-router-flux/index.js:3:22)
Run Code Online (Sandbox Code Playgroud)

这是导致麻烦的行

backButtonImage:Image.propTypes.source,

所以我猜 Image.propTypes 定义不正确

我怎样才能解决这个问题?