Skip to content

Commit 50d2c8e

Browse files
sam-githubaddaleax
authored andcommitted
test: use common.mustCall(), and log the events
PR-URL: #25508 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: James M Snell <jasnell@gmail.com>
1 parent 1b542e8 commit 50d2c8e

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

test/parallel/test-tls-set-encoding.js

+9-2
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ const messageUtf8 = 'x√ab c';
4040
const messageAscii = 'xb\b\u001aab c';
4141

4242
const server = tls.Server(options, common.mustCall(function(socket) {
43+
console.log('server: on secureConnection', socket.getProtocol());
4344
socket.end(messageUtf8);
4445
}));
4546

@@ -55,12 +56,18 @@ server.listen(0, function() {
5556
client.setEncoding('ascii');
5657

5758
client.on('data', function(d) {
59+
console.log('client: on data', d);
5860
assert.ok(typeof d === 'string');
5961
buffer += d;
6062
});
6163

64+
client.on('secureConnect', common.mustCall(() => {
65+
console.log('client: on secureConnect');
66+
}));
67+
68+
client.on('close', common.mustCall(function() {
69+
console.log('client: on close');
6270

63-
client.on('close', function() {
6471
// readyState is deprecated but we want to make
6572
// sure this isn't triggering an assert in lib/net.js
6673
// See https://github.com/nodejs/node-v0.x-archive/issues/1069.
@@ -75,5 +82,5 @@ server.listen(0, function() {
7582
assert.strictEqual(messageAscii, buffer);
7683

7784
server.close();
78-
});
85+
}));
7986
});

0 commit comments

Comments
 (0)