diff options
author | David Sherret <dsherret@users.noreply.github.com> | 2022-08-11 16:59:12 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-08-11 16:59:12 -0400 |
commit | c3b04683c55fef8929e83429ec17b7a6898c6048 (patch) | |
tree | 64190eea354854ae18f0fd993d4687b870201c6a /cli/lsp/testing/execution.rs | |
parent | e4a5f9952f404e10f1b577b1477b89b155092b67 (diff) |
refactor(cli): consolidate most MainWorker related code to the same place (#15459)
Diffstat (limited to 'cli/lsp/testing/execution.rs')
-rw-r--r-- | cli/lsp/testing/execution.rs | 35 |
1 files changed, 1 insertions, 34 deletions
diff --git a/cli/lsp/testing/execution.rs b/cli/lsp/testing/execution.rs index de74de40e..dde834221 100644 --- a/cli/lsp/testing/execution.rs +++ b/cli/lsp/testing/execution.rs @@ -8,7 +8,6 @@ use crate::args::flags_from_vec; use crate::args::DenoSubcommand; use crate::checksum; use crate::create_main_worker; -use crate::located_script_name; use crate::lsp::client::Client; use crate::lsp::client::TestingNotification; use crate::lsp::config; @@ -166,39 +165,7 @@ async fn test_specifier( stderr: StdioPipe::File(sender.stderr()), }, ); - - worker.js_runtime.execute_script( - &located_script_name!(), - r#"Deno[Deno.internal].enableTestAndBench()"#, - )?; - - worker - .execute_script( - &located_script_name!(), - "Deno.core.enableOpCallTracing();", - ) - .unwrap(); - - if mode != test::TestMode::Documentation { - worker.execute_side_module(&specifier).await?; - } - - worker.dispatch_load_event(&located_script_name!())?; - - let test_result = worker.js_runtime.execute_script( - &located_script_name!(), - r#"Deno[Deno.internal].runTests()"#, - )?; - - 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!())?; + worker.run_lsp_test_specifier(mode).await?; } Ok(()) |