Vis*_*ati 5 unit-testing code-coverage reactjs jestjs
我正在使用 Jest 对我的 ReactJS 应用程序进行单元测试,并添加了配置以获取代码覆盖率。覆盖率在 cli 上运行良好,但是当我尝试将覆盖率报告导出为 html 时,报告中未显示与每个文件对应的值。这是我的 jest.config.json:
{
"roots": [
"test"
],
"collectCoverage": true,
"coverageReporters": ["text","html"],
"coverageDirectory": "<rootDir>/coverage/"
}
Run Code Online (Sandbox Code Playgroud)
这是我在 index.html 文件中的coverage文件夹中生成的报告:
可以看出,数字丢失了。当文本报告也显示正确的值时,可能是什么原因。它只发生在 html 报告中。
| 归档时间: |
|
| 查看次数: |
1582 次 |
| 最近记录: |