当测试用例失败且includeFailureMsg
= true时,不会生成index.html / test报告
的package.json
"name": "test",
"jest": {
"transform": {},
"verbose": true,
"bail": true,
"testMatch": ["path"],
"testResultsProcessor": "./node_modules/jest-html-reporter"
},
"jest-html-reporter": {
"pageTitle": "Your test suite",
"outputPath": "test-report.html",
"includeFailureMsg": true
},
"dependencies": {
"jest-html-reporter": "^2.3.0"
}
通过使用jest-stare包。我能够解决我的问题,希望它对其他人有帮助。