diff options
author | Bartek IwaĆczuk <biwanczuk@gmail.com> | 2021-06-27 02:27:50 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-06-27 02:27:50 +0200 |
commit | 7b9737b9f4c25e1d25bfb352198cf24a50ceb2de (patch) | |
tree | 4f853a8218f5d0607304db33e2b02d87976678a7 /cli/tests/integration_tests.rs | |
parent | 015f252066c21bd6d36e5b4d58a34dd40e4c0db0 (diff) |
feat(inspector): pipe console messages between terminal and inspector (#11134)
This commit adds support for piping console messages to inspector.
This is done by "wrapping" Deno's console implementation with default
console provided by V8 by the means of "Deno.core.callConsole" binding.
Effectively each call to "console.*" methods calls a method on Deno's
console and V8's console.
Diffstat (limited to 'cli/tests/integration_tests.rs')
-rw-r--r-- | cli/tests/integration_tests.rs | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/cli/tests/integration_tests.rs b/cli/tests/integration_tests.rs index 5c4e43d66..d93c9ae1c 100644 --- a/cli/tests/integration_tests.rs +++ b/cli/tests/integration_tests.rs @@ -4556,6 +4556,7 @@ console.log("finish"); child.wait().unwrap(); } + #[derive(Debug)] enum TestStep { StdOut(&'static str), StdErr(&'static str), @@ -4806,6 +4807,9 @@ console.log("finish"); // Expect the number {i} on stdout. let s = i.to_string(); assert_eq!(stdout_lines.next().unwrap(), s); + // Expect console.log + let s = r#"{"method":"Runtime.consoleAPICalled","#; + assert!(socket_rx.next().await.unwrap().starts_with(s)); // Expect hitting the `debugger` statement. let s = r#"{"method":"Debugger.paused","#; assert!(socket_rx.next().await.unwrap().starts_with(s)); @@ -4918,6 +4922,7 @@ console.log("finish"); WsSend( r#"{"id":6,"method":"Runtime.evaluate","params":{"expression":"console.error('done');","objectGroup":"console","includeCommandLineAPI":true,"silent":false,"contextId":1,"returnByValue":true,"generatePreview":true,"userGesture":true,"awaitPromise":false,"replMode":true}}"#, ), + WsRecv(r#"{"method":"Runtime.consoleAPICalled"#), WsRecv(r#"{"id":6,"result":{"result":{"type":"undefined"}}}"#), StdErr("done"), ]; |