Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 2ffbde3

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

File tree

Expand file treeCollapse file tree

1 file changed

+5
-4
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+5
-4
lines changed
Open diff view settings
Collapse file

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

Copy file name to clipboardExpand all lines: test/parallel/test-https-agent-servername.js
+5-4Lines changed: 5 additions & 4 deletions
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 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.