Skip to content

Commit d9955fb

Browse files
kemitchellMyles Borins
authored andcommitted
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 e08173a commit d9955fb

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
'use strict';
2+
constcommon=require('../common');
3+
consthttp=require('http');
4+
5+
constserver=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)