diff options
author | Maayan Hanin <maayan.asa.hanin@gmail.com> | 2020-07-13 19:24:54 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-07-13 18:24:54 +0200 |
commit | d619e3c7ac8618c5cd30fcc314db2ef994c604e4 (patch) | |
tree | dfd1f1dbe33f438b81ad5fb52c55dabd4f76c46d /cli/tests/integration_tests.rs | |
parent | 11560387bb056098c55049db22c63550358c953a (diff) |
fix(cli): don't panic when no "HOME" env var is set (#6728)
Diffstat (limited to 'cli/tests/integration_tests.rs')
-rw-r--r-- | cli/tests/integration_tests.rs | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/cli/tests/integration_tests.rs b/cli/tests/integration_tests.rs index ec871d927..e93edc79f 100644 --- a/cli/tests/integration_tests.rs +++ b/cli/tests/integration_tests.rs @@ -3197,3 +3197,51 @@ fn should_not_panic_on_no_stderr() { ); output.unwrap(); } + +#[cfg(not(windows))] +#[test] +fn should_not_panic_on_undefined_home_environment_variable() { + let output = util::deno_cmd() + .current_dir(util::root_path()) + .arg("run") + .arg("cli/tests/echo.ts") + .env_remove("HOME") + .stdout(std::process::Stdio::piped()) + .spawn() + .unwrap() + .wait_with_output() + .unwrap(); + assert!(output.status.success()); +} + +#[test] +fn should_not_panic_on_undefined_deno_dir_environment_variable() { + let output = util::deno_cmd() + .current_dir(util::root_path()) + .arg("run") + .arg("cli/tests/echo.ts") + .env_remove("DENO_DIR") + .stdout(std::process::Stdio::piped()) + .spawn() + .unwrap() + .wait_with_output() + .unwrap(); + assert!(output.status.success()); +} + +#[cfg(not(windows))] +#[test] +fn should_not_panic_on_undefined_deno_dir_and_home_environment_variables() { + let output = util::deno_cmd() + .current_dir(util::root_path()) + .arg("run") + .arg("cli/tests/echo.ts") + .env_remove("DENO_DIR") + .env_remove("HOME") + .stdout(std::process::Stdio::piped()) + .spawn() + .unwrap() + .wait_with_output() + .unwrap(); + assert!(output.status.success()); +} |