Skip to content

Commit

Permalink
test: change callback function to arrow function
Browse files Browse the repository at this point in the history
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 MylesBorins committed Jan 8, 2018
1 parent 1f9f88c commit b37318c
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions test/parallel/test-http-default-encoding.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand All @@ -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 b37318c

Please sign in to comment.