我正在尝试进行开玩笑的测试后获取测试结果和代码覆盖率数据。结果文件包含测试结果,但不包含覆盖率数据。我以玩笑为准。这是我的package.json中的内容:
"scripts": {
"test": "jest --verbose --silent --coverage --coverageDirectory=./",
"start": "node server.js",
"dev": "nodemon server.js"
},
"jest": {
"testEnvironment": "node",
"coveragePathIgnorePatterns": [
"/node_modules/"
],
"coverageReporters": [
"text",
"jest-junit"
],
"reporters": [
"default",
"jest-junit"
]
},
"jest-junit": {
"suiteName": "jest tests",
"outputDirectory": ".",
"outputName": "junit.xml",
"uniqueOutputName": "false",
"classNameTemplate": "{classname}-{title}",
"titleTemplate": "{classname}-{title}",
"ancestorSeparator": " › ",
"usePathForSuiteName": "true"
}