Skip to content

Commit e63ad6b

Browse files
routermanMylesBorins
authored andcommitted
test: change callback function to arrow function
PR-URL: #17697 Reviewed-By: Yosuke Furukawa <[email protected]> Reviewed-By: Gireesh Punathil <[email protected]> Reviewed-By: Tobias Nießen <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Jon Moss <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]>
1 parent 73d3f8c commit e63ad6b

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

test/parallel/test-http-default-encoding.js

+6-6
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,11 @@ const http = require('http');
2727
const expected = 'This is a unicode text: سلام';
2828
let result = '';
2929

30-
const server = http.Server(function(req, res) {
30+
const server = http.Server((req, res) => {
3131
req.setEncoding('utf8');
32-
req.on('data', function(chunk) {
32+
req.on('data', (chunk) => {
3333
result += chunk;
34-
}).on('end', function() {
34+
}).on('end', () => {
3535
server.close();
3636
res.writeHead(200);
3737
res.end('hello world\n');
@@ -44,15 +44,15 @@ server.listen(0, function() {
4444
port: this.address().port,
4545
path: '/',
4646
method: 'POST'
47-
}, function(res) {
47+
}, (res) => {
4848
console.log(res.statusCode);
4949
res.resume();
50-
}).on('error', function(e) {
50+
}).on('error', (e) => {
5151
console.log(e.message);
5252
process.exit(1);
5353
}).end(expected);
5454
});
5555

56-
process.on('exit', function() {
56+
process.on('exit', () => {
5757
assert.strictEqual(expected, result);
5858
});

0 commit comments

Comments
 (0)