diff options
author | kou-hin <kou_hin@cyberagent.co.jp> | 2017-11-26 17:07:45 +0900 |
---|---|---|
committer | James M Snell <jasnell@gmail.com> | 2017-11-26 09:04:17 -0800 |
commit | 54ff3b6b052c561e127ae5f5a02f1ad6895b61d7 (patch) | |
tree | 1fa982b21a5f84f475b4064bc882701b42141d9c /test | |
parent | 156a38fef1122cae39f4852b51bcdc8a65b45893 (diff) | |
download | android-node-v8-54ff3b6b052c561e127ae5f5a02f1ad6895b61d7.tar.gz android-node-v8-54ff3b6b052c561e127ae5f5a02f1ad6895b61d7.tar.bz2 android-node-v8-54ff3b6b052c561e127ae5f5a02f1ad6895b61d7.zip |
test: replace function with arrow function
PR-URL: https://github.com/nodejs/node/pull/17305
Reviewed-By: Yosuke Furukawa <yosuke.furukawa@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Daijiro Wachi <daijiro.wachi@gmail.com>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: Jon Moss <me@jonathanmoss.me>
Reviewed-By: James M Snell <jasnell@gmail.com>
Diffstat (limited to 'test')
-rw-r--r-- | test/parallel/test-http.js | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/test/parallel/test-http.js b/test/parallel/test-http.js index d9fa581f3b..52bebc476e 100644 --- a/test/parallel/test-http.js +++ b/test/parallel/test-http.js @@ -72,33 +72,33 @@ server.on('listening', function() { Cookie: [ 'foo=bar', 'bar=baz', 'baz=quux' ] }, agent: agent - }, common.mustCall(function(res) { + }, common.mustCall((res) => { const cookieHeaders = req._header.match(/^Cookie: .+$/img); assert.deepStrictEqual(cookieHeaders, ['Cookie: foo=bar; bar=baz; baz=quux']); assert.strictEqual(res.statusCode, 200); let body = ''; res.setEncoding('utf8'); - res.on('data', function(chunk) { body += chunk; }); - res.on('end', common.mustCall(function() { + res.on('data', (chunk) => { body += chunk; }); + res.on('end', common.mustCall(() => { assert.strictEqual(body, 'The path was /hello'); })); })); - setTimeout(common.mustCall(function() { + setTimeout(common.mustCall(() => { const req = http.request({ port: server.address().port, method: 'PUT', path: '/there', agent: agent - }, common.mustCall(function(res) { + }, common.mustCall((res) => { const cookieHeaders = req._header.match(/^Cookie: .+$/img); assert.deepStrictEqual(cookieHeaders, ['Cookie: node=awesome; ta=da']); assert.strictEqual(res.statusCode, 200); let body = ''; res.setEncoding('utf8'); - res.on('data', function(chunk) { body += chunk; }); - res.on('end', common.mustCall(function() { + res.on('data', (chunk) => { body += chunk; }); + res.on('end', common.mustCall(() => { assert.strictEqual(body, 'The path was /there'); })); })); @@ -106,7 +106,7 @@ server.on('listening', function() { req.end(); }), 1); - setTimeout(common.mustCall(function() { + setTimeout(common.mustCall(() => { const req = http.request({ port: server.address().port, method: 'POST', @@ -115,7 +115,7 @@ server.on('listening', function() { ['Cookie', 'def=456'], ['Cookie', 'ghi=789'] ], agent: agent - }, common.mustCall(function(res) { + }, common.mustCall((res) => { const cookieHeaders = req._header.match(/^Cookie: .+$/img); assert.deepStrictEqual(cookieHeaders, ['Cookie: abc=123', @@ -124,8 +124,8 @@ server.on('listening', function() { assert.strictEqual(res.statusCode, 200); let body = ''; res.setEncoding('utf8'); - res.on('data', function(chunk) { body += chunk; }); - res.on('end', common.mustCall(function() { + res.on('data', (chunk) => { body += chunk; }); + res.on('end', common.mustCall(() => { assert.strictEqual(body, 'The path was /world'); })); })); |