Skip to content

Commit f4c2d9e

Browse files
Jayasankar-mcodebytere
authored andcommitted
test:replace anonymous closure for test-http-expect-handling.js
PR-URL: #24423 Reviewed-By: Michaël Zasso <[email protected]> Reviewed-By: Gireesh Punathil <[email protected]> Reviewed-By: Trivikram Kamat <[email protected]>
1 parent cf7bf27 commit f4c2d9e

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

test/parallel/test-http-expect-handling.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ const tests = [417, 417];
99
let testsComplete = 0;
1010
let testIdx = 0;
1111

12-
const s = http.createServer(function(req, res) {
12+
const s = http.createServer((req, res) => {
1313
throw new Error('this should never be executed');
1414
});
1515

@@ -34,13 +34,13 @@ function nextTest() {
3434
}));
3535
}
3636

37-
http.get(options, function(response) {
37+
http.get(options, (response) => {
3838
console.log(`client: expected status: ${test}`);
3939
console.log(`client: statusCode: ${response.statusCode}`);
4040
assert.strictEqual(response.statusCode, test);
4141
assert.strictEqual(response.statusMessage, 'Expectation Failed');
4242

43-
response.on('end', function() {
43+
response.on('end', () => {
4444
testsComplete++;
4545
testIdx++;
4646
nextTest();
@@ -50,6 +50,6 @@ function nextTest() {
5050
}
5151

5252

53-
process.on('exit', function() {
53+
process.on('exit', () => {
5454
assert.strictEqual(testsComplete, 2);
5555
});

0 commit comments

Comments
 (0)