summaryrefslogtreecommitdiff
path: root/cli/tests
diff options
context:
space:
mode:
Diffstat (limited to 'cli/tests')
-rw-r--r--cli/tests/unit/flash_test.ts17
1 files changed, 17 insertions, 0 deletions
diff --git a/cli/tests/unit/flash_test.ts b/cli/tests/unit/flash_test.ts
index 1b979812f..4df225cbd 100644
--- a/cli/tests/unit/flash_test.ts
+++ b/cli/tests/unit/flash_test.ts
@@ -72,6 +72,23 @@ Deno.test({ permissions: { net: true } }, async function httpServerBasic() {
await server;
});
+Deno.test({ permissions: { net: true } }, async function httpServerPort0() {
+ const ac = new AbortController();
+
+ const server = Deno.serve({
+ fetch() {
+ return new Response("Hello World");
+ },
+ port: 0,
+ signal: ac.signal,
+ onListen({ port }) {
+ assert(port > 0 && port < 65536);
+ ac.abort();
+ },
+ });
+ await server;
+});
+
// https://github.com/denoland/deno/issues/15107
Deno.test(
{ permissions: { net: true } },