From 37d2773bed56065595dbcc7ab48935db7fe9618a Mon Sep 17 00:00:00 2001 From: Shinya Kanamaru Date: Fri, 15 Dec 2017 21:34:11 +0900 Subject: [PATCH] test: change callback function to arrow function MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit PR-URL: https://github.com/nodejs/node/pull/17699 Reviewed-By: Yosuke Furukawa Reviewed-By: Gireesh Punathil Reviewed-By: Tobias Nießen Reviewed-By: Colin Ihrig Reviewed-By: Jon Moss Reviewed-By: Ruben Bridgewater --- test/parallel/test-http-date-header.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/test/parallel/test-http-date-header.js b/test/parallel/test-http-date-header.js index 386501c9f4703e..b389e33664738c 100644 --- a/test/parallel/test-http-date-header.js +++ b/test/parallel/test-http-date-header.js @@ -26,7 +26,7 @@ const http = require('http'); const testResBody = 'other stuff!\n'; -const server = http.createServer(function(req, res) { +const server = http.createServer((req, res) => { assert.ok(!('date' in req.headers), 'Request headers contained a Date.'); res.writeHead(200, { @@ -37,16 +37,16 @@ const server = http.createServer(function(req, res) { server.listen(0); -server.addListener('listening', function() { +server.addListener('listening', () => { const options = { - port: this.address().port, + port: server.address().port, path: '/', method: 'GET' }; - const req = http.request(options, function(res) { + const req = http.request(options, (res) => { assert.ok('date' in res.headers, 'Response headers didn\'t contain a Date.'); - res.addListener('end', function() { + res.addListener('end', () => { server.close(); process.exit(); });