title: How to test Connect / Express middleware?
body: <p>Supposed I have a middleware for Connect and / or Express. What's the best way to unit test this middleware?</p>
  
  <p>Of course, I can set up an http server in the unit tests, and load the middleware into this. But supposed that I want to test startup behavior, I need several http servers, which soon gets complicated and unclear (think of using a new port in each single test).</p>
  
  <p>Is there a better way, or is testing it inside a real server the best one can come up with?</p>