summaryrefslogtreecommitdiff
path: root/cli/tests/integration_tests.rs
diff options
context:
space:
mode:
authorRyan Dahl <ry@tinyclouds.org>2020-05-09 12:43:24 -0400
committerGitHub <noreply@github.com>2020-05-09 12:43:24 -0400
commiteb505f8afcd56f4d4a372cdfbb66906d8a5107c7 (patch)
tree718699a111998ffc4190db318c3038e34771fd86 /cli/tests/integration_tests.rs
parentd5dd5ae87d7598643a46f27fa4a11b2a85d42be8 (diff)
Add support for X-Deno-Warning header (#5161)
Diffstat (limited to 'cli/tests/integration_tests.rs')
-rw-r--r--cli/tests/integration_tests.rs22
1 files changed, 22 insertions, 0 deletions
diff --git a/cli/tests/integration_tests.rs b/cli/tests/integration_tests.rs
index 7ad7781de..4897422b9 100644
--- a/cli/tests/integration_tests.rs
+++ b/cli/tests/integration_tests.rs
@@ -13,6 +13,28 @@ use std::process::Command;
use tempfile::TempDir;
#[test]
+fn x_deno_warning() {
+ let g = util::http_server();
+ let output = util::deno_cmd()
+ .current_dir(util::root_path())
+ .arg("run")
+ .arg("--reload")
+ .arg("http://127.0.0.1:4545/cli/tests/x_deno_warning.js")
+ .stdout(std::process::Stdio::piped())
+ .stderr(std::process::Stdio::piped())
+ .spawn()
+ .unwrap()
+ .wait_with_output()
+ .unwrap();
+ assert!(output.status.success());
+ let stdout_str = std::str::from_utf8(&output.stdout).unwrap().trim();
+ let stderr_str = std::str::from_utf8(&output.stderr).unwrap().trim();
+ assert_eq!("testing x-deno-warning header", stdout_str);
+ assert!(deno::colors::strip_ansi_codes(stderr_str).contains("Warning foobar"));
+ drop(g);
+}
+
+#[test]
fn no_color() {
let output = util::deno_cmd()
.current_dir(util::root_path())