@@ -165,7 +165,6 @@ pub async fn do_run_tests(include: Vec<String>, include_coverage: bool, watch: b
165165 include. clone ( )
166166 } ;
167167
168- let doc_modules = vec ! [ ] ;
169168 let allow_none = true ;
170169 let no_run = false ;
171170 let concurrent_jobs = 2 ;
@@ -191,9 +190,9 @@ pub async fn do_run_tests(include: Vec<String>, include_coverage: bool, watch: b
191190 let doc_modules_result = test_runner:: collect_test_module_specifiers (
192191 include. clone ( ) ,
193192 & cwd,
194- fs_util :: is_supported_ext,
193+ is_supported_ext,
195194 ) ;
196-
195+
197196 let test_modules_result = test_runner:: collect_test_module_specifiers (
198197 include. clone ( ) ,
199198 & cwd,
@@ -207,6 +206,8 @@ pub async fn do_run_tests(include: Vec<String>, include_coverage: bool, watch: b
207206 let program_state = program_state. clone ( ) ;
208207 let files_changed = changed. is_some ( ) ;
209208 async move {
209+ let doc_modules = doc_modules_result?;
210+
210211 let test_modules = test_modules_result?;
211212
212213 let mut paths_to_watch = paths_to_watch_clone;
@@ -284,9 +285,13 @@ pub async fn do_run_tests(include: Vec<String>, include_coverage: bool, watch: b
284285 for path in changed. iter ( ) . filter_map ( |path| {
285286 deno_core:: resolve_url_or_path ( & path. to_string_lossy ( ) ) . ok ( )
286287 } ) {
287- if modules. contains ( & & path) {
288- modules_to_reload. push ( specifier) ;
289- break ;
288+ if path. path ( ) . ends_with ( ".clar" ) {
289+ modules_to_reload. push ( specifier. clone ( ) ) ;
290+ } else {
291+ if modules. contains ( & & path) {
292+ modules_to_reload. push ( specifier) ;
293+ break ;
294+ }
290295 }
291296 }
292297 }
@@ -295,23 +300,17 @@ pub async fn do_run_tests(include: Vec<String>, include_coverage: bool, watch: b
295300 Ok ( ( paths_to_watch, modules_to_reload) )
296301 }
297302 . map ( move |result| {
298- if files_changed
299- && matches ! ( result, Ok ( ( _, ref modules) ) if modules. is_empty( ) )
300- {
301- ResolutionResult :: Ignore
302- } else {
303- match result {
304- Ok ( ( paths_to_watch, modules_to_reload) ) => {
305- ResolutionResult :: Restart {
306- paths_to_watch,
307- result : Ok ( modules_to_reload) ,
308- }
309- }
310- Err ( e) => ResolutionResult :: Restart {
303+ match result {
304+ Ok ( ( paths_to_watch, modules_to_reload) ) => {
305+ ResolutionResult :: Restart {
311306 paths_to_watch,
312- result : Err ( e ) ,
313- } ,
307+ result : Ok ( modules_to_reload ) ,
308+ }
314309 }
310+ Err ( e) => ResolutionResult :: Restart {
311+ paths_to_watch,
312+ result : Err ( e) ,
313+ } ,
315314 }
316315 } )
317316 } ;
@@ -338,6 +337,8 @@ pub async fn do_run_tests(include: Vec<String>, include_coverage: bool, watch: b
338337 )
339338 . await ?;
340339 } else {
340+ let doc_modules = vec ! [ ] ;
341+
341342 let test_modules = test_runner:: collect_test_module_specifiers (
342343 include. clone ( ) ,
343344 & cwd,
@@ -386,6 +387,14 @@ pub async fn do_run_tests(include: Vec<String>, include_coverage: bool, watch: b
386387 Ok ( true )
387388}
388389
390+ pub fn is_supported_ext ( path : & Path ) -> bool {
391+ if let Some ( ext) = fs_util:: get_extension ( path) {
392+ matches ! ( ext. as_str( ) , "ts" | "js" | "clar" )
393+ } else {
394+ false
395+ }
396+ }
397+
389398#[ allow( clippy:: too_many_arguments) ]
390399pub async fn run_tests (
391400 program_state : Arc < ProgramState > ,
0 commit comments