diff --git a/test/parallel/test-http-pause.js b/test/parallel/test-http-pause.js index 440cab413c50a5..9b0ee9a2b59988 100644 --- a/test/parallel/test-http-pause.js +++ b/test/parallel/test-http-pause.js @@ -8,17 +8,17 @@ let resultServer = ''; const expectedClient = 'Response Body from Server'; let resultClient = ''; -const server = http.createServer(function(req, res) { +const server = http.createServer((req, res) => { console.error('pause server request'); req.pause(); - setTimeout(function() { + setTimeout(() => { console.error('resume server request'); req.resume(); req.setEncoding('utf8'); - req.on('data', function(chunk) { + req.on('data', (chunk) => { resultServer += chunk; }); - req.on('end', function() { + req.on('end', () => { console.error(resultServer); res.writeHead(200); res.end(expectedClient); @@ -31,16 +31,16 @@ server.listen(0, function() { port: this.address().port, path: '/', method: 'POST' - }, function(res) { + }, (res) => { console.error('pause client response'); res.pause(); - setTimeout(function() { + setTimeout(() => { console.error('resume client response'); res.resume(); - res.on('data', function(chunk) { + res.on('data', (chunk) => { resultClient += chunk; }); - res.on('end', function() { + res.on('end', () => { console.error(resultClient); server.close(); }); @@ -49,7 +49,7 @@ server.listen(0, function() { req.end(expectedServer); }); -process.on('exit', function() { +process.on('exit', () => { assert.strictEqual(expectedServer, resultServer); assert.strictEqual(expectedClient, resultClient); });