mirror of
https://github.com/denoland/deno.git
synced 2025-09-26 12:19:12 +00:00
fix(coverage): Make output table markdown compatible (#29533)
This changes the format of the table outputted by `deno coverage` to be markdown compatible. Related #29532 Closes #29465
This commit is contained in:
parent
fd352537ce
commit
5b65313d48
10 changed files with 52 additions and 80 deletions
|
@ -161,7 +161,7 @@ impl SummaryCoverageReporter {
|
|||
};
|
||||
|
||||
println!(
|
||||
" {file_name} | {branch_percent} | {line_percent} |",
|
||||
"| {file_name} | {branch_percent} | {line_percent} |",
|
||||
file_name = file_name,
|
||||
branch_percent = branch_percent,
|
||||
line_percent = line_percent,
|
||||
|
@ -192,17 +192,19 @@ impl CoverageReporter for SummaryCoverageReporter {
|
|||
.max("All files".len());
|
||||
|
||||
let header =
|
||||
format!("{node:node_max$} | Branch % | Line % |", node = "File");
|
||||
let separator = "-".repeat(header.len());
|
||||
println!("{}", separator);
|
||||
format!("| {node:node_max$} | Branch % | Line % |", node = "File");
|
||||
let separator = format!(
|
||||
"| {} | {} | {} |",
|
||||
"-".repeat(node_max),
|
||||
"-".repeat(8),
|
||||
"-".repeat(6)
|
||||
);
|
||||
println!("{}", header);
|
||||
println!("{}", separator);
|
||||
entries.iter().for_each(|(node, stats)| {
|
||||
self.print_coverage_line(node, node_max, stats);
|
||||
});
|
||||
println!("{}", separator);
|
||||
self.print_coverage_line("All files", node_max, root_stats);
|
||||
println!("{}", separator);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue