From 9114a2df69da9318c4e10887553b7daf77b0fa16 Mon Sep 17 00:00:00 2001 From: David Sherret Date: Tue, 23 Jul 2024 19:00:48 -0400 Subject: fix(upgrade): do not error if config in cwd invalid (#24689) ``` > deno upgrade error: Unsupported lockfile version 'invalid'. Try upgrading Deno or recreating the lockfile. V:\scratch > V:\deno\target\debug\deno upgrade Looking up latest version Local deno version 1.45.3 is the most recent release ``` Closes #24517 Closes #20729 --- cli/tools/test/mod.rs | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) (limited to 'cli/tools/test') diff --git a/cli/tools/test/mod.rs b/cli/tools/test/mod.rs index 587b737d6..904b9ecb7 100644 --- a/cli/tools/test/mod.rs +++ b/cli/tools/test/mod.rs @@ -7,7 +7,6 @@ use crate::args::TestReporterConfig; use crate::colors; use crate::display; use crate::factory::CliFactory; -use crate::factory::CliFactoryBuilder; use crate::file_fetcher::File; use crate::file_fetcher::FileFetcher; use crate::graph_container::MainModuleGraphContainer; @@ -1738,11 +1737,11 @@ async fn fetch_specifiers_with_test_mode( } pub async fn run_tests( - flags: Flags, + flags: Arc, test_flags: TestFlags, ) -> Result<(), AnyError> { - let factory = CliFactory::from_flags(flags)?; - let cli_options = factory.cli_options(); + let factory = CliFactory::from_flags(flags); + let cli_options = factory.cli_options()?; let workspace_test_options = cli_options.resolve_workspace_test_options(&test_flags); let file_fetcher = factory.file_fetcher()?; @@ -1821,7 +1820,7 @@ pub async fn run_tests( } pub async fn run_tests_with_watch( - flags: Flags, + flags: Arc, test_flags: TestFlags, ) -> Result<(), AnyError> { // On top of the sigint handlers which are added and unbound for each test @@ -1850,9 +1849,11 @@ pub async fn run_tests_with_watch( move |flags, watcher_communicator, changed_paths| { let test_flags = test_flags.clone(); Ok(async move { - let factory = CliFactoryBuilder::new() - .build_from_flags_for_watcher(flags, watcher_communicator.clone())?; - let cli_options = factory.cli_options(); + let factory = CliFactory::from_flags_for_watcher( + flags, + watcher_communicator.clone(), + ); + let cli_options = factory.cli_options()?; let workspace_test_options = cli_options.resolve_workspace_test_options(&test_flags); -- cgit v1.2.3