mirror of
https://github.com/denoland/deno.git
synced 2025-03-03 09:31:22 -05:00
feat(test): repeat test name if there's user output (#14495)
This commit changes test report output to repeat test name before printing result, but only if there's user output, denoted by markers.
This commit is contained in:
parent
23efc4fcab
commit
d4ad2b809c
4 changed files with 21 additions and 5 deletions
5
cli/tests/testdata/test/pass.out
vendored
5
cli/tests/testdata/test/pass.out
vendored
|
@ -9,6 +9,11 @@ test 5 ... ok ([WILDCARD])
|
|||
test 6 ... ok ([WILDCARD])
|
||||
test 7 ... ok ([WILDCARD])
|
||||
test 8 ... ok ([WILDCARD])
|
||||
test 9 ...
|
||||
------- output -------
|
||||
console.log
|
||||
console.error
|
||||
----- output end -----
|
||||
test 9 ... ok ([WILDCARD])
|
||||
|
||||
test result: ok. 10 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out ([WILDCARD])
|
||||
|
|
5
cli/tests/testdata/test/pass.ts
vendored
5
cli/tests/testdata/test/pass.ts
vendored
|
@ -7,4 +7,7 @@ Deno.test("test 5", () => {});
|
|||
Deno.test("test 6", () => {});
|
||||
Deno.test("test 7", () => {});
|
||||
Deno.test("test 8", () => {});
|
||||
Deno.test("test 9", () => {});
|
||||
Deno.test("test 9", () => {
|
||||
console.log("console.log");
|
||||
console.error("console.error");
|
||||
});
|
||||
|
|
|
@ -12,20 +12,20 @@ description ...
|
|||
------- output -------
|
||||
3
|
||||
----- output end -----
|
||||
ok ([WILDCARD]ms)
|
||||
inner 1 ... ok ([WILDCARD]ms)
|
||||
inner 2 ...
|
||||
------- output -------
|
||||
4
|
||||
----- output end -----
|
||||
ok ([WILDCARD]ms)
|
||||
inner 2 ... ok ([WILDCARD]ms)
|
||||
|
||||
------- output -------
|
||||
5
|
||||
----- output end -----
|
||||
ok ([WILDCARD]ms)
|
||||
step 1 ... ok ([WILDCARD]ms)
|
||||
|
||||
------- output -------
|
||||
6
|
||||
----- output end -----
|
||||
ok ([WILDCARD]ms)
|
||||
description ... ok ([WILDCARD]ms)
|
||||
[WILDCARD]
|
||||
|
|
|
@ -312,6 +312,10 @@ impl PrettyTestReporter {
|
|||
print!("{}", " ".repeat(description.level));
|
||||
}
|
||||
|
||||
if wrote_user_output {
|
||||
print!("{} ... ", description.name);
|
||||
}
|
||||
|
||||
println!(
|
||||
"{} {}",
|
||||
status,
|
||||
|
@ -414,6 +418,10 @@ impl TestReporter for PrettyTestReporter {
|
|||
print!(" ");
|
||||
}
|
||||
|
||||
if wrote_user_output {
|
||||
print!("{} ... ", description.name);
|
||||
}
|
||||
|
||||
let status = match result {
|
||||
TestResult::Ok => colors::green("ok").to_string(),
|
||||
TestResult::Ignored => colors::yellow("ignored").to_string(),
|
||||
|
|
Loading…
Add table
Reference in a new issue