0
0
mirror of https://github.com/nodejs/node.git synced 2024-12-01 16:10:02 +01:00
nodejs/test/parallel/test-http-client-abort-event.js

21 lines
410 B
JavaScript
Raw Normal View History

'use strict';
const common = require('../common');
const http = require('http');
const server = http.createServer(function(req, res) {
res.end();
});
server.listen(0, common.mustCall(function() {
const req = http.request({
port: this.address().port
}, common.mustNotCall());
req.on('abort', common.mustCall(function() {
server.close();
}));
req.end();
req.abort();
req.abort();
}));