mirror of
https://github.com/denoland/deno.git
synced 2025-07-31 09:05:19 +00:00
fix(cli): ensure that pre- and post-test output is flushed at the appropriate times (#22611)
Some `deno_std` tests were failing to print output that was resolved after the last test finished. In addition, output printed before tests began would sometimes appear above the "running X tests ..." line, and sometimes below it depending on timing. We now guarantee that all output is flushed before and after tests run, making the output consistent. Pre-test and post-test output are captured in `------ pre-test output ------` and `------ post-test output ------` blocks to differentiate them from the regular output blocks. Here's an example of a test (that is much noisier than normal, but an example of what the output will look like): ``` Check ./load_unload.ts ------- pre-test output ------- load ----- output end ----- running 1 test from ./load_unload.ts test ... ------- output ------- test ----- output end ----- test ... ok ([WILDCARD]) ------- post-test output ------- unload ----- output end ----- ```
This commit is contained in:
parent
c9b2139b1e
commit
b6e44f91ad
14 changed files with 213 additions and 31 deletions
|
@ -397,6 +397,9 @@ impl TestRun {
|
|||
);
|
||||
}
|
||||
}
|
||||
test::TestEvent::Completed => {
|
||||
reporter.report_completed();
|
||||
}
|
||||
test::TestEvent::ForceEndReport => {}
|
||||
test::TestEvent::Sigint => {}
|
||||
}
|
||||
|
@ -742,6 +745,10 @@ impl LspTestReporter {
|
|||
}
|
||||
}
|
||||
|
||||
fn report_completed(&mut self) {
|
||||
// there is nothing to do on report_completed
|
||||
}
|
||||
|
||||
fn report_summary(
|
||||
&mut self,
|
||||
_summary: &test::TestSummary,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue