The types are unfortunately awkward for this Node.js class.  When using `listen` with a port number, the address result will be an `AddressInfo` (or null if it has been closed or not yet listening).  It's only a string if it is listening on a pipe or unix domain socket. The code above actually has another issue in that listen is async but the callback is not used to ensure it is actually listening before proceeding with the test.