diff options
author | garygsc <garygsc@gmail.com> | 2019-10-26 02:54:18 -0600 |
---|---|---|
committer | Anna Henningsen <anna@addaleax.net> | 2019-11-30 18:08:59 +0100 |
commit | 79faa875026a275b3e5eca019b3c50e1cbe2e34e (patch) | |
tree | 0fb5327abc56edd199553a66ab3e6f8e0952f2bc /test/addons/openssl-client-cert-engine | |
parent | c8930fb9bf647b88bba9b6e7be4f4ea119fb3d57 (diff) | |
download | android-node-v8-79faa875026a275b3e5eca019b3c50e1cbe2e34e.tar.gz android-node-v8-79faa875026a275b3e5eca019b3c50e1cbe2e34e.tar.bz2 android-node-v8-79faa875026a275b3e5eca019b3c50e1cbe2e34e.zip |
test: use arrow functions in addons tests
Convert all anonymous callback functions in `test/addons/**/*.js`
to use arrow functions, except for those in
`test/addons/make-callback/test.js` (which reference `this`)
`writing-tests.md` states to use arrow functions when appropriate.
PR-URL: https://github.com/nodejs/node/pull/30131
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Yongsheng Zhang <zyszys98@gmail.com>
Diffstat (limited to 'test/addons/openssl-client-cert-engine')
-rw-r--r-- | test/addons/openssl-client-cert-engine/test.js | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/test/addons/openssl-client-cert-engine/test.js b/test/addons/openssl-client-cert-engine/test.js index 9e7d507b07..e843e4bf43 100644 --- a/test/addons/openssl-client-cert-engine/test.js +++ b/test/addons/openssl-client-cert-engine/test.js @@ -43,14 +43,14 @@ const server = https.createServer(serverOptions, common.mustCall((req, res) => { headers: {} }; - const req = https.request(clientOptions, common.mustCall(function(response) { + const req = https.request(clientOptions, common.mustCall((response) => { let body = ''; response.setEncoding('utf8'); - response.on('data', function(chunk) { + response.on('data', (chunk) => { body += chunk; }); - response.on('end', common.mustCall(function() { + response.on('end', common.mustCall(() => { assert.strictEqual(body, 'hello world'); server.close(); })); |