Ric*_*ick 11 node.js typescript jestjs
我正在使用TypeScript,Jest和ts-jestNPM模块来编写项目.
当我运行我的测试时,我确实获得了一些覆盖率,但HTML报告并不完全正确:
此外,一些功能被标记为未经测试,即使它们当然被调用.
我的package.json设置如下:
{
"jest": {
"transform": {
".(ts|tsx)": "<rootDir>/node_modules/ts-jest/preprocessor.js"
},
"testRegex": "(/__tests__/.*|\\.(test|spec))\\.(ts|tsx|js)$",
"moduleFileExtensions": [
"ts",
"tsx",
"js"
],
"testResultsProcessor": "<rootDir>/node_modules/ts-jest/coverageprocessor.js",
"collectCoverage": true,
"collectCoverageFrom": [
"src/**/*.{ts,tsx}"
],
"coverageReporters": [
"html",
"json"
]
}
}
Run Code Online (Sandbox Code Playgroud)
我的配置有问题吗?
UPDATE
从jest @ 20开始,您可以传递mapCoverage选项并使用coverage/lcov-report/index.html文件.
旧
我也一直在努力解决这个问题,但后来我注意到了这一点.
长篇短篇报道报道coverage/remapped/html/index.html归档.
| 归档时间: |
|
| 查看次数: |
3454 次 |
| 最近记录: |