From 60cee4f045778777a16b6fffd6d5b9a1400d7246 Mon Sep 17 00:00:00 2001 From: Yusuke Sakurai Date: Sat, 21 Mar 2020 22:53:47 +0900 Subject: avoid using same port number for test (#4147) --- std/http/testdata/simple_https_server.ts | 3 ++- std/http/testdata/simple_server.ts | 5 +++-- 2 files changed, 5 insertions(+), 3 deletions(-) (limited to 'std/http/testdata') diff --git a/std/http/testdata/simple_https_server.ts b/std/http/testdata/simple_https_server.ts index 9330b4172..9e3045609 100644 --- a/std/http/testdata/simple_https_server.ts +++ b/std/http/testdata/simple_https_server.ts @@ -2,9 +2,10 @@ // This is an example of a https server import { serveTLS } from "../server.ts"; +const port = parseInt(Deno.args[0] || "4503"); const tlsOptions = { hostname: "localhost", - port: 4503, + port, certFile: "./http/testdata/tls/localhost.crt", keyFile: "./http/testdata/tls/localhost.key" }; diff --git a/std/http/testdata/simple_server.ts b/std/http/testdata/simple_server.ts index d8ca4cc97..05f169705 100644 --- a/std/http/testdata/simple_server.ts +++ b/std/http/testdata/simple_server.ts @@ -2,8 +2,9 @@ // This is an example of a server that responds with an empty body import { serve } from "../server.ts"; -const addr = "0.0.0.0:4502"; -console.log(`Simple server listening on ${addr}`); +const port = parseInt(Deno.args[0] || "4502"); +const addr: Deno.ListenOptions = { port }; +console.log(`Simple server listening on ${port}`); for await (const req of serve(addr)) { req.respond({}); } -- cgit v1.2.3