Helpers for testing Connect middleware with the Chai assertion library.
$ npm install chai-connect-middleware
Use this plugin as you would all other Chai plugins:
var chai = ;chai;
Once used, the
chai.connect.use helper function will be available to set up
test cases for Connect middleware.
The helper function can be called from a hook to setup the test case. The
helper returns a wrapper on which callbacks are registered to be executed
when the middleware invokes
ends the response. If the middleware
finishes in an unexpected way, the test helper will automatically throw an
The following demonstrates a Mocha test case.
$ npm install $ npm test
Copyright (c) 2013 Jared Hanson <http://jaredhanson.net/>