summaryrefslogtreecommitdiff
path: root/cli/tools/test.rs
diff options
context:
space:
mode:
authorColin Ihrig <cjihrig@gmail.com>2022-06-28 10:49:30 -0400
committerGitHub <noreply@github.com>2022-06-28 10:49:30 -0400
commit0f6a5c5fc24e8dc9125c5c536c8547a86ca87b15 (patch)
tree41538ee1df06dc80d60e49ed50177f99ba8dc297 /cli/tools/test.rs
parentab11b45d1d2678cfea2217ac72fc24317eef777d (diff)
feat(web): add beforeunload event (#14830)
This commit adds the 'beforeunload' event. Co-authored-by: Bartek IwaƄczuk <biwanczuk@gmail.com>
Diffstat (limited to 'cli/tools/test.rs')
-rw-r--r--cli/tools/test.rs7
1 files changed, 7 insertions, 0 deletions
diff --git a/cli/tools/test.rs b/cli/tools/test.rs
index ac146fdbf..71374d94e 100644
--- a/cli/tools/test.rs
+++ b/cli/tools/test.rs
@@ -814,6 +814,13 @@ async fn test_specifier(
worker.js_runtime.resolve_value(test_result).await?;
+ loop {
+ if !worker.dispatch_beforeunload_event(&located_script_name!())? {
+ break;
+ }
+ worker.run_event_loop(false).await?;
+ }
+
worker.dispatch_unload_event(&located_script_name!())?;
if let Some(coverage_collector) = maybe_coverage_collector.as_mut() {