Skip to content

Commit 6b88541

Browse files
codegaganrvagg
authored andcommitted
test: replace anonymous function with arrow
PR-URL: #24526 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
1 parent 765a81e commit 6b88541

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

test/parallel/test-pipe-file-to-http.js

+8-8
Original file line numberDiff line numberDiff line change
@@ -32,20 +32,20 @@ tmpdir.refresh();
3232
const filename = path.join(tmpdir.path || '/tmp', 'big');
3333
let count = 0;
3434

35-
const server = http.createServer(function(req, res) {
35+
const server = http.createServer((req, res) => {
3636
let timeoutId;
3737
assert.strictEqual(req.method, 'POST');
3838
req.pause();
3939

40-
setTimeout(function() {
40+
setTimeout(() => {
4141
req.resume();
4242
}, 1000);
4343

44-
req.on('data', function(chunk) {
44+
req.on('data', (chunk) => {
4545
count += chunk.length;
4646
});
4747

48-
req.on('end', function() {
48+
req.on('end', () => {
4949
if (timeoutId) {
5050
clearTimeout(timeoutId);
5151
}
@@ -55,7 +55,7 @@ const server = http.createServer(function(req, res) {
5555
});
5656
server.listen(0);
5757

58-
server.on('listening', function() {
58+
server.on('listening', () => {
5959
common.createZeroFilledFile(filename);
6060
makeRequest();
6161
});
@@ -73,14 +73,14 @@ function makeRequest() {
7373
assert.ifError(err);
7474
}));
7575

76-
req.on('response', function(res) {
76+
req.on('response', (res) => {
7777
res.resume();
78-
res.on('end', function() {
78+
res.on('end', () => {
7979
server.close();
8080
});
8181
});
8282
}
8383

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

0 commit comments

Comments
 (0)