diff options
author | David Sherret <dsherret@users.noreply.github.com> | 2023-11-14 11:58:06 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-11-14 16:58:06 +0000 |
commit | d342c0df71bd3da75330af3dbf2949e8dab36c2b (patch) | |
tree | ca3c9eaffe53b51b8865037ab8bd7d0b53b94e92 /cli/tests/integration/run_tests.rs | |
parent | eab755501394ef3cce120955223de5c6447bd87d (diff) |
chore: switch compile tests over to the TestBuilder (#21180)
Diffstat (limited to 'cli/tests/integration/run_tests.rs')
-rw-r--r-- | cli/tests/integration/run_tests.rs | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/cli/tests/integration/run_tests.rs b/cli/tests/integration/run_tests.rs index 153b35dc5..c24464eba 100644 --- a/cli/tests/integration/run_tests.rs +++ b/cli/tests/integration/run_tests.rs @@ -4481,15 +4481,18 @@ itest!(permission_args_quiet { // Regression test for https://github.com/denoland/deno/issues/16772 #[test] fn file_fetcher_preserves_permissions() { - let _guard = util::http_server(); - util::with_pty(&["repl", "--quiet"], |mut console| { - console.write_line( + let context = TestContext::with_http_server(); + context + .new_command() + .args("repl --quiet") + .with_pty(|mut console| { + console.write_line( "const a = await import('http://localhost:4545/run/019_media_types.ts');", ); - console.expect("Allow?"); - console.write_line_raw("y"); - console.expect_all(&["success", "true"]); - }); + console.expect("Allow?"); + console.write_line_raw("y"); + console.expect_all(&["success", "true"]); + }); } #[test] @@ -4524,11 +4527,10 @@ fn stdio_streams_are_locked_in_permission_prompt() { #[test] fn permission_prompt_strips_ansi_codes_and_control_chars() { - let _guard = util::http_server(); util::with_pty(&["repl"], |mut console| { console.write_line( - r#"Deno.permissions.request({ name: "env", variable: "\rDo you like ice cream? y/n" });"# - ); + r#"Deno.permissions.request({ name: "env", variable: "\rDo you like ice cream? y/n" });"# + ); // will be uppercase on windows let env_name = if cfg!(windows) { "DO YOU LIKE ICE CREAM? Y/N" |