From 491feb859f30f56bc25d6afc730a1c709a0bb807 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bartek=20Iwa=C5=84czuk?= Date: Thu, 21 May 2020 20:34:25 +0200 Subject: fix: --inspect flag working like --inspect-brk (#5697) --- cli/tests/integration_tests.rs | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'cli/tests/integration_tests.rs') diff --git a/cli/tests/integration_tests.rs b/cli/tests/integration_tests.rs index cec081ea6..5419d3270 100644 --- a/cli/tests/integration_tests.rs +++ b/cli/tests/integration_tests.rs @@ -2465,6 +2465,31 @@ async fn inspector_does_not_hang() { assert!(child.wait().unwrap().success()); } +#[tokio::test] +async fn inspector_without_brk_runs_code() { + let script = util::tests_path().join("inspector4.js"); + let mut child = util::deno_cmd() + .arg("run") + // Warning: each inspector test should be on its own port to avoid + // conflicting with another inspector test. + .arg("--inspect=127.0.0.1:9233") + .arg(script) + .stdout(std::process::Stdio::piped()) + .stderr(std::process::Stdio::piped()) + .spawn() + .unwrap(); + extract_ws_url_from_stderr(child.stderr.as_mut().unwrap()); + + // Check that inspector actually runs code without waiting for inspector + // connection + let mut stdout = std::io::BufReader::new(child.stdout.as_mut().unwrap()); + let mut stdout_first_line = String::from(""); + let _ = stdout.read_line(&mut stdout_first_line).unwrap(); + assert_eq!(stdout_first_line, "hello\n"); + + child.kill().unwrap(); +} + #[test] fn exec_path() { let output = util::deno_cmd() -- cgit v1.2.3