diff options
author | Jayasankar <jayasankar.m@gmail.com> | 2018-11-17 17:36:44 +0530 |
---|---|---|
committer | Rich Trott <rtrott@gmail.com> | 2018-11-17 21:09:14 -0800 |
commit | 1dadaf90f663b069f75011e6fdc3faba7804feb2 (patch) | |
tree | 6d0c74325c293c438d59b7b9a579fd2aae0c2a79 /test | |
parent | f25123822e6f1a64ebd7ebb5f046780d56b9e6af (diff) | |
download | android-node-v8-1dadaf90f663b069f75011e6fdc3faba7804feb2.tar.gz android-node-v8-1dadaf90f663b069f75011e6fdc3faba7804feb2.tar.bz2 android-node-v8-1dadaf90f663b069f75011e6fdc3faba7804feb2.zip |
test:replace anonymous closure for test-http-expect-handling.js
PR-URL: https://github.com/nodejs/node/pull/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>
Diffstat (limited to 'test')
-rw-r--r-- | test/parallel/test-http-expect-handling.js | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/test/parallel/test-http-expect-handling.js b/test/parallel/test-http-expect-handling.js index 11d2b6ecf4..0a39d49d92 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); }); |