Skip to content

Commit

Permalink
fix: update report
Browse files Browse the repository at this point in the history
  • Loading branch information
sakulstra committed Nov 13, 2024
1 parent 094e779 commit f4f8b39
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 5 deletions.
4 changes: 3 additions & 1 deletion dist/action.js
Original file line number Diff line number Diff line change
Expand Up @@ -20008,15 +20008,17 @@ function generateCoverageDiff(before, after) {
report.lines,
previousRunResult ? getCoverage(previousRunResult.lines) : 0
);
const missedLines = report.lines.details.filter((line) => line.hit === 0).map((line) => `[${line.line}](${report.file}#L${line.line})`).join(",");
const functionCoverage = formatCoverageLine(
report.functions,
previousRunResult ? getCoverage(previousRunResult.functions) : 0
);
const missedFunctions = report.functions.details.filter((line) => line.hit === 0).map((line) => `[${line.name}](${report.file}#L${line.line})`).join(",");
const branchCoverage = formatCoverageLine(
report.branches,
previousRunResult ? getCoverage(previousRunResult.branches) : 0
);
content += `| ${report.file} | ${lineCoverage} | ${functionCoverage} | ${branchCoverage} |
content += `| ${report.file} | ${lineCoverage}<br />${missedLines} | ${functionCoverage}<br />${missedFunctions} | ${branchCoverage} |
`;
}
return content;
Expand Down
4 changes: 3 additions & 1 deletion dist/action.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -20013,15 +20013,17 @@ function generateCoverageDiff(before, after) {
report.lines,
previousRunResult ? getCoverage(previousRunResult.lines) : 0
);
const missedLines = report.lines.details.filter((line) => line.hit === 0).map((line) => `[${line.line}](${report.file}#L${line.line})`).join(",");
const functionCoverage = formatCoverageLine(
report.functions,
previousRunResult ? getCoverage(previousRunResult.functions) : 0
);
const missedFunctions = report.functions.details.filter((line) => line.hit === 0).map((line) => `[${line.name}](${report.file}#L${line.line})`).join(",");
const branchCoverage = formatCoverageLine(
report.branches,
previousRunResult ? getCoverage(previousRunResult.branches) : 0
);
content += `| ${report.file} | ${lineCoverage} | ${functionCoverage} | ${branchCoverage} |
content += `| ${report.file} | ${lineCoverage}<br />${missedLines} | ${functionCoverage}<br />${missedFunctions} | ${branchCoverage} |
`;
}
return content;
Expand Down
4 changes: 3 additions & 1 deletion dist/lib.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,15 +59,17 @@ function generateCoverageDiff(before, after) {
report.lines,
previousRunResult ? getCoverage(previousRunResult.lines) : 0
);
const missedLines = report.lines.details.filter((line) => line.hit === 0).map((line) => `[${line.line}](${report.file}#L${line.line})`).join(",");
const functionCoverage = formatCoverageLine(
report.functions,
previousRunResult ? getCoverage(previousRunResult.functions) : 0
);
const missedFunctions = report.functions.details.filter((line) => line.hit === 0).map((line) => `[${line.name}](${report.file}#L${line.line})`).join(",");
const branchCoverage = formatCoverageLine(
report.branches,
previousRunResult ? getCoverage(previousRunResult.branches) : 0
);
content += `| ${report.file} | ${lineCoverage} | ${functionCoverage} | ${branchCoverage} |
content += `| ${report.file} | ${lineCoverage}<br />${missedLines} | ${functionCoverage}<br />${missedFunctions} | ${branchCoverage} |
`;
}
return content;
Expand Down
4 changes: 3 additions & 1 deletion dist/lib.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,17 @@ function generateCoverageDiff(before, after) {
report.lines,
previousRunResult ? getCoverage(previousRunResult.lines) : 0
);
const missedLines = report.lines.details.filter((line) => line.hit === 0).map((line) => `[${line.line}](${report.file}#L${line.line})`).join(",");
const functionCoverage = formatCoverageLine(
report.functions,
previousRunResult ? getCoverage(previousRunResult.functions) : 0
);
const missedFunctions = report.functions.details.filter((line) => line.hit === 0).map((line) => `[${line.name}](${report.file}#L${line.line})`).join(",");
const branchCoverage = formatCoverageLine(
report.branches,
previousRunResult ? getCoverage(previousRunResult.branches) : 0
);
content += `| ${report.file} | ${lineCoverage} | ${functionCoverage} | ${branchCoverage} |
content += `| ${report.file} | ${lineCoverage}<br />${missedLines} | ${functionCoverage}<br />${missedFunctions} | ${branchCoverage} |
`;
}
return content;
Expand Down
10 changes: 9 additions & 1 deletion src/lib.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,16 +63,24 @@ export function generateCoverageDiff(before: Lcov, after: Lcov) {
report.lines,
previousRunResult ? getCoverage(previousRunResult.lines) : 0,
);
const missedLines = report.lines.details
.filter((line) => line.hit === 0)
.map((line) => `[${line.line}](${report.file}#L${line.line})`)
.join(",");
const functionCoverage = formatCoverageLine(
report.functions,
previousRunResult ? getCoverage(previousRunResult.functions) : 0,
);
const missedFunctions = report.functions.details
.filter((line) => line.hit === 0)
.map((line) => `[${line.name}](${report.file}#L${line.line})`)
.join(",");
const branchCoverage = formatCoverageLine(
report.branches,
previousRunResult ? getCoverage(previousRunResult.branches) : 0,
);

content += `| ${report.file} | ${lineCoverage} | ${functionCoverage} | ${branchCoverage} |\n`;
content += `| ${report.file} | ${lineCoverage}<br />${missedLines} | ${functionCoverage}<br />${missedFunctions} | ${branchCoverage} |\n`;
}
return content;
}

0 comments on commit f4f8b39

Please sign in to comment.