summaryrefslogtreecommitdiff
path: root/tests/integration
diff options
context:
space:
mode:
authorNathan Whitaker <17734409+nathanwhit@users.noreply.github.com>2024-11-04 17:09:17 -0800
committerGitHub <noreply@github.com>2024-11-05 01:09:17 +0000
commit44eca0505c35201c6b67ba073834402b7681914f (patch)
tree2845782238aea8cf33d155e72fda7df9a1ffeffe /tests/integration
parent25ed90baaec420e6496593406494d3747d9a6db7 (diff)
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
Diffstat (limited to 'tests/integration')
-rw-r--r--tests/integration/watcher_tests.rs16
1 files changed, 11 insertions, 5 deletions
diff --git a/tests/integration/watcher_tests.rs b/tests/integration/watcher_tests.rs
index d4705b8d5..e8f264632 100644
--- a/tests/integration/watcher_tests.rs
+++ b/tests/integration/watcher_tests.rs
@@ -572,16 +572,19 @@ async fn serve_watch_all() {
let main_file_to_watch = t.path().join("main_file_to_watch.js");
main_file_to_watch.write(
"export default {
- fetch(_request: Request) {
+ fetch(_request) {
return new Response(\"aaaaaaqqq!\");
},
};",
);
+ let another_file = t.path().join("another_file.js");
+ another_file.write("");
+
let mut child = util::deno_cmd()
.current_dir(t.path())
.arg("serve")
- .arg("--watch=another_file.js")
+ .arg(format!("--watch={another_file}"))
.arg("-L")
.arg("debug")
.arg(&main_file_to_watch)
@@ -596,7 +599,7 @@ async fn serve_watch_all() {
// Change content of the file
main_file_to_watch.write(
"export default {
- fetch(_request: Request) {
+ fetch(_request) {
return new Response(\"aaaaaaqqq123!\");
},
};",
@@ -604,18 +607,20 @@ async fn serve_watch_all() {
wait_contains("Restarting", &mut stderr_lines).await;
wait_for_watcher("main_file_to_watch.js", &mut stderr_lines).await;
- let another_file = t.path().join("another_file.js");
another_file.write("export const foo = 0;");
// Confirm that the added file is watched as well
wait_contains("Restarting", &mut stderr_lines).await;
+ wait_for_watcher("main_file_to_watch.js", &mut stderr_lines).await;
main_file_to_watch
.write("import { foo } from './another_file.js'; console.log(foo);");
wait_contains("Restarting", &mut stderr_lines).await;
+ wait_for_watcher("main_file_to_watch.js", &mut stderr_lines).await;
wait_contains("0", &mut stdout_lines).await;
another_file.write("export const foo = 42;");
wait_contains("Restarting", &mut stderr_lines).await;
+ wait_for_watcher("main_file_to_watch.js", &mut stderr_lines).await;
wait_contains("42", &mut stdout_lines).await;
// Confirm that watch continues even with wrong syntax error
@@ -623,10 +628,11 @@ async fn serve_watch_all() {
wait_contains("Restarting", &mut stderr_lines).await;
wait_contains("error:", &mut stderr_lines).await;
+ wait_for_watcher("main_file_to_watch.js", &mut stderr_lines).await;
main_file_to_watch.write(
"export default {
- fetch(_request: Request) {
+ fetch(_request) {
return new Response(\"aaaaaaqqq!\");
},
};",