MCPcopy Create free account
hub / github.com/forwardemail/superagent / getFreePort

Function getFreePort

test/node/network-error.js:7–15  ·  view source on GitHub ↗
(fn)

Source from the content-addressed store, hash-verified

5const express = require('../support/express');
6
7function getFreePort(fn) {
8 const server = net.createServer();
9 server.listen(0, () => {
10 const { port } = server.address();
11 server.close(() => {
12 fn(port);
13 });
14 });
15}
16
17describe('with network error', () => {
18 before(function (done) {

Callers 1

network-error.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected