1
由於某些原因,在我的新項目中,儘管有測試並且它們明顯運行,但我的測試覆蓋率始終顯示爲0%。jest-cli代碼覆蓋率僅顯示爲零百分比
Test Suites: 3 failed, 4 passed, 7 total
Tests: 4 failed, 21 passed, 25 total
Snapshots: 0 total
Time: 1.849s, estimated 2s
Ran all test suites.
=============================== Coverage summary ===============================
Statements : 0% (0/663)
Branches : 0% (0/285)
Functions : 0% (0/117)
Lines : 0% (0/496)
================================================================================
我的配置有問題嗎?我的測試文件在__tests__
,這裏是我的配置文件中的笑話配置。
"jest":
{
"automock": true,
"collectCoverage": true,
"collectCoverageFrom": [
"src/js/**/*.js"
],
"coverageReporters": [
"lcov",
"text-summary"
],
"coveragePathIgnorePatterns": [
"<rootDir>/node_modules/"
],
"unmockedModulePathPatterns": [
"/node_modules/keymirror",
"serialport"
]
}
不幸的是,沒有。它不會改變任何東西。謝謝你的迴應。 – sethro