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.ts14
1 files changed, 7 insertions, 7 deletions
diff --git a/cli/tests/unit/http_test.ts b/cli/tests/unit/http_test.ts
index fc8530142..77af953e9 100644
--- a/cli/tests/unit/http_test.ts
+++ b/cli/tests/unit/http_test.ts
@@ -12,7 +12,7 @@ unitTest({ perms: { net: true } }, async function httpServerBasic() {
const promise = (async () => {
const listener = Deno.listen({ port: 4501 });
for await (const conn of listener) {
- const httpConn = Deno.startHttp(conn);
+ const httpConn = Deno.serveHttp(conn);
for await (const { request, respondWith } of httpConn) {
assertEquals(await request.text(), "");
respondWith(new Response("Hello World"));
@@ -41,7 +41,7 @@ unitTest(
const promise = (async () => {
const listener = Deno.listen({ port: 4501 });
const conn = await listener.accept();
- const httpConn = Deno.startHttp(conn);
+ const httpConn = Deno.serveHttp(conn);
const evt = await httpConn.nextRequest();
assert(evt);
const { request, respondWith } = evt;
@@ -70,7 +70,7 @@ unitTest(
const promise = (async () => {
const listener = Deno.listen({ port: 4501 });
const conn = await listener.accept();
- const httpConn = Deno.startHttp(conn);
+ const httpConn = Deno.serveHttp(conn);
const evt = await httpConn.nextRequest();
assert(evt);
const { request, respondWith } = evt;
@@ -101,7 +101,7 @@ unitTest({ perms: { net: true } }, async function httpServerStreamDuplex() {
const promise = (async () => {
const listener = Deno.listen({ port: 4501 });
const conn = await listener.accept();
- const httpConn = Deno.startHttp(conn);
+ const httpConn = Deno.serveHttp(conn);
const evt = await httpConn.nextRequest();
assert(evt);
const { request, respondWith } = evt;
@@ -136,7 +136,7 @@ unitTest({ perms: { net: true } }, async function httpServerStreamDuplex() {
unitTest({ perms: { net: true } }, async function httpServerClose() {
const listener = Deno.listen({ port: 4501 });
const client = await Deno.connect({ port: 4501 });
- const httpConn = Deno.startHttp(await listener.accept());
+ const httpConn = Deno.serveHttp(await listener.accept());
client.close();
const evt = await httpConn.nextRequest();
assertEquals(evt, null);
@@ -147,7 +147,7 @@ unitTest({ perms: { net: true } }, async function httpServerClose() {
unitTest({ perms: { net: true } }, async function httpServerInvalidMethod() {
const listener = Deno.listen({ port: 4501 });
const client = await Deno.connect({ port: 4501 });
- const httpConn = Deno.startHttp(await listener.accept());
+ const httpConn = Deno.serveHttp(await listener.accept());
await client.write(new Uint8Array([1, 2, 3]));
await assertThrowsAsync(
async () => {
@@ -175,7 +175,7 @@ unitTest(
keyFile: "cli/tests/tls/localhost.key",
});
const conn = await listener.accept();
- const httpConn = Deno.startHttp(conn);
+ const httpConn = Deno.serveHttp(conn);
const evt = await httpConn.nextRequest();
assert(evt);
const { request, respondWith } = evt;