Skip to content
Prev Previous commit
Next Next commit
fixup: linting
  • Loading branch information
ronag committed Sep 2, 2019
commit 53c04a393cf58100dc1b12b362589b774c28f027
16 changes: 8 additions & 8 deletions test/parallel/test-http-client-finished.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ const { finished } = require('stream');
}

{
// abort before end
// Test abort before end.

const server = http.createServer(function(req, res) {
res.write('test');
Expand All @@ -76,10 +76,10 @@ const { finished } = require('stream');
server.listen(0, common.mustCall(function() {
const req = http.request({
port: this.address().port
}).on('response', common.mustCall(res => {
}).on('response', common.mustCall((res) => {
req.abort();
finished(res, common.mustCall(() => {
finished(res, common.mustCall(() =>{
finished(res, common.mustCall(() => {
server.close();
}));
}));
Expand All @@ -88,7 +88,7 @@ const { finished } = require('stream');
}

{
// destroy before end
// Test destroy before end.

const server = http.createServer(function(req, res) {
res.write('test');
Expand All @@ -97,7 +97,7 @@ const { finished } = require('stream');
server.listen(0, common.mustCall(function() {
http.request({
port: this.address().port
}).on('response', common.mustCall(res => {
}).on('response', common.mustCall((res) => {
// TODO(ronag): Bug? Won't emit 'close' unless read.
res.on('data', () => {});
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@addaleax: Isn't it a bit strange that the 'data' handler is required here in order for the response to end/close? Likewise in a test further down.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ping @addaleax? I think this is out of the scope of this PR. Please just confirm whether this is strange and we can create a new issue for later investigation.

res.destroy();
Expand All @@ -111,7 +111,7 @@ const { finished } = require('stream');
}

{
// finish after end
// Test finish after end.

const server = http.createServer(function(req, res) {
res.end('asd');
Expand All @@ -120,13 +120,13 @@ const { finished } = require('stream');
server.listen(0, common.mustCall(function() {
http.request({
port: this.address().port
}).on('response', common.mustCall(res => {
}).on('response', common.mustCall((res) => {
// TODO(ronag): Bug? Won't emit 'close' unless read.
res.on('data', () => {});
finished(res, common.mustCall(() => {
finished(res, common.mustCall(() => {
server.close();
}))
}));
}));
})).end();
}));
Expand Down