{"library":"test-listen","type":"library","category":null,"description":"test-listen is a JavaScript utility for generating URLs with ephemeral ports, specifically designed for testing HTTP servers. It accepts an instance of Node.js's native `http.Server` and returns a promise that resolves to a unique URL string, typically in the format `http://localhost:{port}`. This mechanism is crucial for ensuring isolated and repeatable test environments, as each test run can utilize a distinct, automatically assigned port, thereby preventing conflicts and ensuring test integrity. The current stable version is 1.1.0, and the package generally maintains a stable release cadence with updates focused on minor improvements and maintenance. Its primary strength lies in its simplicity and direct integration with standard Node.js HTTP servers, providing an `async`/`await`-ready solution that streamlines the setup for robust server test suites. It differentiates itself by offering a straightforward, minimal API for a very specific and common testing requirement without introducing complex abstractions.","language":"javascript","status":"active","version":"1.1.0","tags":["javascript"],"last_verified":"Wed May 27","install":[{"cmd":"npm install test-listen","imports":["import listen from 'test-listen'","const listen = require('test-listen')"]},{"cmd":"yarn add test-listen","imports":[]},{"cmd":"pnpm add test-listen","imports":[]}],"homepage":null,"github":"https://github.com/zeit/test-listen","docs":null,"changelog":null,"pypi":null,"npm":"https://www.npmjs.com/package/test-listen","openapi_spec":null,"status_page":null,"smithery":null,"compatibility":{"summary":{"python_range":"18–22","success_rate":0,"avg_install_s":null,"avg_import_s":null,"wheel_type":null},"url":"https://checklist.day/v1/registry/test-listen/compatibility"}}