MCPcopy Index your code
hub / github.com/idank/explainshell / getFreePort

Function getFreePort

playwright.config.js:8–14  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

6const E2E_DB = path.join(__dirname, 'tests', 'e2e', 'e2e.db');
7
8function getFreePort() {
9 const srv = net.createServer();
10 srv.listen(0);
11 const port = srv.address().port;
12 srv.close();
13 return port;
14}
15
16// Cache the port in an env var so Playwright workers (separate processes that
17// re-evaluate this config) use the same port as the main process.

Callers 1

Calls 1

closeMethod · 0.45

Tested by

no test coverage detected