Skip to content

Commit

Permalink
test: refactor test-http-write-empty-string to use arrow functions
Browse files Browse the repository at this point in the history
In `test/parallel/test-http-write-empty-string.js`, callbacks use
anonymous closure functions. Replace them with arrow functions.

PR-URL: #24483
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
  • Loading branch information
sagirk authored and codebytere committed Jan 29, 2019
1 parent d288a39 commit 351e69d
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions test/parallel/test-http-write-empty-string.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,16 +38,16 @@ const server = http.createServer(function(request, response) {
this.close();
});

server.listen(0, common.mustCall(function() {
http.get({ port: this.address().port }, common.mustCall(function(res) {
server.listen(0, common.mustCall(() => {
http.get({ port: server.address().port }, common.mustCall((res) => {
let response = '';

assert.strictEqual(res.statusCode, 200);
res.setEncoding('ascii');
res.on('data', function(chunk) {
res.on('data', (chunk) => {
response += chunk;
});
res.on('end', common.mustCall(function() {
res.on('end', common.mustCall(() => {
assert.strictEqual(response, '1\n2\n3\n');
}));
}));
Expand Down

0 comments on commit 351e69d

Please sign in to comment.