From 2ffbde396373806a9078b1b783cd1f103db9970a Mon Sep 17 00:00:00 2001 From: UjjwalUpadhyay Date: Sat, 17 Nov 2018 17:32:26 +0530 Subject: [PATCH] test: favor arrow functions in callbacks PR-URL: https://github.com/nodejs/node/pull/24425 Reviewed-By: Gireesh Punathil Reviewed-By: Trivikram Kamat Reviewed-By: Ujjwal Sharma Reviewed-By: Colin Ihrig Reviewed-By: James M Snell --- test/parallel/test-https-agent-servername.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/test/parallel/test-https-agent-servername.js b/test/parallel/test-https-agent-servername.js index df14d113994f89..aa3f75894b8e64 100644 --- a/test/parallel/test-https-agent-servername.js +++ b/test/parallel/test-https-agent-servername.js @@ -1,5 +1,6 @@ 'use strict'; const common = require('../common'); +const assert = require('assert'); if (!common.hasCrypto) common.skip('missing crypto'); @@ -14,7 +15,7 @@ const options = { }; -const server = https.Server(options, function(req, res) { +const server = https.Server(options, (req, res) => { res.writeHead(200); res.end('hello world\n'); }); @@ -27,11 +28,11 @@ server.listen(0, function() { rejectUnauthorized: true, servername: 'agent1', ca: options.ca - }, function(res) { + }, (res) => { res.resume(); - console.log(res.statusCode); + assert.strictEqual(res.statusCode, 200); server.close(); - }).on('error', function(e) { + }).on('error', (e) => { console.log(e.message); process.exit(1); });