diff options
author | sagirk <sagir.khan@gmail.com> | 2018-11-19 15:39:20 +0530 |
---|---|---|
committer | Rich Trott <rtrott@gmail.com> | 2018-11-21 10:41:54 -0800 |
commit | e610685c9d69f3fc80905b0292c9b0a63d2ac059 (patch) | |
tree | 38a12d31bc3c610b4584eff5d28d12f2b808e84c /test | |
parent | 0c64816c66f20ec78e4f620f98a774e94caea2ab (diff) | |
download | android-node-v8-e610685c9d69f3fc80905b0292c9b0a63d2ac059.tar.gz android-node-v8-e610685c9d69f3fc80905b0292c9b0a63d2ac059.tar.bz2 android-node-v8-e610685c9d69f3fc80905b0292c9b0a63d2ac059.zip |
test: refactor test-http-write-empty-string to use arrow functions
In `test/parallel/test-http-write-empty-string.js`, callbacks use
anonymous closure functions. Replace them with arrow functions.
PR-URL: https://github.com/nodejs/node/pull/24483
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Diffstat (limited to 'test')
-rw-r--r-- | test/parallel/test-http-write-empty-string.js | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/test/parallel/test-http-write-empty-string.js b/test/parallel/test-http-write-empty-string.js index d4ab070667..88eff08f76 100644 --- a/test/parallel/test-http-write-empty-string.js +++ b/test/parallel/test-http-write-empty-string.js @@ -38,16 +38,16 @@ const server = http.createServer(function(request, response) { this.close(); }); -server.listen(0, common.mustCall(function() { - http.get({ port: this.address().port }, common.mustCall(function(res) { +server.listen(0, common.mustCall(() => { + http.get({ port: server.address().port }, common.mustCall((res) => { let response = ''; assert.strictEqual(res.statusCode, 200); res.setEncoding('ascii'); - res.on('data', function(chunk) { + res.on('data', (chunk) => { response += chunk; }); - res.on('end', common.mustCall(function() { + res.on('end', common.mustCall(() => { assert.strictEqual(response, '1\n2\n3\n'); })); })); |