diff options
author | Sam Roberts <vieuxtech@gmail.com> | 2019-02-01 12:18:52 -0800 |
---|---|---|
committer | Sam Roberts <vieuxtech@gmail.com> | 2019-02-06 15:18:36 -0800 |
commit | b52a8f3507a6df179d0cf2144c88173607926241 (patch) | |
tree | 4d9b2717226e95a2fb89e0de524b98985426f803 /test | |
parent | a06f67f4543ec8d0c2c0c38fcb731ffca8bf507a (diff) | |
download | android-node-v8-b52a8f3507a6df179d0cf2144c88173607926241.tar.gz android-node-v8-b52a8f3507a6df179d0cf2144c88173607926241.tar.bz2 android-node-v8-b52a8f3507a6df179d0cf2144c88173607926241.zip |
test: use common.mustCall(), and log the events
PR-URL: https://github.com/nodejs/node/pull/25508
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
Diffstat (limited to 'test')
-rw-r--r-- | test/parallel/test-tls-set-encoding.js | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/test/parallel/test-tls-set-encoding.js b/test/parallel/test-tls-set-encoding.js index 77cb5763ae..ad0fcf325d 100644 --- a/test/parallel/test-tls-set-encoding.js +++ b/test/parallel/test-tls-set-encoding.js @@ -40,6 +40,7 @@ const messageUtf8 = 'x√ab c'; const messageAscii = 'xb\b\u001aab c'; const server = tls.Server(options, common.mustCall(function(socket) { + console.log('server: on secureConnection', socket.getProtocol()); socket.end(messageUtf8); })); @@ -55,12 +56,18 @@ server.listen(0, function() { client.setEncoding('ascii'); client.on('data', function(d) { + console.log('client: on data', d); assert.ok(typeof d === 'string'); buffer += d; }); + client.on('secureConnect', common.mustCall(() => { + console.log('client: on secureConnect'); + })); + + client.on('close', common.mustCall(function() { + console.log('client: on close'); - client.on('close', function() { // readyState is deprecated but we want to make // sure this isn't triggering an assert in lib/net.js // See https://github.com/nodejs/node-v0.x-archive/issues/1069. @@ -75,5 +82,5 @@ server.listen(0, function() { assert.strictEqual(messageAscii, buffer); server.close(); - }); + })); }); |