Skip to content

Commit

Permalink
.
Browse files Browse the repository at this point in the history
  • Loading branch information
mmastrac committed Feb 28, 2024
1 parent 3ec1423 commit c60c4eb
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
14 changes: 8 additions & 6 deletions cli/tools/test/reporters/pretty.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ pub struct PrettyTestReporter {
parallel: bool,
echo_output: bool,
in_new_line: bool,
phase: &'static str,
filter: bool,
repl: bool,
scope_test_id: Option<usize>,
Expand All @@ -32,6 +33,7 @@ impl PrettyTestReporter {
parallel,
echo_output,
in_new_line: true,
phase: "",
filter,
repl,
scope_test_id: None,
Expand Down Expand Up @@ -151,7 +153,7 @@ impl PrettyTestReporter {
writeln!(
&mut self.writer,
"{}",
colors::gray("----- output end -----")
colors::gray(format!("----- {}output end -----", self.phase))
)
.unwrap();
self.in_new_line = true;
Expand Down Expand Up @@ -204,17 +206,17 @@ impl TestReporter for PrettyTestReporter {
if !self.in_new_line {
writeln!(&mut self.writer).unwrap();
}
let phase = if !self.started_tests {
"pre-test output"
self.phase = if !self.started_tests {
"pre-test "
} else if self.ended_tests {
"post-test output"
"post-test "
} else {
"output"
""
};
writeln!(
&mut self.writer,
"{}",
colors::gray(format!("------- {phase} -------"))
colors::gray(format!("------- {}output -------", self.phase))
)
.unwrap();
self.in_new_line = true;
Expand Down
4 changes: 2 additions & 2 deletions tests/testdata/test/load_unload.out
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Check [WILDCARD]/load_unload.ts
------- pre-test output -------
load
----- output end -----
----- pre-test output end -----
running 1 test from [WILDCARD]/load_unload.ts
test ...
------- output -------
Expand All @@ -10,7 +10,7 @@ test
test ... ok ([WILDCARD])
------- post-test output -------
unload
----- output end -----
----- post-test output end -----

ok | 1 passed | 0 failed ([WILDCARD])

0 comments on commit c60c4eb

Please sign in to comment.