我正在使用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