Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 3f4d0fc

Browse filesBrowse files
kou-hinMylesBorins
authored andcommitted
test: replace function with arrow function
PR-URL: #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>
1 parent d8e4d95 commit 3f4d0fc
Copy full SHA for 3f4d0fc

File tree

Expand file treeCollapse file tree

1 file changed

+11
-11
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+11
-11
lines changed
Open diff view settings
Collapse file

‎test/parallel/test-http.js‎

Copy file name to clipboardExpand all lines: test/parallel/test-http.js
+11-11Lines changed: 11 additions & 11 deletions
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 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.