ITADN

How to generate full coverage data in out.json for all source files?

#293OpenWallaceChen123 创建于 2024-04-17
W
WallaceChen123commented
I am using babel-plugin-istanbul to generate code coverage report, however, I found that the out.json file only includes the coverage data for tested source files as below: "C:\\path\\to\\file\\a.ts": { "path": "C:\\path\\to\\file\\a.ts", "statementMap": { "0": { "start": { "line": 4, "column": 2 }, "end": { "line": 4, "column": 116 } }, ......skip other data...... } the coverage data for un-tested source files is missing as below: "C:/path/to/file/b.ts": { "path": "C:/path/to/file/b.ts", "statementMap": {}, "fnMap": {}, "branchMap": {}, "s": {}, "f": {}, "b": {} }, Based on the out.json file, the generated coverage report only displays coverage for the tested source files and ignores un-tested source files, so the total coverage is incorrect. May I know is there any method to generate all coverage data in out.json for all source files including tested and un-tested source files? Thanks in advance.
2 条评论