★ wanayoo — archive 1999 https://github.com/nodejs/node/commit/f4c2d9efbcNouvelle recherche | Portail wanayoo
Skip to content
Permalink
Browse files
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>
  • Loading branch information
Jayasankar-m authored and codebytere committed Jan 29, 2019
1 parent cf7bf27 commit f4c2d9efbc53dae38caba1985b1ee93cc8ae1596
Showing with 4 additions and 4 deletions.
  1. +4 −4 test/parallel/test-http-expect-handling.js
@@ -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');
});

@@ -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();
@@ -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.