diff options
author | David Sherret <dsherret@users.noreply.github.com> | 2023-11-17 10:05:42 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-11-17 10:05:42 -0500 |
commit | 29011d592968d4d645b909ee28d5fffe0473f285 (patch) | |
tree | 6fff9ff335ce75898060d1c658b028d033b1abdc /cli/tests/integration/flags_tests.rs | |
parent | b7d14d9bd56b392d95f31fe90f66a469d3ce4a87 (diff) |
chore: various improvements to tests (#21222)
Diffstat (limited to 'cli/tests/integration/flags_tests.rs')
-rw-r--r-- | cli/tests/integration/flags_tests.rs | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/cli/tests/integration/flags_tests.rs b/cli/tests/integration/flags_tests.rs index 695283aca..89a8978dd 100644 --- a/cli/tests/integration/flags_tests.rs +++ b/cli/tests/integration/flags_tests.rs @@ -1,7 +1,7 @@ // Copyright 2018-2023 the Deno authors. All rights reserved. MIT license. -use std::process::Stdio; use test_util as util; +use util::assert_contains; #[test] fn help_flag() { @@ -20,14 +20,9 @@ fn help_output() { let output = util::deno_cmd() .current_dir(util::testdata_path()) .arg("--help") - .stdout(Stdio::piped()) - .spawn() - .unwrap() - .wait_with_output() - .unwrap(); + .run(); - assert!(output.status.success()); - let stdout = std::str::from_utf8(&output.stdout).unwrap(); + let stdout = output.combined_output(); let subcommand_descriptions = vec![ "Run a JavaScript or TypeScript program", "Run benchmarks", @@ -56,7 +51,7 @@ fn help_output() { ]; for description in subcommand_descriptions { - assert!(stdout.contains(description)); + assert_contains!(stdout, description); } } |