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 <[email protected]>
Reviewed-By: Trivikram Kamat <[email protected]>
Reviewed-By: Ujjwal Sharma <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: James M Snell <[email protected]>
  • Loading branch information
UjjwalUpadhyay123-bit authored and codebytere committed Jan 29, 2019
1 parent 8f7326c commit 2ffbde3
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 2ffbde3

Please sign in to comment.