summaryrefslogtreecommitdiff
path: root/cli/tests/unit/http_test.ts
diff options
context:
space:
mode:
Diffstat (limited to 'cli/tests/unit/http_test.ts')
-rw-r--r--cli/tests/unit/http_test.ts16
1 files changed, 3 insertions, 13 deletions
diff --git a/cli/tests/unit/http_test.ts b/cli/tests/unit/http_test.ts
index 4fef626d6..10414cab3 100644
--- a/cli/tests/unit/http_test.ts
+++ b/cli/tests/unit/http_test.ts
@@ -198,14 +198,12 @@ Deno.test(
await respondWith(new Response(stream.readable));
})();
- const client = Deno.createHttpClient({});
- const resp = await fetch(`http://127.0.0.1:${listenPort}/`, { client });
+ const resp = await fetch(`http://127.0.0.1:${listenPort}/`);
const respBody = await resp.text();
assertEquals("hello world", respBody);
await promise;
httpConn!.close();
listener.close();
- client.close();
},
);
@@ -237,17 +235,14 @@ Deno.test(
listener.close();
})();
- const client = Deno.createHttpClient({});
const resp = await fetch(`http://127.0.0.1:${listenPort}/`, {
body: stream.readable,
method: "POST",
headers: { "connection": "close" },
- client,
});
await resp.arrayBuffer();
await promise;
- client.close();
},
);
@@ -354,13 +349,13 @@ Deno.test(
const caCert = Deno.readTextFileSync("cli/tests/testdata/tls/RootCA.pem");
const client = Deno.createHttpClient({ caCerts: [caCert] });
const resp = await fetch(`https://${hostname}:${port}/`, {
- client,
headers: { "connection": "close" },
+ client,
});
+ client.close();
const respBody = await resp.text();
assertEquals("Hello World", respBody);
await promise;
- client.close();
},
);
@@ -380,11 +375,9 @@ Deno.test(
await respondWith(new Response("response"));
})();
- const client = Deno.createHttpClient({});
const resp = await fetch(`http://127.0.0.1:${listenPort}/`, {
method: "POST",
body: "request",
- client,
});
const respBody = await resp.text();
assertEquals("response", respBody);
@@ -392,7 +385,6 @@ Deno.test(
httpConn!.close();
listener.close();
- client.close();
},
);
@@ -435,11 +427,9 @@ Deno.test(
listener.close();
})();
- const client = Deno.createHttpClient({});
const resp = await fetch(`http://127.0.0.1:${listenPort}/`);
await resp.body!.cancel();
await promise;
- client.close();
},
);