diff options
Diffstat (limited to 'cli/tools/test.rs')
-rw-r--r-- | cli/tools/test.rs | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/cli/tools/test.rs b/cli/tools/test.rs index 847260352..50e220a46 100644 --- a/cli/tools/test.rs +++ b/cli/tools/test.rs @@ -1033,12 +1033,9 @@ pub async fn test_specifier( sender.send(TestEvent::Result(desc.id, result, elapsed as u64))?; } - loop { - if !worker.dispatch_beforeunload_event(located_script_name!())? { - break; - } - worker.run_event_loop(false).await?; - } + // Ignore `defaultPrevented` of the `beforeunload` event. We don't allow the + // event loop to continue beyond what's needed to await results. + worker.dispatch_beforeunload_event(located_script_name!())?; worker.dispatch_unload_event(located_script_name!())?; if let Some(coverage_collector) = coverage_collector.as_mut() { |