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 f4c2d9e

Browse filesBrowse files
Jayasankar-mcodebytere
authored andcommitted
test:replace anonymous closure for test-http-expect-handling.js
PR-URL: #24423 Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
1 parent cf7bf27 commit f4c2d9e
Copy full SHA for f4c2d9e

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-expect-handling.js‎

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