diff options
Diffstat (limited to 'cli/tests/unit/tls_test.ts')
-rw-r--r-- | cli/tests/unit/tls_test.ts | 16 |
1 files changed, 5 insertions, 11 deletions
diff --git a/cli/tests/unit/tls_test.ts b/cli/tests/unit/tls_test.ts index 05eced64e..c9f22b75b 100644 --- a/cli/tests/unit/tls_test.ts +++ b/cli/tests/unit/tls_test.ts @@ -1019,20 +1019,14 @@ function createHttpsListener(port: number): Deno.Listener { } async function curl(url: string): Promise<string> { - const curl = Deno.run({ - cmd: ["curl", "--insecure", url], - stdout: "piped", + const { status, stdout } = await Deno.spawn("curl", { + args: ["--insecure", url], }); - try { - const [status, output] = await Promise.all([curl.status(), curl.output()]); - if (!status.success) { - throw new Error(`curl ${url} failed: ${status.code}`); - } - return new TextDecoder().decode(output); - } finally { - curl.close(); + if (!status.success) { + throw new Error(`curl ${url} failed: ${status.code}`); } + return new TextDecoder().decode(stdout); } Deno.test( |