【发布时间】:2017-12-03 07:58:16
【问题描述】:
当我运行npm test:
➜ mobile git:(develop) ✗ npm test
> jest
FAIL __tests__/index.js
● Test suite failed to run
TypeError: Cannot read property 'fs' of undefined
at Object.<anonymous> (node_modules/react-native-cached-image/utils/fsUtils.js:9:12)
at Object.<anonymous> (node_modules/react-native-cached-image/ImageCacheManager.js:5:13)
at Object.<anonymous> (node_modules/react-native-cached-image/CachedImage.js:13:23)
我看到它与 react-native-cached-image 对 fs 的依赖有关。
我必须以某种方式模拟 fs 吗?我尝试了几件事,但没有成功。
【问题讨论】:
标签: react-native jestjs