summaryrefslogtreecommitdiff
path: root/cli/tests
diff options
context:
space:
mode:
Diffstat (limited to 'cli/tests')
-rw-r--r--cli/tests/integration/inspector_tests.rs6
-rw-r--r--cli/tests/integration/watcher_tests.rs7
2 files changed, 7 insertions, 6 deletions
diff --git a/cli/tests/integration/inspector_tests.rs b/cli/tests/integration/inspector_tests.rs
index 17f48ba5c..067963786 100644
--- a/cli/tests/integration/inspector_tests.rs
+++ b/cli/tests/integration/inspector_tests.rs
@@ -11,11 +11,11 @@ use deno_runtime::deno_fetch::reqwest;
use deno_runtime::deno_websocket::tokio_tungstenite;
use deno_runtime::deno_websocket::tokio_tungstenite::tungstenite;
use std::io::BufRead;
-use std::process::Child;
use test_util as util;
use test_util::TempDir;
use tokio::net::TcpStream;
use util::http_server;
+use util::DenoChild;
struct InspectorTester {
socket_tx: SplitSink<
@@ -30,7 +30,7 @@ struct InspectorTester {
>,
>,
notification_filter: Box<dyn FnMut(&str) -> bool + 'static>,
- child: Child,
+ child: DenoChild,
stderr_lines: Box<dyn Iterator<Item = String>>,
stdout_lines: Box<dyn Iterator<Item = String>>,
}
@@ -40,7 +40,7 @@ fn ignore_script_parsed(msg: &str) -> bool {
}
impl InspectorTester {
- async fn create<F>(mut child: Child, notification_filter: F) -> Self
+ async fn create<F>(mut child: DenoChild, notification_filter: F) -> Self
where
F: FnMut(&str) -> bool + 'static,
{
diff --git a/cli/tests/integration/watcher_tests.rs b/cli/tests/integration/watcher_tests.rs
index 44907b912..edc7fc842 100644
--- a/cli/tests/integration/watcher_tests.rs
+++ b/cli/tests/integration/watcher_tests.rs
@@ -6,6 +6,7 @@ use std::io::BufRead;
use test_util as util;
use test_util::assert_contains;
use test_util::TempDir;
+use util::DenoChild;
use util::assert_not_contains;
@@ -80,7 +81,7 @@ fn read_line(s: &str, lines: &mut impl Iterator<Item = String>) -> String {
lines.find(|m| m.contains(s)).unwrap()
}
-fn check_alive_then_kill(mut child: std::process::Child) {
+fn check_alive_then_kill(mut child: DenoChild) {
assert!(child.try_wait().unwrap().is_none());
child.kill().unwrap();
}
@@ -1244,8 +1245,8 @@ fn run_watch_dynamic_imports() {
.spawn()
.unwrap();
let (mut stdout_lines, mut stderr_lines) = child_lines(&mut child);
- assert_contains!(stderr_lines.next().unwrap(), "No package.json file found");
- assert_contains!(stderr_lines.next().unwrap(), "Process started");
+ wait_contains("No package.json file found", &mut stderr_lines);
+ wait_contains("Process started", &mut stderr_lines);
wait_contains(
"Hopefully dynamic import will be watched...",