From ecfda65effab41b8ca0ab65955d0542304437491 Mon Sep 17 00:00:00 2001 From: Kitson Kelly Date: Wed, 27 Jan 2021 22:25:33 +1100 Subject: [PATCH] fix(cli): correctly determine emit state with redirects (#9287) Fixes #9129 --- cli/module_graph.rs | 2 +- cli/tests/integration_tests.rs | 31 +++++++++++++++++++++++++++++++ 2 files changed, 32 insertions(+), 1 deletion(-) diff --git a/cli/module_graph.rs b/cli/module_graph.rs index d726e21a0c..a1c4086663 100644 --- a/cli/module_graph.rs +++ b/cli/module_graph.rs @@ -1470,7 +1470,7 @@ impl Graph { true } } else { - false + true } }) } diff --git a/cli/tests/integration_tests.rs b/cli/tests/integration_tests.rs index 40a23bcfa1..61893ab21f 100644 --- a/cli/tests/integration_tests.rs +++ b/cli/tests/integration_tests.rs @@ -955,6 +955,37 @@ fn ts_dependency_recompilation() { assert!(stdout_output.is_empty()); } +#[test] +fn ts_no_recheck_on_redirect() { + let deno_dir = util::new_deno_dir(); + let e = util::deno_exe_path(); + + let redirect_ts = util::root_path().join("cli/tests/017_import_redirect.ts"); + assert!(redirect_ts.is_file()); + let mut cmd = Command::new(e.clone()); + cmd.env("DENO_DIR", deno_dir.path()); + let mut initial = cmd + .current_dir(util::root_path()) + .arg("run") + .arg(redirect_ts.clone()) + .spawn() + .expect("failed to span script"); + let status_initial = + initial.wait().expect("failed to wait for child process"); + assert!(status_initial.success()); + + let mut cmd = Command::new(e); + cmd.env("DENO_DIR", deno_dir.path()); + let output = cmd + .current_dir(util::root_path()) + .arg("run") + .arg(redirect_ts) + .output() + .expect("failed to spawn script"); + + assert!(std::str::from_utf8(&output.stderr).unwrap().is_empty()); +} + #[test] fn ts_reload() { let hello_ts = util::root_path().join("cli/tests/002_hello.ts");