Skip to content

Commit

Permalink
test:replace anonymous closure for test-http-expect-handling.js
Browse files Browse the repository at this point in the history
PR-URL: #24423
Reviewed-By: Michaël Zasso <[email protected]>
Reviewed-By: Gireesh Punathil <[email protected]>
Reviewed-By: Trivikram Kamat <[email protected]>
  • Loading branch information
Jayasankar-m authored and codebytere committed Jan 29, 2019
1 parent cf7bf27 commit f4c2d9e
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions test/parallel/test-http-expect-handling.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const tests = [417, 417];
let testsComplete = 0;
let testIdx = 0;

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

Expand All @@ -34,13 +34,13 @@ function nextTest() {
}));
}

http.get(options, function(response) {
http.get(options, (response) => {
console.log(`client: expected status: ${test}`);
console.log(`client: statusCode: ${response.statusCode}`);
assert.strictEqual(response.statusCode, test);
assert.strictEqual(response.statusMessage, 'Expectation Failed');

response.on('end', function() {
response.on('end', () => {
testsComplete++;
testIdx++;
nextTest();
Expand All @@ -50,6 +50,6 @@ function nextTest() {
}


process.on('exit', function() {
process.on('exit', () => {
assert.strictEqual(testsComplete, 2);
});

0 comments on commit f4c2d9e

Please sign in to comment.