我正在使用TypeScript,Jest和ts-jest
NPM模块撰写项目。Jest,Typescript,ts-jest:覆盖率稍微不正确
当我运行我的测试,我得到报道的一些量,但是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"
]
}
}
什么毛病我的配置?
你看过'coverage/remapped/html/index.html'吗? –
谢谢!你可以发布这个作为回应,以便我可以将此标记为正确答案吗? – Rick