Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit d9955fb

Browse filesBrowse files
kemitchellMyles Borins
authored andcommitted
test: add test for HTTP client "aborted" event
PR-URL: #7376 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Fedor Indutny <fedor@indutny.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
1 parent e08173a commit d9955fb
Copy full SHA for d9955fb

File tree

Expand file treeCollapse file tree

1 file changed

+18
-0
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+18
-0
lines changed
Open diff view settings
Collapse file
+18Lines changed: 18 additions & 0 deletions
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 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.