Skip to content

Commit 2ffbde3

Browse files
UjjwalUpadhyay123-bitcodebytere
authored andcommitted
test: favor arrow functions in callbacks
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]>
1 parent 8f7326c commit 2ffbde3

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

test/parallel/test-https-agent-servername.js

+5-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
'use strict';
22
const common = require('../common');
3+
const assert = require('assert');
34

45
if (!common.hasCrypto)
56
common.skip('missing crypto');
@@ -14,7 +15,7 @@ const options = {
1415
};
1516

1617

17-
const server = https.Server(options, function(req, res) {
18+
const server = https.Server(options, (req, res) => {
1819
res.writeHead(200);
1920
res.end('hello world\n');
2021
});
@@ -27,11 +28,11 @@ server.listen(0, function() {
2728
rejectUnauthorized: true,
2829
servername: 'agent1',
2930
ca: options.ca
30-
}, function(res) {
31+
}, (res) => {
3132
res.resume();
32-
console.log(res.statusCode);
33+
assert.strictEqual(res.statusCode, 200);
3334
server.close();
34-
}).on('error', function(e) {
35+
}).on('error', (e) => {
3536
console.log(e.message);
3637
process.exit(1);
3738
});

0 commit comments

Comments
 (0)