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
  • Loading branch information
Jayasankar-m committed Nov 17, 2018
1 parent e1aa730 commit c792fb7
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 c792fb7

Please sign in to comment.