diff options
Diffstat (limited to 'cli/tests')
-rw-r--r-- | cli/tests/unit/net_test.ts | 9 | ||||
-rw-r--r-- | cli/tests/unit/tls_test.ts | 14 |
2 files changed, 23 insertions, 0 deletions
diff --git a/cli/tests/unit/net_test.ts b/cli/tests/unit/net_test.ts index 32250bbd0..ca4c5191c 100644 --- a/cli/tests/unit/net_test.ts +++ b/cli/tests/unit/net_test.ts @@ -1237,3 +1237,12 @@ Deno.test({ }, Deno.errors.AddrInUse); listener1.close(); }); + +Deno.test({ + permissions: { net: true }, +}, function netTcpListenDoesNotThrowOnStringPort() { + // @ts-ignore String port is not allowed by typing, but it shouldn't throw + // for backwards compatibility. + const listener = Deno.listen({ hostname: "localhost", port: "0" }); + listener.close(); +}); diff --git a/cli/tests/unit/tls_test.ts b/cli/tests/unit/tls_test.ts index 11691379c..1f0702f62 100644 --- a/cli/tests/unit/tls_test.ts +++ b/cli/tests/unit/tls_test.ts @@ -1477,3 +1477,17 @@ Deno.test({ }, Deno.errors.AddrInUse); listener1.close(); }); + +Deno.test({ + permissions: { net: true }, +}, function listenTlsDoesNotThrowOnStringPort() { + const listener = Deno.listenTls({ + hostname: "localhost", + // @ts-ignore String port is not allowed by typing, but it shouldn't throw + // for backwards compatibility. + port: "0", + cert, + key, + }); + listener.close(); +}); |