Skip to content

Commit 4792bea

Browse files
sagirkrvagg
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 580eb5b commit 4792bea

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

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

+4-4
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)