Skip to content

Commit

Permalink
move changes to new test file
Browse files Browse the repository at this point in the history
  • Loading branch information
tadhgcreedon committed Nov 13, 2018
1 parent e3282ba commit c37a91d
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 4 deletions.
5 changes: 1 addition & 4 deletions test/parallel/test-http-client-abort-event.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
'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());
}, common.mustNotCall());

req.on('abort', common.mustCall(function() {
server.close();
Expand All @@ -18,6 +17,4 @@ server.listen(0, common.mustCall(function() {
req.end();
req.abort();
req.abort();

req.emit('response', new http.IncomingMessage(new net.Socket()));
}));
23 changes: 23 additions & 0 deletions test/parallel/test-http-client-abort-response-event.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
'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.abort();

req.emit('response', new http.IncomingMessage(new net.Socket()));
}));

0 comments on commit c37a91d

Please sign in to comment.