SuperTest
Super-agent driven library for testing node.js HTTP servers
...Install SuperTest as an npm module and save it to your package.json file as a development dependency. You may pass an http.Server, or a Function to request(), if the server is not already listening for connections then it is bound to an ephemeral port for you so there is no need to keep track of ports. One thing to note, is that superagent now sends any HTTP error (anything other than a 2XX response code) to the callback as the first argument if you do not add a status code expect (i.e. .expect(302)). ...