visionmedia/expresso — Issue #151: nested assert.response in node 0.6
Author: gaarf
Created: 2011-11-06 03:27:15+00:00
State: open

the following worked fine in 0.4.x, but with node 0.6.0 results in:

```uncaught undefined: Error: connect ECONNREFUSED
at errnoException (net.js:614:11)
at Object.afterConnect [as oncomplete] (net.js:605:18)```

```javascript
var http = require('http'),
server = http.createServer(function (req, res) {
res.writeHead(200, {'Content-Type': 'text/plain'});
res.end('Hello World\n');
}).listen(1337, "127.0.0.1");

console.log('Server running at http://127.0.0.1:1337/');

module.exports = {

'my test': function(beforeExit, assert){
var requestsCompleted = 0;

beforeExit(function() {
assert.equal(2, requestsCompleted, 'Both requests completed');
});

assert.response(server, { url: '/' },
function(res) {
requestsCompleted++;
console.log('first request completed');

assert.response(server, { url: '/' },
function(res) {
requestsCompleted++;
console.log('second request completed');
}
);

}
);

}
};
```