0
A
回答
0
您应该添加transformIgnorePatterns
到您的package.json:
"jest": {
"preset": "react-native",
"transformIgnorePatterns": [
"/node_modules/(?!react-native|*put library here*)"
]
},
0
只需使用test.skip
it.skip
,xit
或xtest
代替test
或it
跳过特定测试。看看docs。
+0
这个解决方案的问题是我仍然想运行测试,因为它测试我的组件。但是它们在我的组件导入过程中出错。 –
0
在我jestsetup.js,请加
console.error = message => {
// throw new Error(message);
};
我jestsetup.js文件
// Make Enzyme functions available in all test files without importing
import { shallow, render, mount } from 'enzyme';
global.shallow = shallow;
global.render = render;
global.mount = mount;
// Fail tests on any warning
console.error = message => {
// throw new Error(message);
};
相关问题
- 1. Jest覆盖忽略
- 2. Jest:忽略代码覆盖率的行
- 3. rxjs:switchMap忽略错误
- 4. Jest不会忽略.hbs文件
- 5. 的file_get_contents忽略错误
- 6. 忽略JMeter中的错误
- 7. 忽略R中的错误
- 8. Jest-cli错误
- 9. QT [install_target]错误1(忽略)
- 10. 忽略零除法错误
- 11. jquery.validate忽略错误messgae
- 12. Excel宏:忽略错误
- 13. 忽略git显示错误
- 14. 用CruiseControl.Net忽略SVN错误
- 15. HtmlUnit忽略JavaScript错误?
- 16. ThreadPoolExecutor忽略错误(OutOfMemoryError)
- 17. Makefile忽略段错误
- 18. 忽略attrib属性错误
- 19. 忽略插入错误
- 20. RestSharp - 忽略SSL错误
- 21. C#忽略证书错误?
- 22. MySql忽略外键错误
- 23. 好主意忽略错误?
- 24. Common Lisp忽略错误
- 25. SAS:如何忽略错误?
- 26. WinJS - 忽略iframe javascript错误
- 27. eclipse neon - 忽略json错误
- 28. 如何忽略mv错误?
- 29. Excel VBA忽略错误
- 30. java错误advertence - 忽略
不幸的是,它不会忽略我的错误。谢谢你的回答。 –
你有什么错误? –
'TypeError:无法读取Object中未定义的 的属性'样式'。(node_modules/react-native-snap-carousel/index.js:472:842)' 并且在运行应用程序时此错误不会弹出 –