refactor: add RootConfig (#14985)

This commit is contained in:
David Sherret 2022-06-28 16:45:55 -04:00 committed by GitHub
parent 5b7bcefa11
commit 01adbb1efb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
21 changed files with 917 additions and 819 deletions

View file

@ -8,7 +8,6 @@ use crate::args::flags_from_vec;
use crate::args::DenoSubcommand;
use crate::checksum;
use crate::create_main_worker;
use crate::emit;
use crate::located_script_name;
use crate::lsp::client::Client;
use crate::lsp::client::TestingNotification;
@ -314,9 +313,9 @@ impl TestRun {
let args = self.get_args();
lsp_log!("Executing test run with arguments: {}", args.join(" "));
let flags = flags_from_vec(args.into_iter().map(String::from).collect())?;
let ps = proc_state::ProcState::build(Arc::new(flags)).await?;
let ps = proc_state::ProcState::build(flags).await?;
let permissions =
Permissions::from_options(&ps.flags.permissions_options());
Permissions::from_options(&ps.config.permissions_options());
test::check_specifiers(
&ps,
permissions.clone(),
@ -325,7 +324,6 @@ impl TestRun {
.iter()
.map(|s| (s.clone(), test::TestMode::Executable))
.collect(),
emit::TypeLib::DenoWindow,
)
.await?;
@ -333,7 +331,7 @@ impl TestRun {
let sender = TestEventSender::new(sender);
let (concurrent_jobs, fail_fast) =
if let DenoSubcommand::Test(test_flags) = &ps.flags.subcommand {
if let DenoSubcommand::Test(test_flags) = ps.config.sub_command() {
(
test_flags.concurrent_jobs.into(),
test_flags.fail_fast.map(|count| count.into()),