@@ -572,16 +572,19 @@ async fn serve_watch_all() {
572
572
let main_file_to_watch = t. path ( ) . join ( "main_file_to_watch.js" ) ;
573
573
main_file_to_watch. write (
574
574
"export default {
575
- fetch(_request: Request ) {
575
+ fetch(_request) {
576
576
return new Response(\" aaaaaaqqq!\" );
577
577
},
578
578
};" ,
579
579
) ;
580
580
581
+ let another_file = t. path ( ) . join ( "another_file.js" ) ;
582
+ another_file. write ( "" ) ;
583
+
581
584
let mut child = util:: deno_cmd ( )
582
585
. current_dir ( t. path ( ) )
583
586
. arg ( "serve" )
584
- . arg ( "--watch=another_file.js" )
587
+ . arg ( format ! ( "--watch={ another_file}" ) )
585
588
. arg ( "-L" )
586
589
. arg ( "debug" )
587
590
. arg ( & main_file_to_watch)
@@ -596,37 +599,40 @@ async fn serve_watch_all() {
596
599
// Change content of the file
597
600
main_file_to_watch. write (
598
601
"export default {
599
- fetch(_request: Request ) {
602
+ fetch(_request) {
600
603
return new Response(\" aaaaaaqqq123!\" );
601
604
},
602
605
};" ,
603
606
) ;
604
607
wait_contains ( "Restarting" , & mut stderr_lines) . await ;
605
608
wait_for_watcher ( "main_file_to_watch.js" , & mut stderr_lines) . await ;
606
609
607
- let another_file = t. path ( ) . join ( "another_file.js" ) ;
608
610
another_file. write ( "export const foo = 0;" ) ;
609
611
// Confirm that the added file is watched as well
610
612
wait_contains ( "Restarting" , & mut stderr_lines) . await ;
613
+ wait_for_watcher ( "main_file_to_watch.js" , & mut stderr_lines) . await ;
611
614
612
615
main_file_to_watch
613
616
. write ( "import { foo } from './another_file.js'; console.log(foo);" ) ;
614
617
wait_contains ( "Restarting" , & mut stderr_lines) . await ;
618
+ wait_for_watcher ( "main_file_to_watch.js" , & mut stderr_lines) . await ;
615
619
wait_contains ( "0" , & mut stdout_lines) . await ;
616
620
617
621
another_file. write ( "export const foo = 42;" ) ;
618
622
wait_contains ( "Restarting" , & mut stderr_lines) . await ;
623
+ wait_for_watcher ( "main_file_to_watch.js" , & mut stderr_lines) . await ;
619
624
wait_contains ( "42" , & mut stdout_lines) . await ;
620
625
621
626
// Confirm that watch continues even with wrong syntax error
622
627
another_file. write ( "syntax error ^^" ) ;
623
628
624
629
wait_contains ( "Restarting" , & mut stderr_lines) . await ;
625
630
wait_contains ( "error:" , & mut stderr_lines) . await ;
631
+ wait_for_watcher ( "main_file_to_watch.js" , & mut stderr_lines) . await ;
626
632
627
633
main_file_to_watch. write (
628
634
"export default {
629
- fetch(_request: Request ) {
635
+ fetch(_request) {
630
636
return new Response(\" aaaaaaqqq!\" );
631
637
},
632
638
};" ,
0 commit comments