Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deno.Listener no exposing port #5477

Closed
aricart opened this issue May 15, 2020 · 1 comment · Fixed by #10012
Closed

Deno.Listener no exposing port #5477

aricart opened this issue May 15, 2020 · 1 comment · Fixed by #10012
Labels
bug Something isn't working correctly cli related to cli/ dir public API related to "Deno" namespace in JS

Comments

@aricart
Copy link
Contributor

aricart commented May 15, 2020

To extract the port from a random port in a Deno.listen is somewhat painful:

    const listener = Deno.listen({ port: 0, transport: "tcp" });
    //@ts-ignore
    const {port} = listener.addr
    this.port = port

While the random port doesn't seem that useful, it is extremely. For unit tests, launching a listener or process at a random port means that unit tests can really be independent, and not hardcoded.

@SyrupThinker
Copy link
Contributor

Your error is basically a duplicate of #5102, check this comment.

@bartlomieju bartlomieju added bug Something isn't working correctly cli related to cli/ dir public API related to "Deno" namespace in JS labels May 21, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working correctly cli related to cli/ dir public API related to "Deno" namespace in JS
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants