Skip to content

Commit

Permalink
feat: polish logs (tests vs scripts)
Browse files Browse the repository at this point in the history
  • Loading branch information
lgalabru committed Jun 24, 2021
1 parent 6ecdfb0 commit 2810a92
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions vendor/deno/cli/tools/test_runner.rs
Original file line number Diff line number Diff line change
Expand Up @@ -103,19 +103,16 @@ impl TestReporter for PrettyTestReporter {
filtered,
only: _,
} => {
if *pending == 1 {
println!("running {} test from {}", pending, event.origin);
} else {
println!("running {} tests from {}", pending, event.origin);
}

println!("Running {}", event.origin);
self.pending += pending;
self.filtered_out += filtered;
}

TestMessage::Wait { name } => {
if !self.concurrent {
print!("test {} ...", name);
if name != "running script" {
print!("* {} ...", name);
}
}
}

Expand All @@ -127,7 +124,9 @@ impl TestReporter for PrettyTestReporter {
self.pending -= 1;

if self.concurrent {
print!("test {} ...", name);
if name != "running script" {
print!("* {} ...", name);
}
}

match result {
Expand Down Expand Up @@ -185,7 +184,8 @@ impl TestReporter for PrettyTestReporter {
colors::green("ok").to_string()
};

println!(
if (self.passed + self.failed + self.ignored + self.filtered_out + self.measured) > 1 {
println!(
"\ntest result: {}. {} passed; {} failed; {} ignored; {} measured; {} filtered out {}\n",
status,
self.passed,
Expand All @@ -195,6 +195,7 @@ impl TestReporter for PrettyTestReporter {
self.filtered_out,
colors::gray(format!("({}ms)", self.time.elapsed().as_millis())),
);
}
}
}

Expand Down

0 comments on commit 2810a92

Please sign in to comment.