summaryrefslogtreecommitdiff
path: root/cli/tests
diff options
context:
space:
mode:
authorGiorgi Rostomashvili <giorgi.rostomashvili@inthepocket.com>2020-09-27 16:44:53 +0200
committerGitHub <noreply@github.com>2020-09-27 10:44:53 -0400
commiteaba9adb03f0427ecf0a7a8b6937a6b82e134266 (patch)
treefab0af73258911c360b2e562cf606c0262d47383 /cli/tests
parentdf02e315075456f8d5f75472abbb1fa81e237827 (diff)
fix: net listen crashes on explicit undefined hostname (#7706)
Diffstat (limited to 'cli/tests')
-rw-r--r--cli/tests/unit/net_test.ts11
1 files changed, 11 insertions, 0 deletions
diff --git a/cli/tests/unit/net_test.ts b/cli/tests/unit/net_test.ts
index 2c6134318..8eaabdbba 100644
--- a/cli/tests/unit/net_test.ts
+++ b/cli/tests/unit/net_test.ts
@@ -533,3 +533,14 @@ unitTest(
await resolvable;
},
);
+
+unitTest(
+ {
+ perms: { net: true },
+ },
+ function netExplicitUndefinedHostname() {
+ const listener = Deno.listen({ hostname: undefined, port: 8080 });
+ assertEquals((listener.addr as Deno.NetAddr).hostname, "0.0.0.0");
+ listener.close();
+ },
+);