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 <targos@protonmail.com>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
  • Loading branch information
Jayasankar-m authored and targos committed Nov 18, 2018
1 parent 260bb6e commit e9fb811
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 e9fb811

Please sign in to comment.