Express.js middleware integration testing

I am writing some middleware for express.js 2.5.8. The intention is to amend the request object with additional attributes based on the session. I have unit tested the middleware function. Now, I would like to perform some lower-level integration testing to confirm that the middleware is being used by the express server.

My typical approach to this would be to spy on the middleware function. However, this is not the most effective way of proving that the middleware is working as intended.

What I would like to do (if possible/feasible) is load the application, inject arbitrary session data (it does not need to be valid), request/visit a test route which sends the result of the middleware. From there, I can make assertions on that result.

I have been using supertest (superagent), zombie, and request for testing, each with varying degrees of success. What I am struggling with currently is the injection of session data into the request, in whichever form it will end up taking.

I would appreciate some guidance. What approaches have people used when testing this type of behavior?

By making the assumption that express middleware handling is not broken: Why don't you try to write an injection middleware that is responsible to inject the desired session data and place the injection middleware before your middleware function you want to test?

With this approach you don't test client code directly but isolate the injection in your injection middleware.