From e610685c9d69f3fc80905b0292c9b0a63d2ac059 Mon Sep 17 00:00:00 2001 From: sagirk Date: Mon, 19 Nov 2018 15:39:20 +0530 Subject: [PATCH] test: refactor test-http-write-empty-string to use arrow functions In `test/parallel/test-http-write-empty-string.js`, callbacks use anonymous closure functions. Replace them with arrow functions. PR-URL: https://github.com/nodejs/node/pull/24483 Reviewed-By: Gireesh Punathil Reviewed-By: Ruben Bridgewater --- test/parallel/test-http-write-empty-string.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/test/parallel/test-http-write-empty-string.js b/test/parallel/test-http-write-empty-string.js index d4ab070667ef6d..88eff08f766699 100644 --- a/test/parallel/test-http-write-empty-string.js +++ b/test/parallel/test-http-write-empty-string.js @@ -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'); })); }));