From ecfda65effab41b8ca0ab65955d0542304437491 Mon Sep 17 00:00:00 2001 From: Kitson Kelly Date: Wed, 27 Jan 2021 22:25:33 +1100 Subject: fix(cli): correctly determine emit state with redirects (#9287) Fixes #9129 --- cli/tests/integration_tests.rs | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) (limited to 'cli/tests') 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 @@ -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"); -- cgit v1.2.3