Skip to content

Commit ed3f80a

Browse files
kemitchellevanlucas
authored andcommittedNov 3, 2016
test: add test for HTTP client "aborted" event
PR-URL: #7376 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Fedor Indutny <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Colin Ihrig <[email protected]>
1 parent 3af9453 commit ed3f80a

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed
 
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
'use strict';
2+
const common = require('../common');
3+
const http = require('http');
4+
5+
const server = http.Server(function(req, res) {
6+
res.write('Part of my res.');
7+
res.destroy();
8+
});
9+
10+
server.listen(0, common.mustCall(function() {
11+
http.get({
12+
port: this.address().port,
13+
headers: { connection: 'keep-alive' }
14+
}, common.mustCall(function(res) {
15+
server.close();
16+
res.on('aborted', common.mustCall(function() {}));
17+
}));
18+
}));

0 commit comments

Comments
 (0)
Please sign in to comment.