diff options
author | Yusuke Sakurai <kerokerokerop@gmail.com> | 2020-03-21 22:53:47 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-03-21 09:53:47 -0400 |
commit | 60cee4f045778777a16b6fffd6d5b9a1400d7246 (patch) | |
tree | a477bd147fbd548d478a289af5bd0681b1a34c4e /cli/js/tests/tls_test.ts | |
parent | 0adc86f105204b2475126c36dfc10e678f67df56 (diff) |
avoid using same port number for test (#4147)
Diffstat (limited to 'cli/js/tests/tls_test.ts')
-rw-r--r-- | cli/js/tests/tls_test.ts | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/cli/js/tests/tls_test.ts b/cli/js/tests/tls_test.ts index 20dd62f9b..2e6e5afc9 100644 --- a/cli/js/tests/tls_test.ts +++ b/cli/js/tests/tls_test.ts @@ -2,6 +2,7 @@ import { assert, assertEquals, + randomPort, createResolvable, unitTest } from "./test_util.ts"; @@ -43,7 +44,7 @@ unitTest( let err; const options = { hostname: "localhost", - port: 4500, + port: randomPort(), certFile: "cli/tests/tls/localhost.crt", keyFile: "cli/tests/tls/localhost.key" }; @@ -72,10 +73,11 @@ unitTest( unitTest({ perms: { net: true } }, function listenTLSNoReadPerm(): void { let err; + const port = randomPort(); try { Deno.listenTLS({ hostname: "localhost", - port: 4500, + port, certFile: "cli/tests/tls/localhost.crt", keyFile: "cli/tests/tls/localhost.key" }); @@ -94,7 +96,7 @@ unitTest( let err; const options = { hostname: "localhost", - port: 4500, + port: randomPort(), certFile: "cli/tests/tls/localhost.crt", keyFile: "cli/tests/tls/localhost.key" }; @@ -123,7 +125,7 @@ unitTest( let err; const options = { hostname: "localhost", - port: 4500, + port: randomPort(), certFile: "cli/tests/tls/localhost.crt", keyFile: "cli/tests/tls/localhost.key" }; @@ -151,7 +153,7 @@ unitTest( async function dialAndListenTLS(): Promise<void> { const resolvable = createResolvable(); const hostname = "localhost"; - const port = 4500; + const port = randomPort(); const listener = Deno.listenTLS({ hostname, |