node package manager
Share your code. npm Orgs help your team discover, share, and reuse code. Create a free org »

popsicle-server

Popsicle Server

NPM version NPM Downloads Build status Test coverage

Automatically connect HTTP(s) servers to a randomly available port for each request. Makes testing your Express/Connect/Node servers easy!

Installation

npm install popsicle-server --save

Usage

var request = require('popsicle')
var server = require('popsicle-server')
var express = require('express')
var app = express()
 
request('/users')
  .use(server(app))
  .then(function (res) {
    console.log(res.status) //=> 404 
  })

License

MIT license