reactjs - 在 reactjs 中用 amCharts4 开玩笑
问题描述
使用amcharts4
. 我试过使用
"jest": {
"transformIgnorePatterns": [
"[/\\\\]node_modules[/\\\\](?!(@amcharts)\\/).+\\.(js|jsx|ts|tsx)$"
],}
但这并没有解决问题。的文档amCharts
提到它可以使用jest
with来解决puppeteer
。有人知道这个问题的任何其他解决方法吗?使用jest
withpuppeteer
是唯一的解决方案吗?
解决方案
我们需要在jest
配置中添加以下代码,如果您mount/shallow
用于测试,请移至ReactDOM.render()
asjest
不支持测试SVG
和内部amCharts
使用SVG
。
"jest": {
"transformIgnorePatterns": [
"node_modules[/\\\\](?!@amcharts[/\\\\]amcharts4)"
]
}
推荐阅读
- trading - 为多交叉条件检查存储交叉值 Pine 脚本
- javascript - 合并具有相同键的对象数组
- python - 谁能解释为什么“二”>“七十亿”等于真?
- html - 如何将无法调整的表格放入 Google Web Designer?
- javascript - 如何使用 CSVLink 下载所有行?
- android - 使用jetpack compose的Android滑动动画
- wordpress - wp-nav-menu 生成一个空的 a 标签
- python - 无法使用 python 连接到已经打开的 SAP GUI 会话
- entity-framework-core - 为什么我不能使用 EF Core 在现有数据库中创建新表?(代码优先)
- ios - 发布版本的 module.modulemap 中缺少 Foo-Swift.h