From 93c918ee0cca3ef933f13842f227738eab606da8 Mon Sep 17 00:00:00 2001 From: Justin Lee Date: Fri, 12 Oct 2018 11:19:30 -0700 Subject: [PATCH] test: increased code coverage for proxySessionHandler PR-URL: https://github.com/nodejs/node/pull/23583 Reviewed-By: James M Snell Reviewed-By: Ruben Bridgewater Reviewed-By: Colin Ihrig Reviewed-By: Trivikram Kamat Reviewed-By: Sakthipriyan Vairamani --- test/parallel/test-http2-socket-proxy.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/test/parallel/test-http2-socket-proxy.js b/test/parallel/test-http2-socket-proxy.js index 17f641835de696..600271fdeffc2e 100644 --- a/test/parallel/test-http2-socket-proxy.js +++ b/test/parallel/test-http2-socket-proxy.js @@ -92,6 +92,17 @@ server.on('stream', common.mustCall(function(stream, headers) { stream.end(); + // Setting socket properties sets the session properties correctly. + const fn = () => {}; + socket.setTimeout = fn; + assert.strictEqual(session.setTimeout, fn); + + socket.ref = fn; + assert.strictEqual(session.ref, fn); + + socket.unref = fn; + assert.strictEqual(session.unref, fn); + stream.session.on('close', common.mustCall(() => { assert.strictEqual(session.socket, undefined); }));