summaryrefslogtreecommitdiff
path: root/cli/tools/test/mod.rs
diff options
context:
space:
mode:
Diffstat (limited to 'cli/tools/test/mod.rs')
-rw-r--r--cli/tools/test/mod.rs9
1 files changed, 6 insertions, 3 deletions
diff --git a/cli/tools/test/mod.rs b/cli/tools/test/mod.rs
index 0f10188bc..6b592f95e 100644
--- a/cli/tools/test/mod.rs
+++ b/cli/tools/test/mod.rs
@@ -391,7 +391,7 @@ pub enum TestEvent {
StepRegister(TestStepDescription),
StepWait(usize),
StepResult(usize, TestStepResult, u64),
- /// Indicates that this worker has completed.
+ /// Indicates that this worker has completed running tests.
Completed,
/// Indicates that the user has cancelled the test run with Ctrl+C and
/// the run should be aborted.
@@ -513,7 +513,7 @@ pub async fn test_specifier(
worker_factory,
permissions,
specifier.clone(),
- &worker_sender.sender,
+ &mut worker_sender.sender,
StdioPipe::file(worker_sender.stdout),
StdioPipe::file(worker_sender.stderr),
fail_fast_tracker,
@@ -543,7 +543,7 @@ async fn test_specifier_inner(
worker_factory: Arc<CliMainWorkerFactory>,
permissions: Permissions,
specifier: ModuleSpecifier,
- sender: &TestEventSender,
+ sender: &mut TestEventSender,
stdout: StdioPipe,
stderr: StdioPipe,
fail_fast_tracker: FailFastTracker,
@@ -592,6 +592,9 @@ async fn test_specifier_inner(
worker.dispatch_beforeunload_event(located_script_name!())?;
worker.dispatch_unload_event(located_script_name!())?;
+ // Ensure all output has been flushed
+ _ = sender.flush();
+
// Ensure the worker has settled so we can catch any remaining unhandled rejections. We don't
// want to wait forever here.
worker.run_up_to_duration(Duration::from_millis(0)).await?;