Skip to content

Commit

Permalink
test: favor arrow functions in callbacks
Browse files Browse the repository at this point in the history
PR-URL: #24425
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: Ujjwal Sharma <usharma1998@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
  • Loading branch information
UjjwalUpadhyay123-bit authored and rvagg committed Nov 28, 2018
1 parent ef63bb2 commit 2f0a5b6
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions test/parallel/test-https-agent-servername.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
'use strict';
const common = require('../common');
const assert = require('assert');

if (!common.hasCrypto)
common.skip('missing crypto');
Expand All @@ -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');
});
Expand All @@ -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);
});
Expand Down

0 comments on commit 2f0a5b6

Please sign in to comment.