diff options
author | Leo Kettmeir <crowlkats@toaxl.com> | 2024-05-02 11:13:51 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-05-02 18:13:51 +0000 |
commit | 1b27b5839624ebf9fef65cea28a17281f3b79a74 (patch) | |
tree | 2e07015c800690a682620f1fa61f14cc7719b2be /cli/tools/test/mod.rs | |
parent | 811280af77b5136a2592af7447ac566674309065 (diff) |
fix(test): proper type checking for files with doc tests (#23654)
Closes https://github.com/denoland/deno/issues/23430
---------
Co-authored-by: Yoshiya Hinosawa <stibium121@gmail.com>
Diffstat (limited to 'cli/tools/test/mod.rs')
-rw-r--r-- | cli/tools/test/mod.rs | 33 |
1 files changed, 11 insertions, 22 deletions
diff --git a/cli/tools/test/mod.rs b/cli/tools/test/mod.rs index ffa0fef9e..d63176d39 100644 --- a/cli/tools/test/mod.rs +++ b/cli/tools/test/mod.rs @@ -1326,27 +1326,7 @@ pub async fn check_specifiers( ) .await?; - if !inline_files.is_empty() { - let specifiers = inline_files - .iter() - .map(|file| file.specifier.clone()) - .collect(); - - for file in inline_files { - file_fetcher.insert_memory_files(file); - } - - module_load_preparer - .prepare_module_load( - specifiers, - false, - lib, - PermissionsContainer::new(Permissions::allow_all()), - ) - .await?; - } - - let module_specifiers = specifiers + let mut module_specifiers = specifiers .into_iter() .filter_map(|(specifier, mode)| { if mode != TestMode::Documentation { @@ -1355,7 +1335,16 @@ pub async fn check_specifiers( None } }) - .collect(); + .collect::<Vec<_>>(); + + if !inline_files.is_empty() { + module_specifiers + .extend(inline_files.iter().map(|file| file.specifier.clone())); + + for file in inline_files { + file_fetcher.insert_memory_files(file); + } + } module_load_preparer .prepare_module_load( |