summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKitson Kelly <me@kitsonkelly.com>2021-01-27 22:25:33 +1100
committerGitHub <noreply@github.com>2021-01-27 22:25:33 +1100
commitecfda65effab41b8ca0ab65955d0542304437491 (patch)
treed5669c2ee704f6b5d878de0993b3c2d743f3ab50
parent5213bed533d061f3f09892b3131b3564cd2bc9cf (diff)
fix(cli): correctly determine emit state with redirects (#9287)
Fixes #9129
-rw-r--r--cli/module_graph.rs2
-rw-r--r--cli/tests/integration_tests.rs31
2 files changed, 32 insertions, 1 deletions
diff --git a/cli/module_graph.rs b/cli/module_graph.rs
index d726e21a0..a1c408666 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 40a23bcfa..61893ab21 100644
--- a/cli/tests/integration_tests.rs
+++ b/cli/tests/integration_tests.rs
@@ -956,6 +956,37 @@ fn ts_dependency_recompilation() {
}
#[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");
assert!(hello_ts.is_file());