Skip to content

Commit

Permalink
test: replace anonymous function with arrow
Browse files Browse the repository at this point in the history
PR-URL: nodejs#24526
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
  • Loading branch information
codegagan authored and refack committed Jan 10, 2019
1 parent 5a6c08a commit 4afc45b
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions test/parallel/test-pipe-file-to-http.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,20 +32,20 @@ tmpdir.refresh();
const filename = path.join(tmpdir.path || '/tmp', 'big');
let count = 0;

const server = http.createServer(function(req, res) {
const server = http.createServer((req, res) => {
let timeoutId;
assert.strictEqual(req.method, 'POST');
req.pause();

setTimeout(function() {
setTimeout(() => {
req.resume();
}, 1000);

req.on('data', function(chunk) {
req.on('data', (chunk) => {
count += chunk.length;
});

req.on('end', function() {
req.on('end', () => {
if (timeoutId) {
clearTimeout(timeoutId);
}
Expand All @@ -55,7 +55,7 @@ const server = http.createServer(function(req, res) {
});
server.listen(0);

server.on('listening', function() {
server.on('listening', () => {
common.createZeroFilledFile(filename);
makeRequest();
});
Expand All @@ -73,14 +73,14 @@ function makeRequest() {
assert.ifError(err);
}));

req.on('response', function(res) {
req.on('response', (res) => {
res.resume();
res.on('end', function() {
res.on('end', () => {
server.close();
});
});
}

process.on('exit', function() {
process.on('exit', () => {
assert.strictEqual(count, 1024 * 10240);
});

0 comments on commit 4afc45b

Please sign in to comment.