howardabrams/node-mocks-http — pull request #11 by invernizzie (2014-03-02 01:28:31+00:00)
Title: Add end, send and render events for async testing.

This closes #6. We can write tests for asyncrhonous responses like showcased below.

Code under test:
```javascript
function myHandler(request, response) {
setTimeout(function() {
response.end();
}, 1000);
}
```

```javascript
exports['End is called'] = function (test) {
request = httpMocks.createRequest();
var response = httpMocks.createResponse({
eventEmitter: EventEmitter
});

response.on('end', function () {
test.ok(response._isEndCalled());
test.done();
});

myHandler(request, response);
};
```