summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGagandeep Singh <codegagan@gmail.com>2018-11-21 00:09:06 +0530
committerGireesh Punathil <gpunathi@in.ibm.com>2018-11-23 12:35:50 +0530
commitfcbff6045e8474c31d6f4ffa23187a0334ec8468 (patch)
tree999beb46e783abd95e19c1005ee9db3ca8ff26a6
parentb303d8bb21a6636555df9c5d41824071fd6c109b (diff)
downloadnode-new-fcbff6045e8474c31d6f4ffa23187a0334ec8468.tar.gz
test: replace anonymous function with arrow
PR-URL: https://github.com/nodejs/node/pull/24526 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
-rw-r--r--test/parallel/test-pipe-file-to-http.js16
1 files changed, 8 insertions, 8 deletions
diff --git a/test/parallel/test-pipe-file-to-http.js b/test/parallel/test-pipe-file-to-http.js
index 3d326a77a4..4bc71069da 100644
--- a/test/parallel/test-pipe-file-to-http.js
+++ b/test/parallel/test-pipe-file-to-http.js
@@ -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);
}
@@ -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();
});
@@ -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);
});