Skip to content

Commit 44eca05

Browse files
authored
chore: fix serve_watch_all test (#26725)
It's been failing a ton lately, it looks like the test is just incorrectly using TS syntax in a JS file https://github.com/denoland/deno/actions/runs/11672972415/job/32502710624?pr=26724#step:43:2791 I'm not really sure how this ever passes
1 parent 25ed90b commit 44eca05

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

tests/integration/watcher_tests.rs

+11-5
Original file line numberDiff line numberDiff line change
@@ -572,16 +572,19 @@ async fn serve_watch_all() {
572572
let main_file_to_watch = t.path().join("main_file_to_watch.js");
573573
main_file_to_watch.write(
574574
"export default {
575-
fetch(_request: Request) {
575+
fetch(_request) {
576576
return new Response(\"aaaaaaqqq!\");
577577
},
578578
};",
579579
);
580580

581+
let another_file = t.path().join("another_file.js");
582+
another_file.write("");
583+
581584
let mut child = util::deno_cmd()
582585
.current_dir(t.path())
583586
.arg("serve")
584-
.arg("--watch=another_file.js")
587+
.arg(format!("--watch={another_file}"))
585588
.arg("-L")
586589
.arg("debug")
587590
.arg(&main_file_to_watch)
@@ -596,37 +599,40 @@ async fn serve_watch_all() {
596599
// Change content of the file
597600
main_file_to_watch.write(
598601
"export default {
599-
fetch(_request: Request) {
602+
fetch(_request) {
600603
return new Response(\"aaaaaaqqq123!\");
601604
},
602605
};",
603606
);
604607
wait_contains("Restarting", &mut stderr_lines).await;
605608
wait_for_watcher("main_file_to_watch.js", &mut stderr_lines).await;
606609

607-
let another_file = t.path().join("another_file.js");
608610
another_file.write("export const foo = 0;");
609611
// Confirm that the added file is watched as well
610612
wait_contains("Restarting", &mut stderr_lines).await;
613+
wait_for_watcher("main_file_to_watch.js", &mut stderr_lines).await;
611614

612615
main_file_to_watch
613616
.write("import { foo } from './another_file.js'; console.log(foo);");
614617
wait_contains("Restarting", &mut stderr_lines).await;
618+
wait_for_watcher("main_file_to_watch.js", &mut stderr_lines).await;
615619
wait_contains("0", &mut stdout_lines).await;
616620

617621
another_file.write("export const foo = 42;");
618622
wait_contains("Restarting", &mut stderr_lines).await;
623+
wait_for_watcher("main_file_to_watch.js", &mut stderr_lines).await;
619624
wait_contains("42", &mut stdout_lines).await;
620625

621626
// Confirm that watch continues even with wrong syntax error
622627
another_file.write("syntax error ^^");
623628

624629
wait_contains("Restarting", &mut stderr_lines).await;
625630
wait_contains("error:", &mut stderr_lines).await;
631+
wait_for_watcher("main_file_to_watch.js", &mut stderr_lines).await;
626632

627633
main_file_to_watch.write(
628634
"export default {
629-
fetch(_request: Request) {
635+
fetch(_request) {
630636
return new Response(\"aaaaaaqqq!\");
631637
},
632638
};",

0 commit comments

Comments
 (0)