diff options
author | tokiedokie <thetokiedokie@gmail.com> | 2020-09-04 05:16:49 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-09-03 16:16:49 -0400 |
commit | fcee4265c605c09062d7cb2984c2776e8b8f0247 (patch) | |
tree | 4a6b909e035a7f8678f22122fc4b530d6c6caeb6 /cli/tests/integration_tests.rs | |
parent | dbd941148c472171eacec364c689a2a50fa0653d (diff) |
support env_logger / RUST_LOG (#7142)
Diffstat (limited to 'cli/tests/integration_tests.rs')
-rw-r--r-- | cli/tests/integration_tests.rs | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/cli/tests/integration_tests.rs b/cli/tests/integration_tests.rs index b8be7262d..08c68a9ae 100644 --- a/cli/tests/integration_tests.rs +++ b/cli/tests/integration_tests.rs @@ -3349,3 +3349,33 @@ fn should_not_panic_on_undefined_deno_dir_and_home_environment_variables() { .unwrap(); assert!(output.status.success()); } + +#[test] +fn rust_log() { + // Without RUST_LOG the stderr is empty. + let output = util::deno_cmd() + .current_dir(util::root_path()) + .arg("run") + .arg("cli/tests/001_hello.js") + .stderr(std::process::Stdio::piped()) + .spawn() + .unwrap() + .wait_with_output() + .unwrap(); + assert!(output.status.success()); + assert!(output.stderr.is_empty()); + + // With RUST_LOG the stderr is not empty. + let output = util::deno_cmd() + .current_dir(util::root_path()) + .arg("run") + .arg("cli/tests/001_hello.js") + .env("RUST_LOG", "debug") + .stderr(std::process::Stdio::piped()) + .spawn() + .unwrap() + .wait_with_output() + .unwrap(); + assert!(output.status.success()); + assert!(!output.stderr.is_empty()); +} |