Permalink
Browse files

test: change callback function to arrow function

PR-URL: #17697
Reviewed-By: Yosuke Furukawa <yosuke.furukawa@gmail.com>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Jon Moss <me@jonathanmoss.me>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
  • Loading branch information...
routerman authored and BridgeAR committed Dec 15, 2017
1 parent 4fd70ce commit 604578f47ea360980110e2cd7d4a636f9942b1f0
Showing with 6 additions and 6 deletions.
  1. +6 −6 test/parallel/test-http-default-encoding.js
@@ -27,11 +27,11 @@ const http = require('http');
const expected = 'This is a unicode text: سلام';
let result = '';
const server = http.Server(function(req, res) {
const server = http.Server((req, res) => {
req.setEncoding('utf8');
req.on('data', function(chunk) {
req.on('data', (chunk) => {
result += chunk;
}).on('end', function() {
}).on('end', () => {
server.close();
res.writeHead(200);
res.end('hello world\n');
@@ -44,15 +44,15 @@ server.listen(0, function() {
port: this.address().port,
path: '/',
method: 'POST'
}, function(res) {
}, (res) => {
console.log(res.statusCode);
res.resume();
}).on('error', function(e) {
}).on('error', (e) => {
console.log(e.message);
process.exit(1);
}).end(expected);
});
process.on('exit', function() {
process.on('exit', () => {
assert.strictEqual(expected, result);
});

0 comments on commit 604578f

Please sign in to comment.