【发布时间】:2021-02-24 06:40:09
【问题描述】:
使用过 jest --config /path/jest-e2.json --coverage
但它没有生成任何文件,只有空白索引文件。虽然测试正在运行。我想要一份e2e测试报告。
e2e 设置
{
"moduleFileExtensions": ["js", "json", "ts"],
"rootDir": ".",
"testEnvironment": "node",
"testRegex": ".e2e-spec.ts$",
"transform": {
"^.+\\.(t|j)s$": "ts-jest"
},
"coverageDirectory": "../coverage/e2e",
"coverageReporters" : ["json", "lcov", "text", "clover"],
"coveragePathIgnorePatterns": [
".module.ts$",
".spec.ts$"
]
}
【问题讨论】:
-
您的
jest-e2.json中的coverageReporters可能已更改。看看coverageReporters docs -
你能展示你的测试配置吗?
-
@Teneff 已更新问题。请检查
-
@JayMcDoniel 已更新问题。请检查
-
@varuog 尝试将
coverageDirectory替换为"<rootDir>/coveage/e2e
标签: node.js express jestjs nestjs istanbul