šŸš€ Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more →
Socket
Sign inDemoInstall
Socket

test-listen

Package Overview
Dependencies
Maintainers
2
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

test-listen

Produce URLs to test HTTP servers with ephemeral ports

1.1.0
latest
Source
npm
Version published
Weekly downloads
193K
35.28%
Maintainers
2
Weekly downloads
Ā 
Created

What is test-listen?

The 'test-listen' npm package is a utility that helps in testing HTTP servers by providing a way to start a server and get its URL. This is particularly useful for integration tests where you need to make HTTP requests to a server.

What are test-listen's main functionalities?

Start a server and get its URL

This feature allows you to start an HTTP server and get its URL, which can then be used for making HTTP requests in your tests.

const testListen = require('test-listen');
const http = require('http');

const server = http.createServer((req, res) => {
  res.end('Hello World');
});

testListen(server).then(url => {
  console.log(`Server is running at ${url}`);
});

Other packages similar to test-listen

FAQs

Package last updated on 01 Dec 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts