1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-11-22 15:06:54 -05:00

fix(cli): correctly determine emit state with redirects (#9287)

Fixes #9129
This commit is contained in:
Kitson Kelly 2021-01-27 22:25:33 +11:00 committed by GitHub
parent 5213bed533
commit ecfda65eff
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 32 additions and 1 deletions

View file

@ -1470,7 +1470,7 @@ impl Graph {
true
}
} else {
false
true
}
})
}

View file

@ -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");