diff options
author | Asher Gomez <ashersaupingomez@gmail.com> | 2024-09-05 08:45:55 +1000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-09-05 08:45:55 +1000 |
commit | 195b17ae1298f80209e3c2c5ef4d133e6975ff58 (patch) | |
tree | f9a059722830aa408ecd8f9f7e63180455eb14aa /tests/unit/http_test.ts | |
parent | c32d692a8f37c50fd700bb320571f76a107a44c2 (diff) |
BREAKING(types): soft-remove `Deno.run()` (#25403)
Towards #22079
Diffstat (limited to 'tests/unit/http_test.ts')
-rw-r--r-- | tests/unit/http_test.ts | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/tests/unit/http_test.ts b/tests/unit/http_test.ts index 6d3543e44..778cc98fd 100644 --- a/tests/unit/http_test.ts +++ b/tests/unit/http_test.ts @@ -2087,7 +2087,6 @@ Deno.test({ async function client() { const url = `http://${hostname}:${port}/`; const cmd = [ - "curl", "-i", "--request", "GET", @@ -2097,16 +2096,17 @@ Deno.test({ "--header", "Accept-Encoding: deflate, gzip", ]; - const proc = Deno.run({ cmd, stdout: "piped", stderr: "null" }); - const status = await proc.status(); - assert(status.success); - const output = decoder.decode(await proc.output()); + const { success, stdout } = await new Deno.Command("curl", { + args: cmd, + stderr: "null", + }).output(); + assert(success); + const output = decoder.decode(stdout); assert(output.includes("vary: Accept-Encoding\r\n")); assert(output.includes("content-encoding: gzip\r\n")); // Ensure the content-length header is updated. assert(!output.includes(`content-length: ${contentLength}\r\n`)); assert(output.includes("content-length: ")); - proc.close(); } await Promise.all([server(), client()]); @@ -2149,7 +2149,6 @@ Deno.test({ async function client() { const url = `http://${hostname}:${port}/`; const cmd = [ - "curl", "-i", "--request", "GET", @@ -2159,13 +2158,15 @@ Deno.test({ "--header", "Accept-Encoding: deflate, gzip", ]; - const proc = Deno.run({ cmd, stdout: "piped", stderr: "null" }); - const status = await proc.status(); - assert(status.success); - const output = decoder.decode(await proc.output()); + const { success, stdout } = await new Deno.Command("curl", { + args: cmd, + stderr: "null", + stdout: "piped", + }).output(); + assert(success); + const output = decoder.decode(stdout); assert(output.includes("vary: Accept-Encoding\r\n")); assert(output.includes("content-encoding: arbitrary\r\n")); - proc.close(); } await Promise.all([server(), client()]); |