diff --git a/test/parallel/test-http-client-aborted-event.js b/test/parallel/test-http-client-aborted-event.js new file mode 100644 index 0000000000..951a128f51 --- /dev/null +++ b/test/parallel/test-http-client-aborted-event.js @@ -0,0 +1,18 @@ +'use strict'; +const common = require('../common'); +const http = require('http'); + +const server = http.Server(function(req, res) { + res.write('Part of my res.'); + res.destroy(); +}); + +server.listen(0, common.mustCall(function() { + http.get({ + port: this.address().port, + headers: { connection: 'keep-alive' } + }, common.mustCall(function(res) { + server.close(); + res.on('aborted', common.mustCall(function() {})); + })); +}));