diff options
Diffstat (limited to 'tests/integration/watcher_tests.rs')
-rw-r--r-- | tests/integration/watcher_tests.rs | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/tests/integration/watcher_tests.rs b/tests/integration/watcher_tests.rs index 6a2cab08a..6d18ad2f4 100644 --- a/tests/integration/watcher_tests.rs +++ b/tests/integration/watcher_tests.rs @@ -1614,6 +1614,45 @@ async fn run_watch_inspect() { } #[tokio::test] +async fn run_watch_with_excluded_paths() { + let t = TempDir::new(); + + let file_to_exclude = t.path().join("file_to_exclude.js"); + file_to_exclude.write("export const foo = 0;"); + + let file_to_watch = t.path().join("file_to_watch.js"); + file_to_watch + .write("import { foo } from './file_to_exclude.js'; console.log(foo);"); + + let mjs_file_to_exclude = t.path().join("file_to_exclude.mjs"); + mjs_file_to_exclude.write("export const foo = 0;"); + + let mut child = util::deno_cmd() + .current_dir(util::testdata_path()) + .arg("run") + .arg("--watch") + .arg("--watch-exclude=file_to_exclude.js,*.mjs") + .arg("-L") + .arg("debug") + .arg(&file_to_watch) + .env("NO_COLOR", "1") + .piped_output() + .spawn() + .unwrap(); + let (mut stdout_lines, mut stderr_lines) = child_lines(&mut child); + + wait_contains("0", &mut stdout_lines).await; + wait_for_watcher("file_to_watch.js", &mut stderr_lines).await; + + // Confirm that restarting doesn't occurs when a excluded file is updated + file_to_exclude.write("export const foo = 42;"); + mjs_file_to_exclude.write("export const foo = 42;"); + + wait_contains("finished", &mut stderr_lines).await; + check_alive_then_kill(child); +} + +#[tokio::test] async fn run_hmr_server() { let t = TempDir::new(); let file_to_watch = t.path().join("file_to_watch.js"); |