diff options
author | Bartek IwaĆczuk <biwanczuk@gmail.com> | 2021-12-17 18:43:25 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-12-17 18:43:25 +0100 |
commit | f3cd9a94b5da06282520b2049fb97ef61ec021b2 (patch) | |
tree | 4e3ed06adef017a94e81350dc24a45d531ba355a /cli/tests/integration/inspector_tests.rs | |
parent | ca1fbdd63677b78c1697ce74197c3e3860962a4b (diff) |
fix: inspector prompts (#13123)
This commit fixes prompts printed to the terminal when
running with "--inspect" or "--inspect-brk" flags.
When debugger disconnects error is no longer printed as
users don't care about the reason debugger did disconnect.
A message suggesting to go to "chrome://inspect" is printed
if debugger is active.
Additionally and information that process is waiting for
debugger to connect is printed if running with "--inspect-brk"
flag.
Diffstat (limited to 'cli/tests/integration/inspector_tests.rs')
-rw-r--r-- | cli/tests/integration/inspector_tests.rs | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/cli/tests/integration/inspector_tests.rs b/cli/tests/integration/inspector_tests.rs index e901e2633..f5365ac99 100644 --- a/cli/tests/integration/inspector_tests.rs +++ b/cli/tests/integration/inspector_tests.rs @@ -97,6 +97,8 @@ async fn inspector_break_on_first_line() { use TestStep::*; let test_steps = vec![ + StdErr("Visit chrome://inspect to connect to the debugger."), + StdErr("Deno is waiting for debugger to connect."), WsSend(r#"{"id":1,"method":"Runtime.enable"}"#), WsSend(r#"{"id":2,"method":"Debugger.enable"}"#), WsRecv( @@ -119,10 +121,10 @@ async fn inspector_break_on_first_line() { for step in test_steps { match step { + StdErr(s) => assert_eq!(&stderr_lines.next().unwrap(), s), StdOut(s) => assert_eq!(&stdout_lines.next().unwrap(), s), WsRecv(s) => assert!(socket_rx.next().await.unwrap().starts_with(s)), WsSend(s) => socket_tx.send(s.into()).await.unwrap(), - _ => unreachable!(), } } @@ -276,6 +278,8 @@ async fn inspector_does_not_hang() { use TestStep::*; let test_steps = vec![ + StdErr("Visit chrome://inspect to connect to the debugger."), + StdErr("Deno is waiting for debugger to connect."), WsSend(r#"{"id":1,"method":"Runtime.enable"}"#), WsSend(r#"{"id":2,"method":"Debugger.enable"}"#), WsRecv( @@ -293,6 +297,7 @@ async fn inspector_does_not_hang() { for step in test_steps { match step { + StdErr(s) => assert_eq!(&stderr_lines.next().unwrap(), s), WsRecv(s) => assert!(socket_rx.next().await.unwrap().starts_with(s)), WsSend(s) => socket_tx.send(s.into()).await.unwrap(), _ => unreachable!(), @@ -397,6 +402,7 @@ async fn inspector_runtime_evaluate_does_not_crash() { use TestStep::*; let test_steps = vec![ + StdErr("Visit chrome://inspect to connect to the debugger."), WsSend(r#"{"id":1,"method":"Runtime.enable"}"#), WsSend(r#"{"id":2,"method":"Debugger.enable"}"#), WsRecv( @@ -555,6 +561,8 @@ async fn inspector_break_on_first_line_in_test() { use TestStep::*; let test_steps = vec![ + StdErr("Visit chrome://inspect to connect to the debugger."), + StdErr("Deno is waiting for debugger to connect."), WsSend(r#"{"id":1,"method":"Runtime.enable"}"#), WsSend(r#"{"id":2,"method":"Debugger.enable"}"#), WsRecv( @@ -583,9 +591,9 @@ async fn inspector_break_on_first_line_in_test() { "Doesn't contain {}", s ), + StdErr(s) => assert_eq!(&stderr_lines.next().unwrap(), s), WsRecv(s) => assert!(socket_rx.next().await.unwrap().starts_with(s)), WsSend(s) => socket_tx.send(s.into()).await.unwrap(), - _ => unreachable!(), } } |