diff options
author | Yoshiya Hinosawa <stibium121@gmail.com> | 2022-08-21 21:27:14 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-08-21 21:27:14 +0900 |
commit | fb2aeb79a113e576ff2cc4f1bf3fc30741969508 (patch) | |
tree | 7a991db21a1a4e84cc2018bbfbf336e3ec0ef5e8 /cli/tests | |
parent | 906aa78af33c8405a47d5446d2a6fb3348c275bb (diff) |
fix(ext/flash): fix listening port (#15519)
Diffstat (limited to 'cli/tests')
-rw-r--r-- | cli/tests/unit/flash_test.ts | 17 |
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 } }, |