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 351e69d

Browse filesBrowse files
sagirkcodebytere
authored andcommitted
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: #24483 Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
1 parent d288a39 commit 351e69d
Copy full SHA for 351e69d

File tree

Expand file treeCollapse file tree

1 file changed

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

1 file changed

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

‎test/parallel/test-http-write-empty-string.js‎

Copy file name to clipboardExpand all lines: test/parallel/test-http-write-empty-string.js
+4-4Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,16 +38,16 @@ const server = http.createServer(function(request, response) {
3838
this.close();
3939
});
4040

41-
server.listen(0, common.mustCall(function() {
42-
http.get({ port: this.address().port }, common.mustCall(function(res) {
41+
server.listen(0, common.mustCall(() => {
42+
http.get({ port: server.address().port }, common.mustCall((res) => {
4343
let response = '';
4444

4545
assert.strictEqual(res.statusCode, 200);
4646
res.setEncoding('ascii');
47-
res.on('data', function(chunk) {
47+
res.on('data', (chunk) => {
4848
response += chunk;
4949
});
50-
res.on('end', common.mustCall(function() {
50+
res.on('end', common.mustCall(() => {
5151
assert.strictEqual(response, '1\n2\n3\n');
5252
}));
5353
}));

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.