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'); })); }));