diff options
Diffstat (limited to 'tests/unit/serve_test.ts')
-rw-r--r-- | tests/unit/serve_test.ts | 28 |
1 files changed, 2 insertions, 26 deletions
diff --git a/tests/unit/serve_test.ts b/tests/unit/serve_test.ts index 5d83aa5fc..9b2870ebd 100644 --- a/tests/unit/serve_test.ts +++ b/tests/unit/serve_test.ts @@ -8,6 +8,8 @@ import { assertEquals, assertStringIncludes, assertThrows, + curlRequest, + curlRequestWithStdErr, execCode, fail, tmpUnixSocketPath, @@ -3793,32 +3795,6 @@ Deno.test( }, ); -async function curlRequest(args: string[]) { - const { success, stdout, stderr } = await new Deno.Command("curl", { - args, - stdout: "piped", - stderr: "piped", - }).output(); - assert( - success, - `Failed to cURL ${args}: stdout\n\n${stdout}\n\nstderr:\n\n${stderr}`, - ); - return new TextDecoder().decode(stdout); -} - -async function curlRequestWithStdErr(args: string[]) { - const { success, stdout, stderr } = await new Deno.Command("curl", { - args, - stdout: "piped", - stderr: "piped", - }).output(); - assert( - success, - `Failed to cURL ${args}: stdout\n\n${stdout}\n\nstderr:\n\n${stderr}`, - ); - return [new TextDecoder().decode(stdout), new TextDecoder().decode(stderr)]; -} - Deno.test("Deno.HttpServer is not thenable", async () => { // deno-lint-ignore require-await async function serveTest() { |