From c792fb7a10120092bfb3847d76d7691490152226 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 --- 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); });