Skip to content

Commit 3f4d0fc

Browse files
kou-hinMylesBorins
kou-hin
authored andcommitted
test: replace function with arrow function
PR-URL: #17305 Reviewed-By: Yosuke Furukawa <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Daijiro Wachi <[email protected]> Reviewed-By: Gireesh Punathil <[email protected]> Reviewed-By: Jon Moss <[email protected]> Reviewed-By: James M Snell <[email protected]>
1 parent d8e4d95 commit 3f4d0fc

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

test/parallel/test-http.js

+11-11
Original file line numberDiff line numberDiff line change
@@ -72,41 +72,41 @@ server.on('listening', function() {
7272
Cookie: [ 'foo=bar', 'bar=baz', 'baz=quux' ]
7373
},
7474
agent: agent
75-
}, common.mustCall(function(res) {
75+
}, common.mustCall((res) => {
7676
const cookieHeaders = req._header.match(/^Cookie: .+$/img);
7777
assert.deepStrictEqual(cookieHeaders,
7878
['Cookie: foo=bar; bar=baz; baz=quux']);
7979
assert.strictEqual(res.statusCode, 200);
8080
let body = '';
8181
res.setEncoding('utf8');
82-
res.on('data', function(chunk) { body += chunk; });
83-
res.on('end', common.mustCall(function() {
82+
res.on('data', (chunk) => { body += chunk; });
83+
res.on('end', common.mustCall(() => {
8484
assert.strictEqual(body, 'The path was /hello');
8585
}));
8686
}));
8787

88-
setTimeout(common.mustCall(function() {
88+
setTimeout(common.mustCall(() => {
8989
const req = http.request({
9090
port: server.address().port,
9191
method: 'PUT',
9292
path: '/there',
9393
agent: agent
94-
}, common.mustCall(function(res) {
94+
}, common.mustCall((res) => {
9595
const cookieHeaders = req._header.match(/^Cookie: .+$/img);
9696
assert.deepStrictEqual(cookieHeaders, ['Cookie: node=awesome; ta=da']);
9797
assert.strictEqual(res.statusCode, 200);
9898
let body = '';
9999
res.setEncoding('utf8');
100-
res.on('data', function(chunk) { body += chunk; });
101-
res.on('end', common.mustCall(function() {
100+
res.on('data', (chunk) => { body += chunk; });
101+
res.on('end', common.mustCall(() => {
102102
assert.strictEqual(body, 'The path was /there');
103103
}));
104104
}));
105105
req.setHeader('Cookie', ['node=awesome', 'ta=da']);
106106
req.end();
107107
}), 1);
108108

109-
setTimeout(common.mustCall(function() {
109+
setTimeout(common.mustCall(() => {
110110
const req = http.request({
111111
port: server.address().port,
112112
method: 'POST',
@@ -115,7 +115,7 @@ server.on('listening', function() {
115115
['Cookie', 'def=456'],
116116
['Cookie', 'ghi=789'] ],
117117
agent: agent
118-
}, common.mustCall(function(res) {
118+
}, common.mustCall((res) => {
119119
const cookieHeaders = req._header.match(/^Cookie: .+$/img);
120120
assert.deepStrictEqual(cookieHeaders,
121121
['Cookie: abc=123',
@@ -124,8 +124,8 @@ server.on('listening', function() {
124124
assert.strictEqual(res.statusCode, 200);
125125
let body = '';
126126
res.setEncoding('utf8');
127-
res.on('data', function(chunk) { body += chunk; });
128-
res.on('end', common.mustCall(function() {
127+
res.on('data', (chunk) => { body += chunk; });
128+
res.on('end', common.mustCall(() => {
129129
assert.strictEqual(body, 'The path was /world');
130130
}));
131131
}));

0 commit comments

Comments
 (0)