From ffb5e5da4bc30c316d04f1e42e2d1d02433c0e81 Mon Sep 17 00:00:00 2001 From: Jayasankar Date: Sat, 17 Nov 2018 17:36:44 +0530 Subject: [PATCH] test:replace anonymous closure for test-http-expect-handling.js MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit PR-URL: https://github.com/nodejs/node/pull/24423 Reviewed-By: Michaƫl Zasso Reviewed-By: Gireesh Punathil Reviewed-By: Trivikram Kamat --- test/parallel/test-http-expect-handling.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/test/parallel/test-http-expect-handling.js b/test/parallel/test-http-expect-handling.js index 11d2b6ecf4e614..0a39d49d923474 100644 --- a/test/parallel/test-http-expect-handling.js +++ b/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); });