summaryrefslogtreecommitdiff
path: root/cli/tests/unit/net_test.ts
diff options
context:
space:
mode:
Diffstat (limited to 'cli/tests/unit/net_test.ts')
-rw-r--r--cli/tests/unit/net_test.ts9
1 files changed, 9 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();
+});