summaryrefslogtreecommitdiff
path: root/cli/tools/test.rs
diff options
context:
space:
mode:
authorBartek IwaƄczuk <biwanczuk@gmail.com>2021-12-21 15:49:27 +0100
committerGitHub <noreply@github.com>2021-12-21 15:49:27 +0100
commit907cef563ec83fb5e8b95aeddbb54b5ebbf38746 (patch)
tree7695484aa68ee73071229122fa4219321e29a0c1 /cli/tools/test.rs
parent9825c876b466cf69a8ddd1646ba7fedecd54ba51 (diff)
refactor: cleanup cli/main.rs (#13160)
Diffstat (limited to 'cli/tools/test.rs')
-rw-r--r--cli/tools/test.rs10
1 files changed, 2 insertions, 8 deletions
diff --git a/cli/tools/test.rs b/cli/tools/test.rs
index 2e5c8b503..959cefcc1 100644
--- a/cli/tools/test.rs
+++ b/cli/tools/test.rs
@@ -487,10 +487,7 @@ async fn test_specifier(
worker.execute_side_module(&specifier).await?;
}
- worker.js_runtime.execute_script(
- &located_script_name!(),
- "window.dispatchEvent(new Event('load'));",
- )?;
+ worker.dispatch_load_event(&located_script_name!())?;
let test_result = worker.js_runtime.execute_script(
&located_script_name!(),
@@ -505,10 +502,7 @@ async fn test_specifier(
worker.js_runtime.resolve_value(test_result).await?;
- worker.js_runtime.execute_script(
- &located_script_name!(),
- "window.dispatchEvent(new Event('unload'));",
- )?;
+ worker.dispatch_unload_event(&located_script_name!())?;
if let Some(coverage_collector) = maybe_coverage_collector.as_mut() {
worker