Noticed in Koa's test suite that we return the wrong port when calling Server.address(). Instead of the actual port we simply return the user supplied value. In case of 0 where the OS will pick the final port this value will be wrong and leads to test failures in Koa's suite. Running the snippet here in Node gives the actual port.
Steps to reproduce
Run this:
import http from "node:http";
const server = http
.createServer((req, res) => res.end("hello"))
.listen(0);
const addr = server.address();
if (addr.port === 0) {
throw new Error("Didn't return actual port");
}
server.close();
Noticed in Koa's test suite that we return the wrong port when calling
Server.address()
. Instead of the actual port we simply return the user supplied value. In case of0
where the OS will pick the final port this value will be wrong and leads to test failures in Koa's suite. Running the snippet here in Node gives the actual port.Steps to reproduce
Run this:
Version: Deno 1.44.4 (git 147411e64 )