From 7ed90a20d04982ae15a52ae2378cbffd4b6839df Mon Sep 17 00:00:00 2001 From: David Sherret Date: Wed, 5 Jun 2024 11:04:16 -0400 Subject: fix: better handling of npm resolution occurring on workers (#24094) Closes https://github.com/denoland/deno/issues/24063 --- cli/tools/test/mod.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'cli/tools/test') diff --git a/cli/tools/test/mod.rs b/cli/tools/test/mod.rs index fa69ad950..06ff39abe 100644 --- a/cli/tools/test/mod.rs +++ b/cli/tools/test/mod.rs @@ -1249,7 +1249,7 @@ fn extract_files_from_source_comments( ) -> Result, AnyError> { let parsed_source = deno_ast::parse_module(deno_ast::ParseParams { specifier: specifier.clone(), - text_info: deno_ast::SourceTextInfo::new(source), + text: source, media_type, capture_tokens: false, maybe_syntax: None, @@ -1273,7 +1273,7 @@ fn extract_files_from_source_comments( specifier, &comment.text, media_type, - parsed_source.text_info().line_index(comment.start()), + parsed_source.text_info_lazy().line_index(comment.start()), blocks_regex, lines_regex, ) @@ -1877,7 +1877,7 @@ pub async fn run_tests_with_watch( let test_modules_to_reload = if let Some(changed_paths) = changed_paths { - let mut result = Vec::new(); + let mut result = IndexSet::with_capacity(test_modules.len()); let changed_paths = changed_paths.into_iter().collect::>(); for test_module_specifier in test_modules { if has_graph_root_local_dependent_changed( @@ -1885,7 +1885,7 @@ pub async fn run_tests_with_watch( test_module_specifier, &changed_paths, ) { - result.push(test_module_specifier.clone()); + result.insert(test_module_specifier.clone()); } } result -- cgit v1.2.3