test: reach res._dump after abort ClientRequest
PR-URL: https://github.com/nodejs/node/pull/24191 Reviewed-By: Ouyang Yadong <oyydoibh@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
This commit is contained in:
parent
0f18a40374
commit
f5b8853d40
22
test/parallel/test-http-client-abort-response-event.js
Normal file
22
test/parallel/test-http-client-abort-response-event.js
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
'use strict';
|
||||||
|
const common = require('../common');
|
||||||
|
const http = require('http');
|
||||||
|
const net = require('net');
|
||||||
|
const server = http.createServer(function(req, res) {
|
||||||
|
res.end();
|
||||||
|
});
|
||||||
|
|
||||||
|
server.listen(0, common.mustCall(function() {
|
||||||
|
const req = http.request({
|
||||||
|
port: this.address().port
|
||||||
|
}, common.mustCall());
|
||||||
|
|
||||||
|
req.on('abort', common.mustCall(function() {
|
||||||
|
server.close();
|
||||||
|
}));
|
||||||
|
|
||||||
|
req.end();
|
||||||
|
req.abort();
|
||||||
|
|
||||||
|
req.emit('response', new http.IncomingMessage(new net.Socket()));
|
||||||
|
}));
|
Loading…
x
Reference in New Issue
Block a user